Class: QgsOptionsDialogBase¶
-
class
qgis.gui.
QgsOptionsDialogBase
(settingsKey: str, parent: QWidget = None, fl: Union[Qt.WindowFlags, Qt.WindowType] = 0, settings: QgsSettings = None)¶ Bases:
PyQt5.QtWidgets.QDialog
Constructor
- Parameters
settingsKey (str) –
QgsSettings
subgroup key for saving/restore ui states, e.g. “ProjectProperties”.parent (QWidget = None) – parent object (owner)
fl (Union[Qt.WindowFlags) – widget flags
settings (
QgsSettings
= None) – customQgsSettings
pointer
A base dialog for options and properties dialogs that offers vertical tabs. It handles saving/restoring of geometry, splitter and current tab states, switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left), and connecting QDialogButtonBox’s accepted/rejected signals to dialog’s accept/reject slots
To use: 1) Start with copy of qgsoptionsdialog_template.ui and build options/properties dialog. 2) In source file for dialog, inherit this class instead of QDialog, then in constructor: … setupUi( this ); // set up .ui file objects initOptionsBase(
False
); // set up this class to use .ui objects, optionally restoring base ui … restoreOptionsBaseUi(); // restore the base ui with initOptionsBase or use this later onMethods
Determine if the options list is in icon only mode
Set up the base ui connections for vertical tabs.
Select relevant tab on current page change
Remove tab and unregister widgets on page remove
- param e
register widgets in the dialog to search for text in it it is automatically called if a line edit has “mSearchLineEdit” as object name.
Resizes all tabs when the dialog is resized
Restore the base ui.
searchText searches for a text in all the pages of the stacked widget and highlight the results
- param settings
- param e
Update tabs on the splitter move
-
actionEvent
(self, QActionEvent)¶
-
changeEvent
(self, QEvent)¶
-
childEvent
(self, QChildEvent)¶
-
closeEvent
(self, QCloseEvent)¶
-
connectNotify
(self, QMetaMethod)¶
-
contextMenuEvent
(self, QContextMenuEvent)¶
-
create
(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
-
customEvent
(self, QEvent)¶
-
destroy
(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
-
disconnectNotify
(self, QMetaMethod)¶
-
dragEnterEvent
(self, QDragEnterEvent)¶
-
dragLeaveEvent
(self, QDragLeaveEvent)¶
-
dragMoveEvent
(self, QDragMoveEvent)¶
-
dropEvent
(self, QDropEvent)¶
-
enterEvent
(self, QEvent)¶
-
event
(self, QEvent) → bool¶
-
eventFilter
(self, QObject, QEvent) → bool¶
-
focusInEvent
(self, QFocusEvent)¶
-
focusNextChild
(self) → bool¶
-
focusNextPrevChild
(self, bool) → bool¶
-
focusOutEvent
(self, QFocusEvent)¶
-
focusPreviousChild
(self) → bool¶
-
hideEvent
(self, QHideEvent)¶
-
iconOnly
(self) → bool¶ Determine if the options list is in icon only mode
- Return type
bool
-
initOptionsBase
(self, restoreUi: bool = True, title: str = '')¶ Set up the base ui connections for vertical tabs.
- Parameters
restoreUi (bool = True) – Whether to restore the base ui at this time.
title (str = '') – the window title
-
initPainter
(self, QPainter)¶
-
inputMethodEvent
(self, QInputMethodEvent)¶
-
isSignalConnected
(self, QMetaMethod) → bool¶
-
keyPressEvent
(self, QKeyEvent)¶
-
keyReleaseEvent
(self, QKeyEvent)¶
-
leaveEvent
(self, QEvent)¶
-
metric
(self, QPaintDevice.PaintDeviceMetric) → int¶
-
mouseDoubleClickEvent
(self, QMouseEvent)¶
-
mouseMoveEvent
(self, QMouseEvent)¶
-
mousePressEvent
(self, QMouseEvent)¶
-
mouseReleaseEvent
(self, QMouseEvent)¶
-
moveEvent
(self, QMoveEvent)¶
-
nativeEvent
(self, Union[QByteArray, bytes, bytearray], sip.voidptr) → Tuple[bool, int]¶
-
optionsStackedWidget_CurrentChanged
(self, index: int)¶ Select relevant tab on current page change
- Parameters
index (int) –
-
optionsStackedWidget_WidgetRemoved
(self, index: int)¶ Remove tab and unregister widgets on page remove
- Parameters
index (int) –
-
paintEvent
(self, e: QPaintEvent)¶ - Parameters
e (QPaintEvent) –
-
receivers
(self, PYQT_SIGNAL) → int¶
-
registerTextSearchWidgets
(self)¶ register widgets in the dialog to search for text in it it is automatically called if a line edit has “mSearchLineEdit” as object name.
New in version 3.0.
-
resizeAlltabs
(self, index: int)¶ Resizes all tabs when the dialog is resized
- Parameters
index (int) – current tab index
New in version 3.10.
-
resizeEvent
(self, QResizeEvent)¶
-
restoreOptionsBaseUi
(self, title: str = '')¶ Restore the base ui. Sometimes useful to do at end of subclass’s constructor.
- Parameters
title (str = '') – the window title (it does not need to be defined if previously given to initOptionsBase();
-
searchText
(self, text: str)¶ searchText searches for a text in all the pages of the stacked widget and highlight the results
- Parameters
text (str) – the text to search
New in version 3.0.
-
sender
(self) → QObject¶
-
senderSignalIndex
(self) → int¶
-
setSettings
(self, settings: QgsSettings)¶ - Parameters
settings (QgsSettings) –
-
showEvent
(self, e: QShowEvent)¶ - Parameters
e (QShowEvent) –
-
tabletEvent
(self, QTabletEvent)¶
-
timerEvent
(self, QTimerEvent)¶
-
updateMicroFocus
(self)¶
-
updateOptionsListVerticalTabs
(self)¶ Update tabs on the splitter move
-
updateWindowTitle
(self)¶
-
warnAboutMissingObjects
(self)¶
-
wheelEvent
(self, QWheelEvent)¶