napari.qt.QtStateButton¶
- class napari.qt.QtStateButton(button_name, target, attribute, events, onstate=True, offstate=False)[source]¶
Bases:
napari._qt.widgets.qt_viewer_buttons.QtViewerPushButton
Button to toggle between two states. :param button_name: A string that will be used in qss to style the button with the
QtStateButton[mode=…] selector,
- Parameters
target (object) – object on which you want to change the property when button pressed.
attribute – name of attribute on object you wish to change.
events (EventEmitter) – event emitter that will trigger when value is changed
onstate (Any) – value to use for
setattr(object, attribute, onstate)
when clicking this buttonoffstate (Any) – value to use for
setattr(object, attribute, offstate)
when clicking this button.
Methods
Attributes
DrawChildren
DrawWindowBackground
IgnoreMask
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
bool = False) [signal]
QPoint) [signal]
typing.Optional[QObject] = None) [signal]
str) [signal]
pressed(self) [signal]
released(self) [signal]
staticMetaObject
bool) [signal]
QIcon) [signal]
str) [signal]
str) [signal]
Details
- class RenderFlags¶
- class RenderFlags(f: Union[QWidget.RenderFlags, QWidget.RenderFlag]) → None
- class RenderFlags(a0: QWidget.RenderFlags) → None
Bases:
sip.simplewrapper
- actionEvent(self, a0: QActionEvent)¶
- actions(self) → List[QAction]¶
- activateWindow(self)¶
- addAction(self, action: QAction)¶
- addActions(self, actions: Iterable[QAction])¶
- adjustSize(self)¶
- backgroundRole(self) → QPalette.ColorRole¶
- baseSize(self) → QSize¶
- changeEvent(self, e: QEvent)¶
- checkStateSet(self)¶
- childEvent(self, a0: QChildEvent)¶
- children(self) → List[QObject]¶
- childrenRect(self) → QRect¶
- childrenRegion(self) → QRegion¶
- clearFocus(self)¶
- clearMask(self)¶
- click(self)¶
- clicked¶
bool = False) [signal]
- Type
clicked(self, checked
- closeEvent(self, a0: QCloseEvent)¶
- connectNotify(self, signal: QMetaMethod)¶
- contentsMargins(self) → QMargins¶
- contentsRect(self) → QRect¶
- contextMenuEvent(self, a0: QContextMenuEvent)¶
- contextMenuPolicy(self) → Qt.ContextMenuPolicy¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- createWindowContainer(window: QWindow, parent: Optional[QWidget] = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = 0) → QWidget¶
- cursor(self) → QCursor¶
- customContextMenuRequested¶
QPoint) [signal]
- Type
customContextMenuRequested(self, pos
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- disconnectNotify(self, signal: QMetaMethod)¶
- dragEnterEvent(self, a0: QDragEnterEvent)¶
- dragLeaveEvent(self, a0: QDragLeaveEvent)¶
- dragMoveEvent(self, a0: QDragMoveEvent)¶
- dropEvent(self, a0: QDropEvent)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) → List[QByteArray]¶
- effectiveWinId(self) → PyQt5.sip.voidptr¶
- ensurePolished(self)¶
- enterEvent(self, a0: QEvent)¶
- find(a0: PyQt5.sip.voidptr) → QWidget¶
- findChild(self, type: type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject¶
- findChild(self, types: Tuple, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject
- findChildren(self, type: type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]¶
- findChildren(self, types: Tuple, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]
- findChildren(self, type: type, regExp: QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]
- findChildren(self, types: Tuple, regExp: QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]
- focusInEvent(self, a0: QFocusEvent)¶
- focusOutEvent(self, a0: QFocusEvent)¶
- focusPolicy(self) → Qt.FocusPolicy¶
- focusProxy(self) → QWidget¶
- focusWidget(self) → QWidget¶
- font(self) → QFont¶
- fontInfo(self) → QFontInfo¶
- fontMetrics(self) → QFontMetrics¶
- foregroundRole(self) → QPalette.ColorRole¶
- frameGeometry(self) → QRect¶
- frameSize(self) → QSize¶
- geometry(self) → QRect¶
- grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) → QPixmap¶
- grabGesture(self, type: Qt.GestureType, flags: Union[Qt.GestureFlags, Qt.GestureFlag] = Qt.GestureFlags())¶
- grabKeyboard(self)¶
- grabShortcut(self, key: Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) → int¶
- graphicsEffect(self) → QGraphicsEffect¶
- graphicsProxyWidget(self) → QGraphicsProxyWidget¶
- group(self) → QButtonGroup¶
- hide(self)¶
- hideEvent(self, a0: QHideEvent)¶
- icon(self) → QIcon¶
- iconSize(self) → QSize¶
- initPainter(self, painter: QPainter)¶
- initStyleOption(self, option: QStyleOptionButton)¶
- inputMethodEvent(self, a0: QInputMethodEvent)¶
- inputMethodHints(self) → Qt.InputMethodHints¶
- inputMethodQuery(self, a0: Qt.InputMethodQuery) → Any¶
- insertAction(self, before: QAction, action: QAction)¶
- insertActions(self, before: QAction, actions: Iterable[QAction])¶
- installEventFilter(self, a0: QObject)¶
- keyPressEvent(self, a0: QKeyEvent)¶
- keyReleaseEvent(self, e: QKeyEvent)¶
- keyboardGrabber() → QWidget¶
- layout(self) → QLayout¶
- layoutDirection(self) → Qt.LayoutDirection¶
- leaveEvent(self, a0: QEvent)¶
- locale(self) → QLocale¶
- lower(self)¶
- mapFrom(self, a0: QWidget, a1: QPoint) → QPoint¶
- mapFromGlobal(self, a0: QPoint) → QPoint¶
- mapFromParent(self, a0: QPoint) → QPoint¶
- mapTo(self, a0: QWidget, a1: QPoint) → QPoint¶
- mapToGlobal(self, a0: QPoint) → QPoint¶
- mapToParent(self, a0: QPoint) → QPoint¶
- mask(self) → QRegion¶
- maximumSize(self) → QSize¶
- menu(self) → QMenu¶
- metaObject(self) → QMetaObject¶
- metric(self, a0: QPaintDevice.PaintDeviceMetric) → int¶
- minimumSize(self) → QSize¶
- minimumSizeHint(self) → QSize¶
- mouseDoubleClickEvent(self, a0: QMouseEvent)¶
- mouseGrabber() → QWidget¶
- mouseMoveEvent(self, e: QMouseEvent)¶
- mousePressEvent(self, e: QMouseEvent)¶
- mouseReleaseEvent(self, e: QMouseEvent)¶
- moveEvent(self, a0: QMoveEvent)¶
- moveToThread(self, thread: QThread)¶
- nativeEvent(self, eventType: Union[QByteArray, bytes, bytearray], message: PyQt5.sip.voidptr) → Tuple[bool, int]¶
- nativeParentWidget(self) → QWidget¶
- nextCheckState(self)¶
- nextInFocusChain(self) → QWidget¶
- normalGeometry(self) → QRect¶
- objectNameChanged¶
str) [signal]
- Type
objectNameChanged(self, objectName
- overrideWindowFlags(self, type: Union[Qt.WindowFlags, Qt.WindowType])¶
- overrideWindowState(self, state: Union[Qt.WindowStates, Qt.WindowState])¶
- paintEngine(self) → QPaintEngine¶
- paintEvent(self, a0: QPaintEvent)¶
- palette(self) → QPalette¶
- parent(self) → QObject¶
- parentWidget(self) → QWidget¶
- pos(self) → QPoint¶
- pressed¶
pressed(self) [signal]
- previousInFocusChain(self) → QWidget¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- raise_(self)¶
- rect(self) → QRect¶
- releaseKeyboard(self)¶
- releaseMouse(self)¶
- released¶
released(self) [signal]
- removeAction(self, action: QAction)¶
- removeEventFilter(self, a0: QObject)¶
- render(self, target: QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren))¶
- render(self, painter: QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren)) → None
- repaint(self)¶
- repaint(self, x: int, y: int, w: int, h: int) → None
- repaint(self, a0: QRect) → None
- repaint(self, a0: QRegion) → None
- resizeEvent(self, a0: QResizeEvent)¶
- saveGeometry(self) → QByteArray¶
- screen(self) → QScreen¶
- sender(self) → QObject¶
- setBackgroundRole(self, a0: QPalette.ColorRole)¶
- setContentsMargins(self, left: int, top: int, right: int, bottom: int)¶
- setContentsMargins(self, margins: QMargins) → None
- setContextMenuPolicy(self, policy: Qt.ContextMenuPolicy)¶
- setCursor(self, a0: Union[QCursor, Qt.CursorShape])¶
- setFocusPolicy(self, policy: Qt.FocusPolicy)¶
- setFocusProxy(self, a0: QWidget)¶
- setFont(self, a0: QFont)¶
- setForegroundRole(self, a0: QPalette.ColorRole)¶
- setGraphicsEffect(self, effect: QGraphicsEffect)¶
- setIcon(self, icon: QIcon)¶
- setIconSize(self, size: QSize)¶
- setInputMethodHints(self, hints: Union[Qt.InputMethodHints, Qt.InputMethodHint])¶
- setLayout(self, a0: QLayout)¶
- setLayoutDirection(self, direction: Qt.LayoutDirection)¶
- setLocale(self, locale: QLocale)¶
- setMenu(self, menu: QMenu)¶
- setPalette(self, a0: QPalette)¶
- setParent(self, parent: QWidget)¶
- setParent(self, parent: QWidget, f: Union[Qt.WindowFlags, Qt.WindowType]) → None
- setSizePolicy(self, a0: QSizePolicy)¶
- setSizePolicy(self, hor: QSizePolicy.Policy, ver: QSizePolicy.Policy) → None
- setStyle(self, a0: QStyle)¶
- setTabOrder(a0: QWidget, a1: QWidget)¶
- setWindowFlags(self, type: Union[Qt.WindowFlags, Qt.WindowType])¶
- setWindowIcon(self, icon: QIcon)¶
- setWindowModality(self, windowModality: Qt.WindowModality)¶
- setWindowState(self, state: Union[Qt.WindowStates, Qt.WindowState])¶
- sharedPainter(self) → QPainter¶
- shortcut(self) → QKeySequence¶
- show(self)¶
- showEvent(self, a0: QShowEvent)¶
- showFullScreen(self)¶
- showMaximized(self)¶
- showMenu(self)¶
- showMinimized(self)¶
- showNormal(self)¶
- size(self) → QSize¶
- sizeHint(self) → QSize¶
- sizeIncrement(self) → QSize¶
- sizePolicy(self) → QSizePolicy¶
- stackUnder(self, a0: QWidget)¶
- style(self) → QStyle¶
- tabletEvent(self, a0: QTabletEvent)¶
- thread(self) → QThread¶
- timerEvent(self, e: QTimerEvent)¶
- toggle(self)¶
- toggled¶
bool) [signal]
- Type
toggled(self, checked
- ungrabGesture(self, type: Qt.GestureType)¶
- unsetCursor(self)¶
- unsetLayoutDirection(self)¶
- unsetLocale(self)¶
- update(self)¶
- update(self, a0: QRect) → None
- update(self, a0: QRegion) → None
- update(self, ax: int, ay: int, aw: int, ah: int) → None
- updateGeometry(self)¶
- updateMicroFocus(self)¶
- visibleRegion(self) → QRegion¶
- wheelEvent(self, a0: QWheelEvent)¶
- winId(self) → PyQt5.sip.voidptr¶
- window(self) → QWidget¶
- windowFlags(self) → Qt.WindowFlags¶
- windowHandle(self) → QWindow¶
- windowIcon(self) → QIcon¶
- windowIconChanged¶
QIcon) [signal]
- Type
windowIconChanged(self, icon
- windowIconTextChanged¶
str) [signal]
- Type
windowIconTextChanged(self, iconText
- windowModality(self) → Qt.WindowModality¶
- windowState(self) → Qt.WindowStates¶
- windowTitleChanged¶
str) [signal]
- Type
windowTitleChanged(self, title
- windowType(self) → Qt.WindowType¶