Combobox
- class ExtendedComboBox(*args: Any, **kwargs: Any)
Bases:
QComboBoxExtended combobox to also have a filter
- addItem(text, isCheckable=False)
- keyPressEvent(event)
- onCompleterActivated(text)
On selection of an item from the completer, this method will select the item from the combobox
- setModel(model)
Overridden to set the filter and completer models
- setModelColumn(column)
- handleItemPressed(index)
- stateList()
- checkedItems()
- class ComboItemChangedEvent(prevIndex, currIndex, parent)
Bases:
object- property text
- property prevText
- property data
- property prevData
- class ComboBox(*args: Any, **kwargs: Any)
Bases:
QWidget- prevIndex = None
- clear()
Clear all items. Method used for autocomplete
- addItem(item, sortAlphabetically=False, userData=None)
Adds an item to the combobox with the given text , and containing the specified userData (stored in the UserRole ). The item is appended to the list of existing items.
- currentData(role=MockExt.QtCore.Qt.UserRole)
- property activated
- property currentIndexChanged
- setItemText(index, text)
- currentIndex()
Returns the int value of the combo box. Method used for autocomplete
- Return currentIndex:
the int value of the combo box
- Rtype currentIndex:
int
- value()
Returns the literal value of the combo box
- Return value:
the literal value of the combo box
- Rtype value:
str
- currentText()
Method used for autocomplete
- count()
Method used for autocomplete
- addItems(items, sortAlphabetically=False)
Add items to combobox
- Parameters:
items
sortAlphabetically
- Returns:
- itemData(index, role=MockExt.QtCore.Qt.UserRole)
Method used for autocomplete
- iterItemData()
- onItemChanged()
when the items changed return the tuple of values
- setToText(text, flags=MockExt.QtCore.Qt.MatchFixedString)
Sets the index based on the text
- Parameters:
text (str) – Text to search and switch the comboxBox to
- removeItemByText(text, flags=MockExt.QtCore.Qt.MatchFixedString)
removes the index based on the text from the combo box (box.removeItem)
- Parameters:
text (str) – Text to search and delete it’s entire entry from the combo box (removeItem)
- setToTextQuiet(text)
Sets the index based on the text and stops comboBox from emitting signals while being changed
- Parameters:
text (str) – Text to search and switch the comboxBox to
- setIndex(index, quiet=False)
Sets the combo box to the current index number
- Parameters:
index (int) – Sets the combo box to the current index
- setIndexQuiet(index)
Sets the combo box to the current index number, stops comboBox from emitting signals while being changed
- Parameters:
index (int) – the index item number of the comboBox
- setLabelFixedWidth(width)
Set the fixed width of the label
- Parameters:
width (int) – the width in pixels, DPI is handled
- setBoxFixedWidth(width)
Set the fixed width of the lineEdit
- Parameters:
width (int) – the width in pixels, DPI is handled
- setItemData(index, value)
Sets the data role for the item on the given index in the combobox to the specified value. Good for metadata assigned to the name
- itemText(index)
Get current text from combobox
- Parameters:
index
- Returns:
- itemTexts()
Get all the items in the combobox
- Returns:
- Return type:
- blockSignals(blocked=False)
Manually block the combobox and label
- class ComboBoxRegular(*args: Any, **kwargs: Any)
Bases:
ComboBoxCreates a regular “not searchable” combo box (drop down menu) with a label
TODO: this class should be combined with ComboBox, no need to have them apart?
- classmethod setupComboBox(parent=None, items=(), itemData=(), toolTip='', setIndex=0, sortAlphabetically=False, supportMiddleMouseScroll=True)
Simple qComboBox with no label
- class HumbleComboBox(*args: Any, **kwargs: Any)
Bases:
QComboBoxQComboBox which ignores the wheelEvent
- wheelEvent(event)
Combo Edit Widget
- class ComboMainWidget(*args: Any, **kwargs: Any)
Bases:
QFrameMain combo widget that holds the labels and drop down menu button
- mouseDoubleClickEvent(event)
- mousePressEvent(event)
Mouse Press event
- Parameters:
event
- Returns:
- Return type:
- class ComboEdit(*args: Any, **kwargs: Any)
Bases:
StringEdit- mousePressEvent(event)
Mouse Press event
- Parameters:
event
- Returns:
- Return type:
- class ComboEditFloat(*args: Any, **kwargs: Any)
Bases:
FloatEdit- mousePressEvent(event)
Mouse Press event
- Parameters:
event
- Returns:
- Return type:
- class ComboEditInt(*args: Any, **kwargs: Any)
Bases:
IntEdit- mousePressEvent(event)
Mouse Press event
- Parameters:
event
- Returns:
- Return type:
- class ComboEditWidget(*args: Any, **kwargs: Any)
Bases:
QWidgetCreate our own combobox
- Default = 0
- EditWidget = 1
- SearchWidget = 2
- SeparatorString = '---=---'
- property comboEdit
Shorthand for self.comboEdits[0]
- Return type:
stringedit.StringEdit
- initUi(labelStretch, mainStretch)
Init ui
- Parameters:
labelStretch
mainStretch
- Returns:
- Return type:
- connections()
Set up connections
- Returns:
- Return type:
- aspectLinked(button=None)
Returns True if aspect is linked, false otherwise
- Returns:
- Return type:
- toggleAspectLinkBtn(updateAspect=False)
Toggle Aspect Link button
- Returns:
- Return type:
- setAspectLinked(newLinked, button=None, updateAspect=False)
Set aspect linked to True or False
- Parameters:
button
newLinked
updateAspect
- Returns:
- Return type:
- updateAspect(sender=None)
Update aspect ratio of scene
- Returns:
- Return type:
- addItems(items, data=None)
Add items to widget
- Parameters:
items (list[basestring]) – List of items as string to add
data (list[object]) – List of objects
- Returns:
- Return type:
- setText(text, index=0, setItem=False)
Set text of the combo edit
- Parameters:
setItem (If the text matches the item text then set the item as well)
text
- Returns:
- Return type:
- setValue(value, index=0)
- setValues(values, setItem=True)
Set the values. Float or int
- Parameters:
values
setItem
- Returns:
- Return type:
- setTexts(texts, setItem=False)
Set text of the combo edit
- Parameters:
setItem (If the text matches the item text then set the item as well)
texts (list(str))
- Returns:
- Return type:
- findMatchingIndex(texts)
Find matching index based on the list of texts
- Parameters:
texts (list)
- Returns:
the index of the first found match. -1 if not found
- Return type:
- addSeparator()
Add Separator
- Returns:
- Return type:
- model()
Get the model
- Returns:
- Return type:
- items()
Get All items
- Returns:
- Return type:
- addItem(text, data=None)
Add item to menu
- Parameters:
text
data
- Returns:
- Return type:
- setLabelMenu(menu, mouseButton=MockExt.QtCore.Qt.LeftButton)
Set the name label menu
- Parameters:
menu
mouseButton
- Returns:
- Return type:
- currentItem()
Current Item
- Returns:
- Return type:
Qt.QtGui.QStandardItem
- comboEditReturnPressed()
When the return key is pressed for the combo edit
- Returns:
- Return type:
- editFinished()
Edit finished
- Returns:
- Return type:
- itemRenamedEvent(event)
On Item renamed event
- Parameters:
event (
EditChangedEvent)
- wheelEvent(event)
Mouse Wheel event
- Parameters:
event
- Returns:
- Return type:
- currentMouseOver()
Gets the widget currently moused over
- Returns:
- Return type:
QtWidgets.QWidget
- scrollPrev()
Scrolls to previous index
- Returns:
- Return type:
- scrollNext()
Scrolls to next index
- Returns:
- Return type:
- scrollIndex(next=True)
Scroll index
- Parameters:
next
- Returns:
- Return type:
- blockSignals(b)
Block signals.
Make sure it blocks the signals of the child widgets as well
- Parameters:
b
- Returns:
- Return type:
- indexChanged(event)
Item clicked
- Parameters:
event (zoo.libs.pyqt.extended.combobox.combomenupopup.ComboCustomEvent)
- Returns:
- Return type:
- itemText(index)
Get item text from an index
- Parameters:
index (QtGui.QModelIndex)
- Returns:
- Return type:
- activatePopup()
Activate the popup and place it below the widget
- Returns:
- Return type:
- activateWidget(widgetType, sender=None)
Activate the widget based on the type used
- Parameters:
widgetType
sender (QtWidgets.QWidget or elements.ComboEdit)
- Returns:
- Return type:
- activateMainWidget(event)
Activate Rename Widget
- Parameters:
event
- Returns:
- Return type:
- setCurrentIndex(index)
Set the index by int, instead of a QModelIndex
- Parameters:
index (int)
- Returns:
- Return type:
- setIndexInt(index)
Set the index by int, instead of a QModelIndex
- Parameters:
index (int)
- Returns:
- Return type:
- label()
Returns the label
- Returns:
- Return type:
- setLabel(text)
Returns the label
- Returns:
- Return type:
- currentIndex()
Get the current index as int
- Returns:
- Return type:
- currentIndexInt()
Get the current index as int
- Returns:
- Return type:
- currentData()
Gets the current data
- Returns:
- Return type:
- itemData(index)
Get the item data
- Parameters:
index (int)
- Returns:
- Return type:
Qt.QtGui.QStandardItem
- iterItemData()
Iterate through the item data
- Returns:
- Return type:
collections.Iterable[Qt.QtGui.QStandardItem]
- currentText(index=0)
The text of the combo menu
- Returns:
- Return type:
- text(index=0)
Returns value of the text boxes as a list as float or int or string depending on the edit mode
- Parameters:
index (int) – Current index of the possible text edits
- Return value:
Returns value of the text edit, can be float or int or string depending on the edit mode
- Rtype value:
float or int or string
- texts()
Returns all values of the text boxes as a list
Same as self.values()
- Return valueList:
Returns values of the text edits, can be float or int or string depending on the edit mode
- Rtype valueList:
list(float or int or string)
- values()
Return the values of the combo edits
- Returns:
- Return type:
- count()
Number of items
- Returns:
- Return type:
- clear()
Clear out the items
- Returns:
- Return type:
- updateList(nameList, dataList=None, setName=None)
Updates the lists and optionally sets the index by the given name.
- The name list can contain separators in the format:
self.SeparatorString = “—=—”
- state(newValue=None)
Get the state of the widget
- Returns:
- Return type:
- class ComboEditRename(*args: Any, **kwargs: Any)
Bases:
ComboEditWidgetSame as Combo Menu Rename Functionality for toolsets