本系列文章长期更新修改.
QComboBox,中文翻译是组合框?就是一个提供下拉菜单的选值框.
属性:
Types
- enum InsertPolicy { NoInsert, InsertAtTop, InsertAtCurrent, InsertAtBottom, ..., InsertAlphabetically }
- enum SizeAdjustPolicy { AdjustToContents, AdjustToContentsOnFirstShow, AdjustToMinimumContentsLength, AdjustToMinimumContentsLengthWithIcon }
Methods
- __init__ (self, QWidget parent = None)
- addItem (self, QString atext, QVariant auserData = QVariant())
- addItem (self, QIcon aicon, QString atext, QVariant auserData = QVariant())
- addItems (self, QStringList texts)
- bool autoCompletion (self)
- Qt.CaseSensitivity autoCompletionCaseSensitivity (self)
- changeEvent (self, QEvent e)
- clear (self)
- clearEditText (self)
- QCompleter completer (self)
- contextMenuEvent (self, QContextMenuEvent e)
- int count (self)
- int currentIndex (self)
- QString currentText (self)
- bool duplicatesEnabled (self)
- bool event (self, QEvent event)
- int findData (self, QVariant data, int role = Qt.UserRole, Qt.MatchFlags flags = Qt.MatchExactly | Qt.MatchCaseSensitive)
- int findText (self, QString text, Qt.MatchFlags flags = Qt.MatchExactly | Qt.MatchCaseSensitive)
- focusInEvent (self, QFocusEvent e)
- focusOutEvent (self, QFocusEvent e)
- bool hasFrame (self)
- hideEvent (self, QHideEvent e)
- hidePopup (self)
- QSize iconSize (self)
- initStyleOption (self, QStyleOptionComboBox option)
- inputMethodEvent (self, QInputMethodEvent)
- QVariant inputMethodQuery (self, Qt.InputMethodQuery)
- insertItem (self, int aindex, QString atext, QVariant auserData = QVariant())
- insertItem (self, int index, QIcon icon, QString text, QVariant userData = QVariant())
- insertItems (self, int index, QStringList texts)
- InsertPolicy insertPolicy (self)