Skip to content

PythonQt.QtGui.QComboBox · declarations 001

Back to PythonQt.QtGui.QComboBox

AdjustToMinimumContentsLength instance-attribute

AdjustToMinimumContentsLength: Any

AdjustToMinimumContentsLengthWithIcon instance-attribute

AdjustToMinimumContentsLengthWithIcon: Any

InsertAfterCurrent instance-attribute

InsertAfterCurrent: Any

InsertAlphabetically instance-attribute

InsertAlphabetically: Any

InsertAtBottom instance-attribute

InsertAtBottom: Any

InsertAtCurrent instance-attribute

InsertAtCurrent: Any

InsertAtTop instance-attribute

InsertAtTop: Any

InsertBeforeCurrent instance-attribute

InsertBeforeCurrent: Any

InsertPolicy instance-attribute

InsertPolicy: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

NoInsert instance-attribute

NoInsert: Any

activated

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

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

Supplemental documentation: Qt 5 reference:

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

This signal is sent when the user chooses an item in the combobox. The item's index is passed. Note that this signal is sent even when the choice is not changed. If you need to know when the choice actually changes, use signal currentIndexChanged() or currentTextChanged().

Note: Signal activated 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::activated),
    [=](int index){ /* ... */ });

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

addItem

addItem(icon: Any, text: str, userData: Any) -> None

X.addItem(icon, text, userData)

Supplemental documentation: Qt 5 reference:

void QComboBox::addItem(const QString \&text, const QVariant \&userData \= QVariant())

Adds an item to the combobox with the given text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

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

Adds an item to the combobox with the given icon and text, and containing the specified userData (stored in the Qt::UserRole). The item is appended to the list of existing items.

Upstream PySide2 reference signatures (binding differences may apply):

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

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

addItems

addItems(texts: Any) -> None

X.addItems(texts)

Supplemental documentation: Qt 5 reference:

void QComboBox::addItems(const QStringList \&texts)

Adds each of the strings in the given texts to the combobox. Each item is appended to the list of existing items in turn.

Upstream PySide2 reference signatures (binding differences may apply):

addItems(self, texts: typing.Sequence[str]) -> None

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

autoCompletion instance-attribute

autoCompletion: bool

autoCompletionCaseSensitivity instance-attribute

autoCompletionCaseSensitivity: Any

changeEvent

changeEvent(e: Any) -> None

X.changeEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::changeEvent(QEvent *e)

Reimplements: QWidget::changeEvent(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

changeEvent(self, e: PySide2.QtCore.QEvent) -> None

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

clear

clear() -> None

X.clear()

Supplemental documentation: Qt 5 reference:

[slot] void QComboBox::clear()

Clears the combobox, removing all items.

Note: If you have set an external model on the combobox this model will still be cleared when calling this function.

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

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

clearEditText

clearEditText() -> None

X.clearEditText()

Supplemental documentation: Qt 5 reference:

[slot] void QComboBox::clearEditText()

Clears the contents of the line edit used for editing in the combobox.

Upstream PySide2 reference signatures (binding differences may apply):

clearEditText(self) -> None

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

completer

completer() -> Any

X.completer() -> PythonQt.QtGui.QCompleter

Supplemental documentation: Qt 5 reference:

QCompleter *QComboBox::completer() const

Returns the completer that is used to auto complete text input for the combobox.

This function was introduced in Qt 4.2.

See also setCompleter() and editable.

Upstream PySide2 reference signatures (binding differences may apply):

completer(self) -> PySide2.QtWidgets.QCompleter

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

contextMenuEvent

contextMenuEvent(e: Any) -> None

X.contextMenuEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::contextMenuEvent(QContextMenuEvent *e)

Reimplements: QWidget::contextMenuEvent(QContextMenuEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

contextMenuEvent(self, e: PySide2.QtGui.QContextMenuEvent) -> None

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

count instance-attribute

count: int

Qt 5 reference:

count : const int

This property holds the number of items in the combobox

By default, for an empty combo box, this property has a value of 0.

Access functions:

int count() const

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

currentData instance-attribute

currentData: Any

Qt 5 reference:

currentData : const QVariant

This property holds the data for the current item

By default, for an empty combo box or a combo box in which no current item is set, this property contains an invalid QVariant.

This property was introduced in Qt 5.2.

Access functions:

QVariant currentData(int role \= Qt::UserRole) const

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

currentIndex instance-attribute

currentIndex: int

Qt 5 reference:

currentIndex : int

This property holds the index of the current item in the combobox.

The current index can change when inserting or removing items.

By default, for an empty combo box or a combo box in which no current item is set, this property has a value of -1.

Access functions:

int currentIndex() const
void setCurrentIndex(int index)

Notifier signal:

void currentIndexChanged(int index)

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

currentIndexChanged

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

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

Supplemental documentation: Qt 5 reference:

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

This signal is sent whenever the currentIndex in the combobox changes either through user interaction or programmatically. The item's index is passed or -1 if the combobox becomes empty or the currentIndex was reset.

Note: Notifier signal for property currentIndex.

Note: Signal currentIndexChanged 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::currentIndexChanged),
    [=](int index){ /* ... */ });

