Skip to content

PythonQt.QtGui.QComboBox · declarations 002

Back to PythonQt.QtGui.QComboBox

highlighted

highlighted(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QComboBox.highlighted; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QComboBox::highlighted(int index)

This signal is sent when an item in the combobox popup list is highlighted by the user. The item's index is passed.

Note: Signal highlighted is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:

connect(comboBox, QOverload<int>::of(&QComboBox::highlighted),
    [=](int index){ /* ... */ });

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#highlighted

iconSize instance-attribute

iconSize: QSize

Qt 5 reference:

iconSize : QSize

This property holds the size of the icons shown in the combobox.

Unless explicitly set this returns the default value of the current style. This size is the maximum size that icons can have; icons of smaller size are not scaled up.

Access functions:

QSize iconSize() const
void setIconSize(const QSize \&size)

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#iconSize

initStyleOption

initStyleOption(option: Any) -> None

X.initStyleOption(option)

Supplemental documentation: Qt 5 reference:

[protected] void QComboBox::initStyleOption(QStyleOptionComboBox *option) const

Initialize option with the values from this QComboBox. This method is useful for subclasses when they need a QStyleOptionComboBox, but don't want to fill in all the information themselves.

See also QStyleOption::initFrom().

Upstream PySide2 reference signatures (binding differences may apply):

initStyleOption(self, option: PySide2.QtWidgets.QStyleOptionComboBox) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#initStyleOption

inputMethodEvent

inputMethodEvent(arg__1: Any) -> None

X.inputMethodEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::inputMethodEvent(QInputMethodEvent *e)

Reimplements: QWidget::inputMethodEvent(QInputMethodEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

inputMethodEvent(self, arg__1: PySide2.QtGui.QInputMethodEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#inputMethodEvent

inputMethodQuery

inputMethodQuery(arg__1: Any) -> Any

X.inputMethodQuery(arg__1) -> object

Supplemental documentation: Qt 5 reference:

[override virtual] QVariant QComboBox::inputMethodQuery(Qt::InputMethodQuery query) const

Reimplements: QWidget::inputMethodQuery(Qt::InputMethodQuery query) const.

Upstream PySide2 reference signatures (binding differences may apply):

inputMethodQuery(self, arg__1: PySide2.QtCore.Qt.InputMethodQuery) -> typing.Any
inputMethodQuery(self, query: PySide2.QtCore.Qt.InputMethodQuery, argument: typing.Any) -> typing.Any

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#inputMethodQuery

insertItem

insertItem(index: int, icon: Any, text: str, userData: Any) -> None

X.insertItem(index, icon, text, userData)

Supplemental documentation: Qt 5 reference:

void QComboBox::insertItem(int index, const QString \&text, const QVariant \&userData \= QVariant())

Inserts the text and userData (stored in the Qt::UserRole) into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

See also insertItems().

void QComboBox::insertItem(int index, const QIcon \&icon, const QString \&text, const QVariant \&userData \= QVariant())

Inserts the icon, text and userData (stored in the Qt::UserRole) into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

See also insertItems().

Upstream PySide2 reference signatures (binding differences may apply):

insertItem(self, index: int, icon: PySide2.QtGui.QIcon, text: str, userData: typing.Any=...) -> None
insertItem(self, index: int, text: str, userData: typing.Any=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#insertItem

insertItems

insertItems(index: int, texts: Any) -> None

X.insertItems(index, texts)

Supplemental documentation: Qt 5 reference:

void QComboBox::insertItems(int index, const QStringList \&list)

Inserts the strings from the list into the combobox as separate items, starting at the index specified.

If the index is equal to or higher than the total number of items, the new items are appended to the list of existing items. If the index is zero or negative, the new items are prepended to the list of existing items.

See also insertItem().

Upstream PySide2 reference signatures (binding differences may apply):

insertItems(self, index: int, texts: typing.Sequence[str]) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#insertItems

insertPolicy instance-attribute

insertPolicy: Any

Qt 5 reference:

insertPolicy : InsertPolicy

This property holds the policy used to determine where user-inserted items should appear in the combobox

The default value is InsertAtBottom, indicating that new items will appear at the bottom of the list of items.

Access functions:

QComboBox::InsertPolicy insertPolicy() const
void setInsertPolicy(QComboBox::InsertPolicy policy)

See also InsertPolicy.

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#insertPolicy

insertSeparator

insertSeparator(index: int) -> None

X.insertSeparator(index)

Supplemental documentation: Qt 5 reference:

void QComboBox::insertSeparator(int index)

Inserts a separator item into the combobox at the given index.

If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.

This function was introduced in Qt 4.4.

See also insertItem().

Upstream PySide2 reference signatures (binding differences may apply):

insertSeparator(self, index: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#insertSeparator

isEditable

isEditable() -> bool

X.isEditable() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isEditable(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#isEditable

itemData

itemData(index: int, role: int) -> Any

X.itemData(index, role) -> object

Supplemental documentation: Qt 5 reference:

QVariant QComboBox::itemData(int index, int role \= Qt::UserRole) const

Returns the data for the given role in the given index in the combobox, or QVariant::Invalid if there is no data for this role.

See also setItemData().

Upstream PySide2 reference signatures (binding differences may apply):

itemData(self, index: int, role: int=...) -> typing.Any

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#itemData

itemDelegate

itemDelegate() -> Any

X.itemDelegate() -> PythonQt.QtGui.QAbstractItemDelegate

Supplemental documentation: Qt 5 reference:

QAbstractItemDelegate *QComboBox::itemDelegate() const

Returns the item delegate used by the popup list view.

See also setItemDelegate().

Upstream PySide2 reference signatures (binding differences may apply):

itemDelegate(self) -> PySide2.QtWidgets.QAbstractItemDelegate

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#itemDelegate

itemIcon

itemIcon(index: int) -> Any

X.itemIcon(index) -> PythonQt.QtGui.QIcon

Supplemental documentation: Qt 5 reference:

QIcon QComboBox::itemIcon(int index) const

Returns the icon for the given index in the combobox.

See also setItemIcon().

Upstream PySide2 reference signatures (binding differences may apply):

itemIcon(self, index: int) -> PySide2.QtGui.QIcon

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#itemIcon

itemText

itemText(index: int) -> str

X.itemText(index) -> str

Supplemental documentation: Qt 5 reference:

QString QComboBox::itemText(int index) const

Returns the text for the given index in the combobox.

See also setItemText().

Upstream PySide2 reference signatures (binding differences may apply):

itemText(self, index: int) -> str

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#itemText

keyPressEvent

keyPressEvent(e: Any) -> None

X.keyPressEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::keyPressEvent(QKeyEvent *e)

Reimplements: QWidget::keyPressEvent(QKeyEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

keyPressEvent(self, e: PySide2.QtGui.QKeyEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#keyPressEvent

keyReleaseEvent

keyReleaseEvent(e: Any) -> None

X.keyReleaseEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::keyReleaseEvent(QKeyEvent *e)

Reimplements: QWidget::keyReleaseEvent(QKeyEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

keyReleaseEvent(self, e: PySide2.QtGui.QKeyEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#keyReleaseEvent

lineEdit

lineEdit() -> Any

X.lineEdit() -> PythonQt.QtGui.QLineEdit

Supplemental documentation: Qt 5 reference:

QLineEdit *QComboBox::lineEdit() const

Returns the line edit used to edit items in the combobox, or nullptr if there is no line edit.

Only editable combo boxes have a line edit.

See also setLineEdit().

Upstream PySide2 reference signatures (binding differences may apply):

lineEdit(self) -> PySide2.QtWidgets.QLineEdit

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#lineEdit

maxCount instance-attribute

maxCount: int

Qt 5 reference:

maxCount : int

This property holds the maximum number of items allowed in the combobox

Note: If you set the maximum number to be less then the current amount of items in the combobox, the extra items will be truncated. This also applies if you have set an external model on the combobox.

By default, this property's value is derived from the highest signed integer available (typically 2147483647).

Access functions:

int maxCount() const
void setMaxCount(int max)

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#maxCount

maxVisibleItems instance-attribute

maxVisibleItems: int

Qt 5 reference:

maxVisibleItems : int

This property holds the maximum allowed size on screen of the combo box, measured in items

By default, this property has a value of 10.

Note: This property is ignored for non-editable comboboxes in styles that returns true for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style.

Access functions:

int maxVisibleItems() const
void setMaxVisibleItems(int maxItems)

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#maxVisibleItems

minimumContentsLength instance-attribute

minimumContentsLength: int

Qt 5 reference:

minimumContentsLength : int

This property holds the minimum number of characters that should fit into the combobox.

The default value is 0.

If this property is set to a positive value, the minimumSizeHint() and sizeHint() take it into account.

Access functions:

int minimumContentsLength() const
void setMinimumContentsLength(int characters)

See also sizeAdjustPolicy.

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#minimumContentsLength

minimumSizeHint instance-attribute

minimumSizeHint: QSize

Qt 5 reference:

[override virtual] QSize QComboBox::minimumSizeHint() const

Reimplements an access function for property: QWidget::minimumSizeHint.

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#minimumSizeHint

model

model() -> Any

X.model() -> PythonQt.QtCore.QAbstractItemModel

Supplemental documentation: Qt 5 reference:

QAbstractItemModel *QComboBox::model() const

Returns the model used by the combobox.

See also setModel().

Upstream PySide2 reference signatures (binding differences may apply):

model(self) -> PySide2.QtCore.QAbstractItemModel

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#model

modelColumn instance-attribute

modelColumn: int

Qt 5 reference:

modelColumn : int

This property holds the column in the model that is visible.

If set prior to populating the combo box, the pop-up view will not be affected and will show the first column (using this property's default value).

By default, this property has a value of 0.

Access functions:

int modelColumn() const
void setModelColumn(int visibleColumn)

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#modelColumn

mousePressEvent

mousePressEvent(e: Any) -> None

X.mousePressEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::mousePressEvent(QMouseEvent *e)

Reimplements: QWidget::mousePressEvent(QMouseEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

mousePressEvent(self, e: PySide2.QtGui.QMouseEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#mousePressEvent

mouseReleaseEvent

mouseReleaseEvent(e: Any) -> None

X.mouseReleaseEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::mouseReleaseEvent(QMouseEvent *e)

Reimplements: QWidget::mouseReleaseEvent(QMouseEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

mouseReleaseEvent(self, e: PySide2.QtGui.QMouseEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#mouseReleaseEvent

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QComboBox.objectNameChanged; argument details are not documented.

paintEvent

paintEvent(e: Any) -> None

X.paintEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::paintEvent(QPaintEvent *e)

Reimplements: QWidget::paintEvent(QPaintEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

paintEvent(self, e: PySide2.QtGui.QPaintEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#paintEvent

placeholderText instance-attribute

placeholderText: str

Qt 5 reference:

placeholderText : QString

Sets a placeholderText text shown when no valid index is set

The placeholderText will be shown when an invalid index is set. The text is not accessible in the dropdown list. When this function is called before items are added the placeholder text will be shown, otherwise you have to call setCurrentIndex(-1) programmatically if you want to show the placeholder text. Set an empty placeholder text to reset the setting.

When the QComboBox is editable, use QLineEdit::setPlaceholderText() instead.

This property was introduced in Qt 5.15.

Access functions:

QString placeholderText() const
void setPlaceholderText(const QString \&placeholderText)

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#placeholderText

removeItem

removeItem(index: int) -> None

X.removeItem(index)

Supplemental documentation: Qt 5 reference:

void QComboBox::removeItem(int index)

Removes the item at the given index from the combobox. This will update the current index if the index is removed.

This function does nothing if index is out of range.

Upstream PySide2 reference signatures (binding differences may apply):

removeItem(self, index: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#removeItem

resizeEvent

resizeEvent(e: Any) -> None

X.resizeEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::resizeEvent(QResizeEvent *e)

Reimplements: QWidget::resizeEvent(QResizeEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

resizeEvent(self, e: PySide2.QtGui.QResizeEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#resizeEvent

rootModelIndex

rootModelIndex() -> Any

X.rootModelIndex() -> PythonQt.QtCore.QModelIndex

Supplemental documentation: Qt 5 reference:

QModelIndex QComboBox::rootModelIndex() const

Returns the root model item index for the items in the combobox.

See also setRootModelIndex().

Upstream PySide2 reference signatures (binding differences may apply):

rootModelIndex(self) -> PySide2.QtCore.QModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#rootModelIndex

setCompleter

setCompleter(c: Any) -> None

X.setCompleter(c)

Supplemental documentation: Qt 5 reference:

void QComboBox::setCompleter(QCompleter *completer)

Sets the completer to use instead of the current completer. If completer is nullptr, auto completion is disabled.

By default, for an editable combo box, a QCompleter that performs case insensitive inline completion is automatically created.

Note: The completer is removed when the editable property becomes false. Setting a completer on a QComboBox that is not editable will be ignored.

This function was introduced in Qt 4.2.

See also completer().

Upstream PySide2 reference signatures (binding differences may apply):

setCompleter(self, c: PySide2.QtWidgets.QCompleter) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setCompleter

setCurrentIndex

setCurrentIndex(index: int) -> None

X.setCurrentIndex(index)

Upstream PySide2 reference signatures (binding differences may apply):

setCurrentIndex(self, index: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setCurrentIndex

setCurrentText

setCurrentText(text: str) -> None

X.setCurrentText(text)

Upstream PySide2 reference signatures (binding differences may apply):

setCurrentText(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setCurrentText

setDuplicatesEnabled

setDuplicatesEnabled(enable: bool) -> None

X.setDuplicatesEnabled(enable)

Upstream PySide2 reference signatures (binding differences may apply):

setDuplicatesEnabled(self, enable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setDuplicatesEnabled

setEditText

setEditText(text: str) -> None

X.setEditText(text)

Supplemental documentation: Qt 5 reference:

[slot] void QComboBox::setEditText(const QString \&text)

Sets the text in the combobox's text edit.

Upstream PySide2 reference signatures (binding differences may apply):

setEditText(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setEditText

setEditable

setEditable(editable: bool) -> None

X.setEditable(editable)

Upstream PySide2 reference signatures (binding differences may apply):

setEditable(self, editable: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setEditable

setFrame

setFrame(arg__1: bool) -> None

X.setFrame(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setFrame(self, arg__1: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setFrame

setIconSize

setIconSize(size: Any) -> None

X.setIconSize(size)

Upstream PySide2 reference signatures (binding differences may apply):

setIconSize(self, size: PySide2.QtCore.QSize) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setIconSize

setInsertPolicy

setInsertPolicy(policy: Any) -> None

X.setInsertPolicy(policy)

Upstream PySide2 reference signatures (binding differences may apply):

setInsertPolicy(self, policy: PySide2.QtWidgets.QComboBox.InsertPolicy) -> None

Source: https://doc.qt.io/archives/qt-5.15/qcombobox.html#setInsertPolicy