8.6.12. pymodaq_gui.qt_utils module
- class pymodaq_gui.qt_utils.ThemeSignaller[source]
Bases:
QObjectEmits
theme_changed(theme)each timeapply_theme()applies a theme.Methods
theme_changed
- staticMetaObject = PySide6.QtCore.QMetaObject("ThemeSignaller" inherits "QObject": Methods: #4 type=Signal, signature=theme_changed(PyObject), parameters=PyObject )
- theme_changed
- class pymodaq_gui.qt_utils.WhiteCheckboxStyle[source]
Bases:
QProxyStyleMethods
drawPrimitive
- staticMetaObject = PySide6.QtCore.QMetaObject("WhiteCheckboxStyle" inherits "QProxyStyle": )
- pymodaq_gui.qt_utils.apply_theme(theme, style=None, app=None)[source]
Apply a qt_themes theme to the running application, at startup or at any time later.
Sets the application palette and style, re-applies PyMoDAQ’s custom rules (the style proxy making checkboxes visible on dark themes, which a new style would otherwise drop) and emits
theme_signaller.theme_changed.Widgets built from the palette repaint by themselves, and so do the icons of
ActionManageractions and menus given by name and the pymodaq plots (they listen totheme_changed, seepymodaq_gui.plotting.plot_theme). Anything else whose colours were computed once from the theme should listen totheme_signaller.theme_changed.- Parameters:
theme (
Union[str,Theme]) – A theme or the name of one (seeqt_themes.get_themes())style (
str) – Qt style name. Defaults to the configured one (config('gui', 'style', 'style')[0])app (
QApplication) – Defaults to the running instance
- Returns:
The applied theme, None if theme is an unknown name
- Return type:
Optional[Theme]
- pymodaq_gui.qt_utils.decode_data(encoded_data)[source]
Decode QbyteArrayData generated when drop items in table/tree/list view :param encoded_data: Encoded data of the mime data to be dropped :type encoded_data:
QByteArray- Returns:
data – list of dict whose key is the QtRole in the Model, and the value a QVariant
- Return type:
- pymodaq_gui.qt_utils.setLocale()[source]
defines the Locale to use to convert numbers to strings representation using language/country conventions Default is English and US