This function was introduced in Qt 4.1.

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

currentText instance-attribute

currentText: str

Qt 5 reference:

currentText : QString

This property holds the current text

If the combo box is editable, the current text is the value displayed by the line edit. Otherwise, it is the value of the current item or an empty string if the combo box is empty or no current item is set.

The setter setCurrentText() simply calls setEditText() if the combo box is editable. Otherwise, if there is a matching text in the list, currentIndex is set to the corresponding index.

Access functions:

QString currentText() const
void setCurrentText(const QString \&text)

Notifier signal:

void currentTextChanged(const QString \&text)

See also editable and setEditText().

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

currentTextChanged

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QComboBox::currentTextChanged(const QString \&text)

This signal is sent whenever currentText changes. The new value is passed as text.

Note: Notifier signal for property currentText.

This function was introduced in Qt 5.0.

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

customContextMenuRequested

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

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

destroyed

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

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

duplicatesEnabled instance-attribute

duplicatesEnabled: bool

Qt 5 reference:

duplicatesEnabled : bool

This property holds whether the user can enter duplicate items into the combobox

Note that it is always possible to programmatically insert duplicate items into the combobox.

By default, this property is false (duplicates are not allowed).

Access functions:

bool duplicatesEnabled() const
void setDuplicatesEnabled(bool enable)

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

editTextChanged

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

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

Supplemental documentation: Qt 5 reference:

[signal] void QComboBox::editTextChanged(const QString \&text)

This signal is emitted when the text in the combobox's line edit widget is changed. The new text is specified by text.

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

editable instance-attribute

editable: Any

Qt 5 reference:

editable : bool

This property holds whether the combo box can be edited by the user

By default, this property is false. The effect of editing depends on the insert policy.

Note: When disabling the editable state, the validator and completer are removed.

Access functions:

bool isEditable() const
void setEditable(bool editable)

See also InsertPolicy.

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

event

event(event: Any) -> bool

X.event(event) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual] bool QComboBox::event(QEvent *event)

Reimplements: QWidget::event(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

event(self, event: PySide2.QtCore.QEvent) -> bool

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

findData

findData(data: Any, role: int, arg2: flags) -> int

X.findData(data, role, flags) -> int

Supplemental documentation: Qt 5 reference:

int QComboBox::findData(const QVariant \&data, int role \= Qt::UserRole, Qt::MatchFlags flags \= static_cast\<Qt::MatchFlags>(Qt::MatchExactly|Qt::MatchCaseSensitive)) const

Returns the index of the item containing the given data for the given role; otherwise returns -1.

The flags specify how the items in the combobox are searched.

Upstream PySide2 reference signatures (binding differences may apply):

findData(self, data: typing.Any, role: int=..., flags: PySide2.QtCore.Qt.MatchFlags=...) -> int

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

findText

findText(text: str, arg1: flags) -> int

X.findText(text, flags) -> int

Supplemental documentation: Qt 5 reference:

int QComboBox::findText(const QString \&text, Qt::MatchFlags flags \= ...) const

Returns the index of the item containing the given text; otherwise returns -1.

The flags specify how the items in the combobox are searched.

Upstream PySide2 reference signatures (binding differences may apply):

findText(self, text: str, flags: PySide2.QtCore.Qt.MatchFlags=...) -> int

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

focusInEvent

focusInEvent(e: Any) -> None

X.focusInEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::focusInEvent(QFocusEvent *e)

Reimplements: QWidget::focusInEvent(QFocusEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

focusInEvent(self, e: PySide2.QtGui.QFocusEvent) -> None

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

focusOutEvent

focusOutEvent(e: Any) -> None

X.focusOutEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::focusOutEvent(QFocusEvent *e)

Reimplements: QWidget::focusOutEvent(QFocusEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

focusOutEvent(self, e: PySide2.QtGui.QFocusEvent) -> None

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

frame instance-attribute

frame: Any

Qt 5 reference:

frame : bool

This property holds whether the combo box draws itself with a frame

If enabled (the default) the combo box draws itself inside a frame, otherwise the combo box draws itself without any frame.

Access functions:

bool hasFrame() const
void setFrame(bool)

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

hasFrame

hasFrame() -> bool

X.hasFrame() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

hasFrame(self) -> bool

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

hideEvent

hideEvent(e: Any) -> None

X.hideEvent(e)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QComboBox::hideEvent(QHideEvent *e)

Reimplements: QWidget::hideEvent(QHideEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

hideEvent(self, e: PySide2.QtGui.QHideEvent) -> None

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

hidePopup

hidePopup() -> None

X.hidePopup()

Supplemental documentation: Qt 5 reference:

[virtual] void QComboBox::hidePopup()

Hides the list of items in the combobox if it is currently visible and resets the internal state, so that if the custom pop-up was shown inside the reimplemented showPopup(), then you also need to reimplement the hidePopup() function to hide your custom pop-up and call the base class implementation to reset the internal state whenever your custom pop-up widget is hidden.

See also showPopup().

Upstream PySide2 reference signatures (binding differences may apply):

hidePopup(self) -> None

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