Bases: QComboBox
, Generic[T]
Methods:
Attributes:
Source code
31
32
33
34
35
36
37
38
39
40
41 | def __init__(self, parent: QWidget | None = None, **kwargs: Any) -> None:
super().__init__(parent)
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon)
self.oldValue = self.currentData()
self.oldIndex = self.currentIndex()
self.currentIndexChanged.connect(self._currentIndexChanged)
for arg in kwargs:
getattr(self, 'set' + arg[0].upper() + arg[1:])(kwargs.get(arg))
|
content_type instance-attribute
indexChanged class-attribute
instance-attribute
indexChanged = pyqtSignal(int, int)
oldIndex instance-attribute
oldIndex = currentIndex()
oldValue instance-attribute
valueChanged class-attribute
instance-attribute
currentValue
Source code
| def currentValue(self) -> T:
return cast(T, self.currentData())
|
setCurrentValue
setCurrentValue(newValue: T) -> None
Source code
| def setCurrentValue(self, newValue: T) -> None:
self.setCurrentIndex(self.model().index_of(newValue)) # type: ignore
|