combo_box¶
Module Contents¶
Combo box item |
|
Combo box base |
|
Combo box |
|
Editable combo box |
|
Combo box menu |
- class ComboItem(text: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase = None, userData=None)¶
Combo box item
- property icon¶
- class ComboBoxBase(parent=None, **kwargs)¶
Bases:
PyQt5.QtCore.QObject
Combo box base
- currentIndexChanged¶
- currentTextChanged¶
- eventFilter(obj, e: PyQt5.QtCore.QEvent)¶
- addItem(text: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase = None, userData=None)¶
add item
Parameters¶
- text: str
the text of item
icon: str | QIcon | FluentIconBase
- removeItem(index: int)¶
Removes the item at the given index from the combobox. This will update the current index if the index is removed.
- currentIndex()¶
- setText(text: str)¶
- currentText()¶
- currentData()¶
- setCurrentText(text)¶
set the current text displayed in combo box, text should be in the item list
Parameters¶
- text: str
text displayed in combo box
- setItemText(index: int, text: str)¶
set the text of item
Parameters¶
- index: int
the index of item
- text: str
new text of item
- itemData(index: int)¶
Returns the data in the given index
- itemText(index: int)¶
Returns the text in the given index
- itemIcon(index: int)¶
Returns the icon in the given index
- setItemData(index: int, value)¶
Sets the data role for the item on the given index
- setItemIcon(index: int, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase)¶
Sets the data role for the item on the given index
- findData(data)¶
Returns the index of the item containing the given data, otherwise returns -1
- findText(text: str)¶
Returns the index of the item containing the given text; otherwise returns -1.
- clear()¶
Clears the combobox, removing all items.
- count()¶
Returns the number of items in the combobox
- insertItem(index: int, text: str, icon: str | PyQt5.QtGui.QIcon | qfluentwidgets.common.icon.FluentIconBase = None, userData=None)¶
Inserts item into the combobox at the given index.
- insertItems(index: int, texts: Iterable[str])¶
Inserts items into the combobox, starting at the index specified.
- setMaxVisibleItems(num: int)¶
- maxVisibleItems()¶
- class ComboBox(parent=None)¶
Bases:
PyQt5.QtWidgets.QPushButton
,ComboBoxBase
Combo box
- currentIndexChanged¶
- currentTextChanged¶
- setPlaceholderText(text: str)¶
- mouseReleaseEvent(e)¶
- paintEvent(e)¶
- class EditableComboBox(parent=None)¶
Bases:
qfluentwidgets.components.widgets.line_edit.LineEdit
,ComboBoxBase
Editable combo box
- currentIndexChanged¶
- currentTextChanged¶
- currentText()¶
- clear()¶
Clears the combobox, removing all items.
- setPlaceholderText(text: str)¶
- class ComboBoxMenu(parent=None)¶
Bases:
qfluentwidgets.components.widgets.menu.RoundMenu
Combo box menu