checkbox im qt_wrapper ergänzt
This commit is contained in:
@@ -41,6 +41,7 @@ QToolButton: Type[Any] = object
|
|||||||
QSizePolicy: Type[Any] = object
|
QSizePolicy: Type[Any] = object
|
||||||
Qt: Type[Any] = object
|
Qt: Type[Any] = object
|
||||||
QComboBox: Type[Any] = object
|
QComboBox: Type[Any] = object
|
||||||
|
QCheckBox: Type[Any] = object
|
||||||
QHBoxLayout: Type[Any] = object
|
QHBoxLayout: Type[Any] = object
|
||||||
|
|
||||||
|
|
||||||
@@ -85,6 +86,7 @@ try:
|
|||||||
QToolButton as _QToolButton,
|
QToolButton as _QToolButton,
|
||||||
QSizePolicy as _QSizePolicy,
|
QSizePolicy as _QSizePolicy,
|
||||||
QComboBox as _QComboBox,
|
QComboBox as _QComboBox,
|
||||||
|
QCheckBox as _QCheckBox,
|
||||||
QHBoxLayout as _QHBoxLayout,
|
QHBoxLayout as _QHBoxLayout,
|
||||||
)
|
)
|
||||||
from qgis.PyQt.QtCore import (
|
from qgis.PyQt.QtCore import (
|
||||||
@@ -129,6 +131,7 @@ try:
|
|||||||
QToolButton = _QToolButton
|
QToolButton = _QToolButton
|
||||||
QSizePolicy = _QSizePolicy
|
QSizePolicy = _QSizePolicy
|
||||||
QComboBox = _QComboBox
|
QComboBox = _QComboBox
|
||||||
|
QCheckBox = _QCheckBox
|
||||||
QVariant = _QVariant
|
QVariant = _QVariant
|
||||||
QHBoxLayout = _QHBoxLayout
|
QHBoxLayout = _QHBoxLayout
|
||||||
# ✅ QT6 ENUMS
|
# ✅ QT6 ENUMS
|
||||||
@@ -179,6 +182,7 @@ except (ImportError, AttributeError):
|
|||||||
QToolButton as _QToolButton,
|
QToolButton as _QToolButton,
|
||||||
QSizePolicy as _QSizePolicy,
|
QSizePolicy as _QSizePolicy,
|
||||||
QComboBox as _QComboBox,
|
QComboBox as _QComboBox,
|
||||||
|
QCheckBox as _QCheckBox,
|
||||||
QHBoxLayout as _QHBoxLayout,
|
QHBoxLayout as _QHBoxLayout,
|
||||||
)
|
)
|
||||||
from PyQt5.QtCore import (
|
from PyQt5.QtCore import (
|
||||||
@@ -221,6 +225,7 @@ except (ImportError, AttributeError):
|
|||||||
QToolButton = _QToolButton
|
QToolButton = _QToolButton
|
||||||
QSizePolicy = _QSizePolicy
|
QSizePolicy = _QSizePolicy
|
||||||
QComboBox = _QComboBox
|
QComboBox = _QComboBox
|
||||||
|
QCheckBox = _QCheckBox
|
||||||
QVariant = _QVariant
|
QVariant = _QVariant
|
||||||
QHBoxLayout= _QHBoxLayout
|
QHBoxLayout= _QHBoxLayout
|
||||||
|
|
||||||
@@ -529,6 +534,22 @@ except (ImportError, AttributeError):
|
|||||||
def setContentsMargins(self, *args, **kwargs):
|
def setContentsMargins(self, *args, **kwargs):
|
||||||
pass
|
pass
|
||||||
QHBoxLayout = _MockQHBoxLayout
|
QHBoxLayout = _MockQHBoxLayout
|
||||||
|
|
||||||
|
class _MockQCheckBox:
|
||||||
|
def __init__(self, text: str = "", *args, **kwargs):
|
||||||
|
self._text = text
|
||||||
|
self._checked = False
|
||||||
|
|
||||||
|
def setText(self, text: str) -> None:
|
||||||
|
self._text = text
|
||||||
|
|
||||||
|
def isChecked(self) -> bool:
|
||||||
|
return self._checked
|
||||||
|
|
||||||
|
def setChecked(self, checked: bool) -> None:
|
||||||
|
self._checked = checked
|
||||||
|
|
||||||
|
QCheckBox = _MockQCheckBox
|
||||||
def exec_dialog(dialog: Any) -> Any:
|
def exec_dialog(dialog: Any) -> Any:
|
||||||
return YES
|
return YES
|
||||||
# --------------------------- TEST ---------------------------
|
# --------------------------- TEST ---------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user