Twenty-nine -QInputDialog study concluded GUI learning

The final dialog box is used to provide a window QInputDialog ,, input.

A common static methods

  Because different types of input, QInputDialog into more static method

# There shaping step regulator data, step set incremental steps regulator 
QInputDialog.getInt (parent: QWidget, title: str, label: str, value: int = ..., min: int =. .., max: int = ..., sTEP: int = ..., the flags: typing.Union [QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ...)
 # are embossed step regulator font data, decimals decimal place 
QInputDialog.getDouble (parent: QWidget, title: str, label: str, value: float = ..., min: float = ..., max: float = ..., decimals : int = ..., the flags: typing.Union [QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ...)
 # single line of text data, echo mode output (plain text password or not displayed) 
QInputDialog.getText (parent: the QWidget, title: STR, label: STR, echo: ' QLineEdit.EchoMode '= ..., text: str = ... , flags: typing.Union [QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ..., inputMethodHints: typing.Union [QtCore.Qt.InputMethodHints, QtCore. Qt.InputMethodHint] = ...)
 # multiline text 
QInputDialog.getMultiLineText (parent: QWidget, title: str, label: str, text: str = ..., flags: typing.Union [QtCore.Qt.WindowFlags, QtCore .Qt.WindowType] = ..., inputMethodHints: typing.Union [QtCore.Qt.InputMethodHints, QtCore.Qt.InputMethodHint] = ...)
 # # drop-down list, qizhong item drop-down list of contents, from the inner iterations must string format
QInputDialog.getItem(parent: QWidget, title: str, label: str, items: typing.Iterable[str], current: int = ..., editable: bool = ..., flags: typing.Union[QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ..., inputMethodHints: typing.Union[QtCore.Qt.InputMethodHints, QtCore.Qt.InputMethodHint] = ...)

All dialogs are all return values, the return is Ganso, the first element is input in the corresponding content, the second element is a Boolean, if the dialog is pressing OK returns 1 return 0 is canceled.

II. Function

  1. Constructor

QInputDialog(self, parent: typing.Optional[QWidget] = ..., flags: typing.Union[QtCore.Qt.WindowFlags, QtCore.Qt.WindowType] = ...)
Window = ...  # type: 'Qt.WindowType'
Dialog = ...  # type: 'Qt.WindowType'
Sheet = ...  # type: 'Qt.WindowType'
Drawer = ...  # type: 'Qt.WindowType'
Popup = ...  # type: 'Qt.WindowType'
Tool = ...  # type: 'Qt.WindowType'
ToolTip = ...  # type: 'Qt.WindowType'
SplashScreen = ...  # type: 'Qt.WindowType'
Desktop = ...  # type: 'Qt.WindowType'
SubWindow = ...  # type: 'Qt.WindowType'
WindowType_Mask = ...  # type: 'Qt.WindowType'
MSWindowsFixedSizeDialogHint = ...  # type: 'Qt.WindowType'
MSWindowsOwnDC = ...  # type: 'Qt.WindowType'
X11BypassWindowManagerHint = ...  # type: 'Qt.WindowType'
FramelessWindowHint = ...  # type: 'Qt.WindowType'
CustomizeWindowHint = ...  # type: 'Qt.WindowType'
WindowTitleHint = ...  # type: 'Qt.WindowType'
WindowSystemMenuHint = ...  # type: 'Qt.WindowType'
WindowMinimizeButtonHint = ...  # type: 'Qt.WindowType'
WindowMaximizeButtonHint = ...  # type: 'Qt.WindowType'
WindowMinMaxButtonsHint = ...  # type: 'Qt.WindowType'
WindowContextHelpButtonHint = ...  # type: 'Qt.WindowType'
WindowShadeButtonHint = ...  # type: 'Qt.WindowType'
WindowStaysOnTopHint = ...  # type: 'Qt.WindowType'
WindowOkButtonHint = ...  # type: 'Qt.WindowType'
WindowCancelButtonHint = ...  # type: 'Qt.WindowType'
WindowStaysOnBottomHint = ...  # type: 'Qt.WindowType'
WindowCloseButtonHint = ...  # type: 'Qt.WindowType'
MacWindowToolBarButtonHint = ...  # type: 'Qt.WindowType'
BypassGraphicsProxyWidget = ...  # type: 'Qt.WindowType'
WindowTransparentForInput = ...  # type: 'Qt.WindowType'
WindowOverridesSystemGestures = ...  # type: 'Qt.WindowType'
WindowDoesNotAcceptFocus = ...  # type: 'Qt.WindowType'
NoDropShadowWindowHint = ...  # type: 'Qt.WindowType'
WindowFullscreenButtonHint = ...  # type: 'Qt.WindowType'
ForeignWindow = ...  # type: 'Qt.WindowType'
BypassWindowManagerHint = ...  # type: 'Qt.WindowType'
CoverWindow = ...  # type: 'Qt.WindowType'
MaximizeUsingFullscreenGeometryHint = ...  # type: 'Qt.WindowType'
enumeration value corresponding flag

  It should be noted that flag (top-level window style signs) the corresponding enumeration value. Or have some of the most common effects below where you can also set setoption

  2. Enter the type setting

QInputDialog.setInputMode(self, mode: 'QInputDialog.InputMode')
TextInput = ...  # type: 'QInputDialog.InputMode'
IntInput = ...  # type: 'QInputDialog.InputMode'
DoubleInput = ...  # type: 'QInputDialog.InputMode'

 Note that the main types here there are no drop-down list, because the drop-down list is the need for additional set

QInputDialog.setComboBoxItems (Self, items: typing.Iterable [str]) 
QInputDialog.setComboBoxEditable ()   # list contents can be edited

  3. option settings (input type)

QInputDialog.setOption(self, option: 'QInputDialog.InputDialogOption', on: bool = ...)
QInputDialog.setOptions(self, options: typing.Union[
'QInputDialog.InputDialogOptions', 'QInputDialog.InputDialogOption']) QInputDialog.testOption(self, option: 'QInputDialog.InputDialogOption') -> bool: ... QInputDialog.options()-> 'QInputDialog.InputDialogOptions': ...
NoButtons = ... # type: 'QInputDialog.InputDialogOption'
UseListViewForComboBoxItems = ... # type: 'QInputDialog.InputDialogOption'
UsePlainTextEditForTextInput = ... # type: 'QInputDialog.InputDialogOption'

  4. The classification of various small set

QInputDialog.setIntMaximum()
QInputDialog.setIntMinimum()
QInputDialog.setIntRange()
QInputDialog.setIntStep()
QInputDialog.setIntValue()
Shaping Data
QInputDialog.setDoubleMaximum()
QInputDialog.setDoubleMinimum()
QInputDialog.setDoubleRange()
QInputDialog.setDoubleDecimals()
QInputDialog.setDoubleValue()
Floating-point data
QInputDialog.setTextEchoMode()
QInputDialog.setTextValue()
String type

  Be sure to set the kind of small and the input data type settings are the same. Otherwise, there is no effect (input type setting high priority.)

III. Common signals

QInputDialog.intValueChanged()
QInputDialog.intValueSelected()
QInputDialog.doubleValueChanged()
QInputDialog.doubleValueSelected()
QInputDialog.textValueChanged()
QInputDialog.textValueSelected()

Note the difference, changed after that as long as the value is changed (do not need to confirm the selection), and click the OK button Select is the only trigger occurs. But it is passed as a parameter value.

  

Guess you like

Origin www.cnblogs.com/yinsedeyinse/p/11575860.html