Widgets and Qt helpers¶
Qt helpers¶
Actions¶
- guidata.qthelpers.create_action(parent: QW.QWidget | None, title: str, triggered: Callable | None = None, toggled: Callable | None = None, shortcut: QG.QKeySequence | None = None, icon: QG.QIcon | None = None, tip: str | None = None, checkable: bool | None = None, context: QC.Qt.ShortcutContext = 1, enabled: bool | None = None) QW.QAction ¶
Create a new QAction
- Parameters:
parent (QWidget or None) – Parent widget
title (str) – Action title
triggered (Callable or None) – Triggered callback
toggled (Callable or None) – Toggled callback
shortcut (QKeySequence or None) – Shortcut
icon (QIcon or None) – Icon
tip (str or None) – Tooltip
checkable (bool or None) – Checkable
context (Qt.ShortcutContext) – Shortcut context
enabled (bool or None) – Enabled
- Returns:
New action
- Return type:
QAction
- guidata.qthelpers.add_actions(target: QMenu | QToolBar, actions: list[QAction | QMenu | QToolButton | QPushButton | None]) None ¶
Add actions (list of QAction instances) to target (menu, toolbar)
- Parameters:
target (QMenu or QToolBar) – Target menu or toolbar
actions (list) – List of actions (QAction, QMenu, QToolButton, QPushButton, None)
Simple widgets¶
- guidata.qthelpers.create_toolbutton(parent: QW.QWidget, icon: QG.QIcon | str | None = None, text: str | None = None, triggered: Callable | None = None, tip: str | None = None, toggled: Callable | None = None, shortcut: QG.QKeySequence | None = None, autoraise: bool = True, enabled: bool | None = None) QW.QToolButton ¶
Create a QToolButton
- Parameters:
parent (QWidget) – Parent widget
icon (QIcon or str or None) – Icon
text (str or None) – Text
triggered (Callable or None) – Triggered callback
tip (str or None) – Tooltip
toggled (Callable or None) – Toggled callback
shortcut (QKeySequence or None) – Shortcut
autoraise (bool) – Auto raise
enabled (bool or None) – Enabled
- Returns:
New toolbutton
- Return type:
QToolButton
Icons¶
Application¶
Other¶
- guidata.qthelpers.text_to_qcolor(text: str | None) QColor ¶
Create a QColor from specified string
- Parameters:
text (str) – Color name or hex value
- Returns:
Color
- Return type:
QG.QColor
- guidata.qthelpers.grab_save_window(widget: QWidget, name: str) None ¶
Grab window screenshot and save it
- Parameters:
widget (QWidget) – Widget to grab
name (str) – Widget name
- guidata.qthelpers.click_on_widget(widget: QWidget) None ¶
Click on widget and eventually save a screenshot
- Parameters:
widget (QWidget) – Widget to click on
- guidata.qthelpers.block_signals(widget: QWidget, enable: bool) None ¶
Eventually block/unblock widget Qt signals before/after doing some things (enable: True if feature is enabled)
- Parameters:
widget (QWidget) – Widget to block/unblock
enable (bool) – True to block signals
Ready-to-use Qt widgets¶
Data editors¶
- class guidata.widgets.arrayeditor.ArrayEditor(parent=None)¶
Array Editor Dialog
- class guidata.widgets.collectionseditor.CollectionsEditor(parent=None)¶
Collections Editor Dialog
- class guidata.widgets.dataframeeditor.DataFrameEditor(parent=None)¶
Dialog for displaying and editing DataFrame and related objects.
Signals¶
- sig_option_changed(str, object): Raised if an option is changed.
Arguments are name of option and its new value.
- class guidata.widgets.texteditor.TextEditor(text, title='', font=None, parent=None, readonly=False, size=(400, 300))¶
Array Editor Dialog
Console and code editor¶
- class guidata.widgets.console.Console(parent=None, namespace=None, message=None, commands=None, multithreaded=True, debug=False)¶
Python console that run an interactive shell linked to the running process.
- class guidata.widgets.console.DockableConsole(parent, namespace, message, commands=None, multithreaded=True, debug=False)¶
Dockable Python console that run an interactive shell linked to the running process.
- class guidata.widgets.codeeditor.CodeEditor(parent=None, language=None, font=None, columns=None, rows=None)¶