GUIData reference
dataset
The guidata.dataset package provides the core features for data set
display and editing with automatically generated graphical user interfaces.
dataset.dataitems
The guidata.dataset.dataitems module contains implementation for
concrete DataItems.
-
guidata.dataset.dataitems.BoolItem[source]
- Construct a boolean data item
- text [string]: form’s field name (optional)
- label [string]: name
- default [string]: default value (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.ButtonItem[source]
- Construct a simple button that calls a method when hit
label [string]: text shown on the button
- callback [function]: function with four parameters (dataset, item, value, parent)
- dataset [DataSet]: instance of the parent dataset
- item [DataItem]: instance of ButtonItem (i.e. self)
- value [unspecified]: value of ButtonItem (default ButtonItem
value or last value returned by the callback)
- parent [QObject]: button’s parent widget
icon [QIcon or string]: icon show on the button (optional)
(string: icon filename as in guidata/guiqwt image search paths)
default [unspecified]: default value passed to the callback (optional)
help [string]: text shown in button’s tooltip (optional)
The value of this item is unspecified but is passed to the callback along
with the whole dataset. The value is assigned the callback`s return value.
-
guidata.dataset.dataitems.ChoiceItem[source]
- Construct a data item for a list of choices.
- label [string]: name
- choices [list, tuple or function]: string list or (key, label) list
function of two arguments (item, value) returning a list of tuples
(key, label, image) where image is an icon path, a QIcon instance
or a function of one argument (key) returning a QIcon instance
- default [-]: default label or default key (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.ColorItem[source]
- Construct a color data item
- label [string]: name
- default [string]: default value (optional)
- help [string]: text shown in tooltip (optional)
Color values are encoded as hexadecimal strings or Qt color names
-
guidata.dataset.dataitems.DateItem[source]
- Construct a date data item.
- text [string]: form’s field name (optional)
- label [string]: name
- default [datetime.date]: default value (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.DictItem[source]
- Construct a dictionary data item
- label [string]: name
- default [dict]: default value (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.DirectoryItem[source]
- Construct a path data item for a directory.
- label [string]: name
- default [string]: default value (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.FileOpenItem[source]
- Construct a path data item for a file to be opened
- label [string]: name
- formats [string (or string list)]: wildcard filter (e.g. ‘*.txt’)
- default [string]: default value (optional)
- basedir [string]: default base directory (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.FileSaveItem[source]
- Construct a path data item for a file to be saved
- label [string]: name
- formats [string (or string list)]: wildcard filter (e.g. ‘*.txt’)
- default [string]: default value (optional)
- basedir [string]: default base directory (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.FilesOpenItem[source]
- Construct a path data item for multiple files to be opened.
- label [string]: name
- formats [string (or string list)]: wildcard filter (e.g. ‘*.txt’)
- default [string]: default value (optional)
- basedir [string]: default base directory (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.FloatArrayItem[source]
- Construct a float array data item
- label [string]: name
- default [numpy.ndarray]: default value (optional)
- help [string]: text shown in tooltip (optional)
- format [string]: formatting string (example: ‘%.3f’) (optional)
- transpose [bool]: transpose matrix (display only)
- minmax [string]: “all” (default), “columns”, “rows”
-
guidata.dataset.dataitems.FloatItem[source]
- Construct a float data item
- label [string]: name
- default [float]: default value (optional)
- min [float]: minimum value (optional)
- max [float]: maximum value (optional)
- nonzero [bool]: if True, zero is not a valid value (optional)
- unit [string]: physical unit (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.FontFamilyItem[source]
- Construct a font family name item
- label [string]: name
- default [string]: default value (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.ImageChoiceItem[source]
- Construct a data item for a list of choices with images
- label [string]: name
- choices [list, tuple or function]: (label, image) list or
(key, label, image) list function of two arguments (item, value)
returning a list of tuples (key, label, image) where image is an
icon path, a QIcon instance or a function of one argument (key)
returning a QIcon instance
- default [-]: default label or default key (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.IntItem[source]
- Construct an integer data item
- label [string]: name
- default [int]: default value (optional)
- min [int]: minimum value (optional)
- max [int]: maximum value (optional)
- nonzero [bool]: if True, zero is not a valid value (optional)
- unit [string]: physical unit (optional)
- even [bool]: if True, even values are valid, if False,
odd values are valid if None (default), ignored (optional)
- slider [bool]: if True, shows a slider widget right after the line
edit widget (default is False)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.MultipleChoiceItem[source]
Construct a data item for a list of choices – multiple choices can be
selected
- label [string]: name
- choices [list or tuple]: string list or (key, label) list
- default [-]: default label or default key (optional)
- help [string]: text shown in tooltip (optional)
-
guidata.dataset.dataitems.NumericTypeItem[source]
Numeric data item
-
guidata.dataset.dataitems.StringItem[source]
- Construct a string data item
- label [string]: name
- default [string]: default value (optional)
- help [string]: text shown in tooltip (optional)
notempty [bool]: if True, empty string is not a valid value (optional)
-
guidata.dataset.dataitems.TextItem[source]
- Construct a text data item (multiline string)
- label [string]: name
- default [string]: default value (optional)
- help [string]: text shown in tooltip (optional)
dataset.datatypes
The guidata.dataset.datatypes module contains implementation for
DataSets (DataSet, DataSetGroup, ...) and related objects (ItemProperty,
ValueProp, ...).
-
class guidata.dataset.datatypes.ActivableDataSet(title=None, comment=None, icon='')[source]
An ActivableDataSet instance must have an “enable” class attribute which
will set the active state of the dataset instance
(see example in: tests/activable_dataset.py)
-
accept(vis)
helper function that passes the visitor to the accept methods of all
the items in this dataset
-
classmethod active_setup(klass)[source]
This class method must be called after the child class definition
in order to setup the dataset active state
-
check()
Check the dataset item values
-
edit(parent=None, apply=None)
Open a dialog box to edit data set
Return data set comment
-
get_icon()
Return data set icon
-
get_title()
Return data set title
-
set_defaults()
Set default values
-
set_readonly()[source]
The dataset is now in read-only mode, i.e. all data items are disabled
-
set_writeable()[source]
The dataset is now in read/write mode, i.e. all data items are enabled
-
text_edit()
Edit data set with text input only
-
to_string(debug=False, indent=None, align=False)
Return readable string representation of the data set
If debug is True, add more details on data items
-
view(parent=None)
Open a dialog box to view data set
-
guidata.dataset.datatypes.BeginGroup[source]
Data item which does not represent anything
but a begin flag to define a data set group
-
guidata.dataset.datatypes.DataItem[source]
DataSet data item
label : (str, unicode)
default : any type, optional
help : (str, unicode)
Text displayed on data item’s tooltip
-
class guidata.dataset.datatypes.DataItemProxy(item)[source]
Proxy for DataItem objects
This class is needed to construct GroupItem class
(see module guidata.qtwidgets)
-
accept(visitor)[source]
DataItem method proxy
-
bind(instance)[source]
DataItem method proxy
-
check_item(instance)[source]
DataItem method proxy
-
check_value(instance, value)[source]
DataItem method proxy
-
from_string(instance, string_value)[source]
DataItem method proxy
-
get_auto_help(instance)[source]
DataItem method proxy
-
get_help(instance)[source]
DataItem method proxy
-
get_prop(realm, name, default=<class guidata.dataset.datatypes.NoDefault at 0x9a3f53c>)[source]
DataItem method proxy
-
get_prop_value(realm, instance, name, default=<class guidata.dataset.datatypes.NoDefault at 0x9a3f53c>)[source]
DataItem method proxy
-
get_string_value(instance)[source]
DataItem method proxy
-
get_value(instance)[source]
DataItem method proxy
-
set_default(instance)[source]
DataItem method proxy
-
set_from_string(instance, string_value)[source]
DataItem method proxy
-
set_prop(realm, **kwargs)[source]
DataItem method proxy
-
class guidata.dataset.datatypes.DataItemVariable(item, instance)[source]
An instance of a DataItemVariable represent a binding between
an item and a dataset.
could be called a bound property.
since DataItem instances are class attributes they need to have a
DataSet instance to store their value. This class binds the two
together.
-
check_item()[source]
Re-implement DataItem method
-
check_value(value)[source]
Re-implement DataItem method
-
from_string(string_value)[source]
Re-implement DataItem method
-
get()[source]
Re-implement DataItem method
-
get_auto_help()[source]
Re-implement DataItem method
-
get_help()[source]
Re-implement DataItem method
-
get_prop(realm, name, default=<class guidata.dataset.datatypes.NoDefault at 0x9a3f53c>)[source]
DataItem method proxy
-
get_prop_value(realm, name, default=<class guidata.dataset.datatypes.NoDefault at 0x9a3f53c>)[source]
DataItem method proxy
-
get_string_value()[source]
Return a unicode representation of the item’s value
obeying ‘display’ or ‘repr’ properties
-
label()[source]
Re-implement DataItem method
-
set(value)[source]
Re-implement DataItem method
-
set_default()[source]
Re-implement DataItem method
-
set_from_string(string_value)[source]
Re-implement DataItem method
-
class guidata.dataset.datatypes.DataSet(title=None, comment=None, icon='')[source]
- Construct a DataSet object is a set of DataItem objects
- title [string]
- comment [string]: text shown on the top of the first data item
- icon [QIcon or string]: icon show on the button (optional)
(string: icon filename as in guidata/guiqwt image search paths)
-
accept(vis)[source]
helper function that passes the visitor to the accept methods of all
the items in this dataset
-
check()[source]
Check the dataset item values
-
edit(parent=None, apply=None)[source]
Open a dialog box to edit data set
Return data set comment
-
get_icon()[source]
Return data set icon
-
get_title()[source]
Return data set title
-
set_defaults()[source]
Set default values
-
text_edit()[source]
Edit data set with text input only
-
to_string(debug=False, indent=None, align=False)[source]
Return readable string representation of the data set
If debug is True, add more details on data items
-
view(parent=None)[source]
Open a dialog box to view data set
-
class guidata.dataset.datatypes.DataSetGroup(datasets, title=None, icon='')[source]
- Construct a DataSetGroup object, used to group several datasets together
- datasets [list of DataSet objects]
- title [string]
- icon [QIcon or string]: icon show on the button (optional)
(string: icon filename as in guidata/guiqwt image search paths)
This class tries to mimics the DataSet interface.
The GUI should represent it as a notebook with one page for each
contained dataset.
-
accept(vis)[source]
helper function that passes the visitor to the accept methods of all
the items in this dataset
-
check()[source]
Check data set group items
-
edit(parent=None, apply=None)[source]
Open a dialog box to edit data set
Return data set group comment –> not implemented (will return None)
-
get_title()[source]
Return data set group title
-
text_edit()[source]
Edit data set with text input only
-
class guidata.dataset.datatypes.DataSetMeta[source]
DataSet metaclass
Create class attribute _items: list of the DataSet class attributes,
created in the same order as these attributes were written
-
mro() → list
return a type’s method resolution order
-
guidata.dataset.datatypes.EndGroup[source]
Data item which does not represent anything
but an end flag to define a data set group
-
class guidata.dataset.datatypes.FormatProp(fmt, ignore_error=True)[source]
A Property that returns a string to help
custom read-only representation of items
-
set(instance, item, value)
Sets the value of the property given an instance, item and value
Depending on implementation the value will be stored either on the
instance, item or self
-
class guidata.dataset.datatypes.GetAttrProp(attr)[source]
A property that matches the value of
an instance’s attribute
-
class guidata.dataset.datatypes.GroupItem(item)[source]
GroupItem proxy
-
accept(visitor)
DataItem method proxy
-
bind(instance)
DataItem method proxy
-
check_item(instance)
DataItem method proxy
-
check_value(instance, value)
DataItem method proxy
-
from_string(instance, string_value)
DataItem method proxy
-
get_auto_help(instance)
DataItem method proxy
-
get_help(instance)
DataItem method proxy
-
get_prop(realm, name, default=<class guidata.dataset.datatypes.NoDefault at 0x9a3f53c>)
DataItem method proxy
-
get_prop_value(realm, instance, name, default=<class guidata.dataset.datatypes.NoDefault at 0x9a3f53c>)
DataItem method proxy
-
get_string_value(instance)
DataItem method proxy
-
get_value(instance)
DataItem method proxy
-
set_default(instance)
DataItem method proxy
-
set_from_string(instance, string_value)
DataItem method proxy
-
set_prop(realm, **kwargs)
DataItem method proxy
-
class guidata.dataset.datatypes.IDataItemReader[source]
An interface for dataitem/dataset serialization
-
class guidata.dataset.datatypes.IDataItemWriter[source]
An interface for dataitem/dataset serialization
-
write_any(any)[source]
try to write any python object,
could resort to using pickle
-
class guidata.dataset.datatypes.NotProp(prop)[source]
Not property
-
class guidata.dataset.datatypes.Obj(**kwargs)[source]
An object that helps build default instances for
ObjectItems
-
guidata.dataset.datatypes.ObjectItem[source]
Simple helper class implementing default
for composite objects
-
class guidata.dataset.datatypes.OperatorProperty(prop, func, invfunc=None)[source]
An ‘operator property’
prop: ItemProperty instance
func: function
invfunc: inverse function (optional)
-
class guidata.dataset.datatypes.ValueProp(value)[source]
A property that retrieves a value stored elsewhere
qthelpers
The guidata.qthelpers module provides helper functions for developing
easily Qt-based graphical user interfaces.
-
class guidata.qthelpers.ShowStdIcons(parent)[source]
Dialog showing standard icons
-
class RenderFlags
QWidget.RenderFlags(QWidget.RenderFlags)
QWidget.RenderFlags(int)
QWidget.RenderFlags()
-
ShowStdIcons.acceptDrops() → bool
-
ShowStdIcons.accessibleDescription() → QString
-
ShowStdIcons.accessibleName() → QString
-
ShowStdIcons.actionEvent(QActionEvent)
-
ShowStdIcons.actions() → list-of-QAction
-
ShowStdIcons.activateWindow()
-
ShowStdIcons.addAction(QAction)
-
ShowStdIcons.addActions(list-of-QAction)
-
ShowStdIcons.adjustSize()
-
ShowStdIcons.autoFillBackground() → bool
-
ShowStdIcons.backgroundRole() → QPalette.ColorRole
-
ShowStdIcons.baseSize() → QSize
-
ShowStdIcons.blockSignals(bool) → bool
-
ShowStdIcons.changeEvent(QEvent)
-
ShowStdIcons.childAt(QPoint) → QWidget
QWidget.childAt(int, int) -> QWidget
-
ShowStdIcons.childEvent(QChildEvent)
-
ShowStdIcons.children() → list-of-QObject
-
ShowStdIcons.childrenRect() → QRect
-
ShowStdIcons.childrenRegion() → QRegion
-
ShowStdIcons.clearFocus()
-
ShowStdIcons.clearMask()
-
ShowStdIcons.close() → bool
-
ShowStdIcons.closeEvent(QCloseEvent)
-
ShowStdIcons.colorCount() → int
-
ShowStdIcons.connect(QObject, SIGNAL(), QObject, SLOT(), Qt.ConnectionType=Qt.AutoConnection) → bool
QObject.connect(QObject, SIGNAL(), callable, Qt.ConnectionType=Qt.AutoConnection) -> bool
QObject.connect(QObject, SIGNAL(), SLOT(), Qt.ConnectionType=Qt.AutoConnection) -> bool
-
ShowStdIcons.connectNotify(SIGNAL())
-
ShowStdIcons.contentsMargins() → QMargins
-
ShowStdIcons.contentsRect() → QRect
-
ShowStdIcons.create(int window=0, bool initializeWindow=True, bool destroyOldWindow=True)
-
ShowStdIcons.cursor() → QCursor
QWidget.customContextMenuRequested[QPoint] [signal]
-
ShowStdIcons.customEvent(QEvent)
-
ShowStdIcons.deleteLater()
-
ShowStdIcons.depth() → int
-
ShowStdIcons.destroy(bool destroyWindow=True, bool destroySubWindows=True)
-
ShowStdIcons.destroyed
QObject.destroyed[QObject] [signal]
QObject.destroyed[] [signal]
-
ShowStdIcons.devType() → int
-
ShowStdIcons.disconnect(QObject, SIGNAL(), QObject, SLOT()) → bool
QObject.disconnect(QObject, SIGNAL(), callable) -> bool
-
ShowStdIcons.disconnectNotify(SIGNAL())
-
ShowStdIcons.dragEnterEvent(QDragEnterEvent)
-
ShowStdIcons.dragLeaveEvent(QDragLeaveEvent)
-
ShowStdIcons.dragMoveEvent(QDragMoveEvent)
-
ShowStdIcons.dropEvent(QDropEvent)
-
ShowStdIcons.dumpObjectInfo()
-
ShowStdIcons.dumpObjectTree()
-
ShowStdIcons.dynamicPropertyNames() → list-of-QByteArray
-
ShowStdIcons.effectiveWinId() → int
-
ShowStdIcons.emit(SIGNAL(), ...)
-
ShowStdIcons.enabledChange(bool)
-
ShowStdIcons.ensurePolished()
-
ShowStdIcons.enterEvent(QEvent)
-
ShowStdIcons.event(QEvent) → bool
-
ShowStdIcons.eventFilter(QObject, QEvent) → bool
-
ShowStdIcons.find(int) → QWidget
-
ShowStdIcons.findChild(type, QString name=QString()) → QObject
QObject.findChild(tuple, QString name=QString()) -> QObject
-
ShowStdIcons.findChildren(type, QString name=QString()) → list-of-QObject
QObject.findChildren(tuple, QString name=QString()) -> list-of-QObject
QObject.findChildren(type, QRegExp) -> list-of-QObject
QObject.findChildren(tuple, QRegExp) -> list-of-QObject
-
ShowStdIcons.focusInEvent(QFocusEvent)
-
ShowStdIcons.focusNextChild() → bool
-
ShowStdIcons.focusNextPrevChild(bool) → bool
-
ShowStdIcons.focusOutEvent(QFocusEvent)
-
ShowStdIcons.focusPolicy() → Qt.FocusPolicy
-
ShowStdIcons.focusPreviousChild() → bool
-
ShowStdIcons.focusProxy() → QWidget
-
ShowStdIcons.focusWidget() → QWidget
-
ShowStdIcons.font() → QFont
-
ShowStdIcons.fontChange(QFont)
-
ShowStdIcons.fontInfo() → QFontInfo
-
ShowStdIcons.fontMetrics() → QFontMetrics
-
ShowStdIcons.foregroundRole() → QPalette.ColorRole
-
ShowStdIcons.frameGeometry() → QRect
-
ShowStdIcons.frameSize() → QSize
-
ShowStdIcons.geometry() → QRect
-
ShowStdIcons.getContentsMargins() -> (int, int, int, int)
-
ShowStdIcons.grabGesture(Qt.GestureType, Qt.GestureFlags flags=Qt.GestureFlags(0))
-
ShowStdIcons.grabKeyboard()
-
ShowStdIcons.grabMouse()
QWidget.grabMouse(QCursor)
-
ShowStdIcons.grabShortcut(QKeySequence, Qt.ShortcutContext context=Qt.WindowShortcut) → int
-
ShowStdIcons.graphicsEffect() → QGraphicsEffect
-
ShowStdIcons.graphicsProxyWidget() → QGraphicsProxyWidget
-
ShowStdIcons.handle() → int
-
ShowStdIcons.hasFocus() → bool
-
ShowStdIcons.hasMouseTracking() → bool
-
ShowStdIcons.height() → int
-
ShowStdIcons.heightForWidth(int) → int
-
ShowStdIcons.heightMM() → int
-
ShowStdIcons.hide()
-
ShowStdIcons.hideEvent(QHideEvent)
-
ShowStdIcons.inherits(str) → bool
-
ShowStdIcons.inputContext() → QInputContext
-
ShowStdIcons.inputMethodEvent(QInputMethodEvent)
-
ShowStdIcons.inputMethodHints() → Qt.InputMethodHints
-
ShowStdIcons.inputMethodQuery(Qt.InputMethodQuery) → QVariant
-
ShowStdIcons.insertAction(QAction, QAction)
-
ShowStdIcons.insertActions(QAction, list-of-QAction)
-
ShowStdIcons.installEventFilter(QObject)
-
ShowStdIcons.isActiveWindow() → bool
-
ShowStdIcons.isAncestorOf(QWidget) → bool
-
ShowStdIcons.isEnabled() → bool
-
ShowStdIcons.isEnabledTo(QWidget) → bool
-
ShowStdIcons.isEnabledToTLW() → bool
-
ShowStdIcons.isFullScreen() → bool
-
ShowStdIcons.isHidden() → bool
-
ShowStdIcons.isLeftToRight() → bool
-
ShowStdIcons.isMaximized() → bool
-
ShowStdIcons.isMinimized() → bool
-
ShowStdIcons.isModal() → bool
-
ShowStdIcons.isRightToLeft() → bool
-
ShowStdIcons.isTopLevel() → bool
-
ShowStdIcons.isVisible() → bool
-
ShowStdIcons.isVisibleTo(QWidget) → bool
-
ShowStdIcons.isWidgetType() → bool
-
ShowStdIcons.isWindow() → bool
-
ShowStdIcons.isWindowModified() → bool
-
ShowStdIcons.keyPressEvent(QKeyEvent)
-
ShowStdIcons.keyReleaseEvent(QKeyEvent)
-
ShowStdIcons.keyboardGrabber() → QWidget
-
ShowStdIcons.killTimer(int)
-
ShowStdIcons.languageChange()
-
ShowStdIcons.layout() → QLayout
-
ShowStdIcons.layoutDirection() → Qt.LayoutDirection
-
ShowStdIcons.leaveEvent(QEvent)
-
ShowStdIcons.locale() → QLocale
-
ShowStdIcons.logicalDpiX() → int
-
ShowStdIcons.logicalDpiY() → int
-
ShowStdIcons.lower()
-
ShowStdIcons.mapFrom(QWidget, QPoint) → QPoint
-
ShowStdIcons.mapFromGlobal(QPoint) → QPoint
-
ShowStdIcons.mapFromParent(QPoint) → QPoint
-
ShowStdIcons.mapTo(QWidget, QPoint) → QPoint
-
ShowStdIcons.mapToGlobal(QPoint) → QPoint
-
ShowStdIcons.mapToParent(QPoint) → QPoint
-
ShowStdIcons.mask() → QRegion
-
ShowStdIcons.maximumHeight() → int
-
ShowStdIcons.maximumSize() → QSize
-
ShowStdIcons.maximumWidth() → int
-
ShowStdIcons.metaObject() → QMetaObject
-
ShowStdIcons.metric(QPaintDevice.PaintDeviceMetric) → int
-
ShowStdIcons.minimumHeight() → int
-
ShowStdIcons.minimumSize() → QSize
-
ShowStdIcons.minimumSizeHint() → QSize
-
ShowStdIcons.minimumWidth() → int
-
ShowStdIcons.mouseDoubleClickEvent(QMouseEvent)
-
ShowStdIcons.mouseGrabber() → QWidget
-
ShowStdIcons.mouseMoveEvent(QMouseEvent)
-
ShowStdIcons.mousePressEvent(QMouseEvent)
-
ShowStdIcons.mouseReleaseEvent(QMouseEvent)
-
ShowStdIcons.move(QPoint)
QWidget.move(int, int)
-
ShowStdIcons.moveEvent(QMoveEvent)
-
ShowStdIcons.moveToThread(QThread)
-
ShowStdIcons.nativeParentWidget() → QWidget
-
ShowStdIcons.nextInFocusChain() → QWidget
-
ShowStdIcons.normalGeometry() → QRect
-
ShowStdIcons.numColors() → int
-
ShowStdIcons.objectName() → QString
-
ShowStdIcons.overrideWindowFlags(Qt.WindowFlags)
-
ShowStdIcons.overrideWindowState(Qt.WindowStates)
-
ShowStdIcons.paintEngine() → QPaintEngine
-
ShowStdIcons.paintEvent(QPaintEvent)
-
ShowStdIcons.paintingActive() → bool
-
ShowStdIcons.palette() → QPalette
-
ShowStdIcons.paletteChange(QPalette)
-
ShowStdIcons.parent() → QObject
-
ShowStdIcons.parentWidget() → QWidget
-
ShowStdIcons.physicalDpiX() → int
-
ShowStdIcons.physicalDpiY() → int
-
ShowStdIcons.pos() → QPoint
-
ShowStdIcons.previousInFocusChain() → QWidget
-
ShowStdIcons.property(str) → QVariant
-
ShowStdIcons.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.
-
ShowStdIcons.raise_()
-
ShowStdIcons.receivers(SIGNAL()) → int
-
ShowStdIcons.rect() → QRect
-
ShowStdIcons.releaseKeyboard()
-
ShowStdIcons.releaseMouse()
-
ShowStdIcons.releaseShortcut(int)
-
ShowStdIcons.removeAction(QAction)
-
ShowStdIcons.removeEventFilter(QObject)
-
ShowStdIcons.render(QPaintDevice, QPoint targetOffset=QPoint(), QRegion sourceRegion=QRegion(), QWidget.RenderFlags flags=QWidget.DrawWindowBackground|QWidget.DrawChildren)
QWidget.render(QPainter, QPoint targetOffset=QPoint(), QRegion sourceRegion=QRegion(), QWidget.RenderFlags flags=QWidget.DrawWindowBackground|QWidget.DrawChildren)
-
ShowStdIcons.repaint()
QWidget.repaint(int, int, int, int)
QWidget.repaint(QRect)
QWidget.repaint(QRegion)
-
ShowStdIcons.resetInputContext()
-
ShowStdIcons.resize(QSize)
QWidget.resize(int, int)
-
ShowStdIcons.resizeEvent(QResizeEvent)
-
ShowStdIcons.restoreGeometry(QByteArray) → bool
-
ShowStdIcons.saveGeometry() → QByteArray
-
ShowStdIcons.scroll(int, int)
QWidget.scroll(int, int, QRect)
-
ShowStdIcons.sender() → QObject
-
ShowStdIcons.senderSignalIndex() → int
-
ShowStdIcons.setAcceptDrops(bool)
-
ShowStdIcons.setAccessibleDescription(QString)
-
ShowStdIcons.setAccessibleName(QString)
-
ShowStdIcons.setAttribute(Qt.WidgetAttribute, bool on=True)
-
ShowStdIcons.setAutoFillBackground(bool)
-
ShowStdIcons.setBackgroundRole(QPalette.ColorRole)
-
ShowStdIcons.setBaseSize(int, int)
QWidget.setBaseSize(QSize)
-
ShowStdIcons.setContentsMargins(int, int, int, int)
QWidget.setContentsMargins(QMargins)
-
ShowStdIcons.setCursor(QCursor)
-
ShowStdIcons.setDisabled(bool)
-
ShowStdIcons.setEnabled(bool)
-
ShowStdIcons.setFixedHeight(int)
-
ShowStdIcons.setFixedSize(QSize)
QWidget.setFixedSize(int, int)
-
ShowStdIcons.setFixedWidth(int)
-
ShowStdIcons.setFocus()
QWidget.setFocus(Qt.FocusReason)
-
ShowStdIcons.setFocusPolicy(Qt.FocusPolicy)
-
ShowStdIcons.setFocusProxy(QWidget)
-
ShowStdIcons.setFont(QFont)
-
ShowStdIcons.setForegroundRole(QPalette.ColorRole)
-
ShowStdIcons.setGeometry(QRect)
QWidget.setGeometry(int, int, int, int)
-
ShowStdIcons.setGraphicsEffect(QGraphicsEffect)
-
ShowStdIcons.setHidden(bool)
-
ShowStdIcons.setInputContext(QInputContext)
-
ShowStdIcons.setInputMethodHints(Qt.InputMethodHints)
-
ShowStdIcons.setLayout(QLayout)
-
ShowStdIcons.setLayoutDirection(Qt.LayoutDirection)
-
ShowStdIcons.setLocale(QLocale)
-
ShowStdIcons.setMask(QBitmap)
QWidget.setMask(QRegion)
-
ShowStdIcons.setMaximumHeight(int)
-
ShowStdIcons.setMaximumSize(int, int)
QWidget.setMaximumSize(QSize)
-
ShowStdIcons.setMaximumWidth(int)
-
ShowStdIcons.setMinimumHeight(int)
-
ShowStdIcons.setMinimumSize(int, int)
QWidget.setMinimumSize(QSize)
-
ShowStdIcons.setMinimumWidth(int)
-
ShowStdIcons.setMouseTracking(bool)
-
ShowStdIcons.setObjectName(QString)
-
ShowStdIcons.setPalette(QPalette)
-
ShowStdIcons.setParent(QWidget)
QWidget.setParent(QWidget, Qt.WindowFlags)
-
ShowStdIcons.setProperty(str, QVariant) → bool
-
ShowStdIcons.setShortcutAutoRepeat(int, bool enabled=True)
-
ShowStdIcons.setShortcutEnabled(int, bool enabled=True)
-
ShowStdIcons.setShown(bool)
-
ShowStdIcons.setSizeIncrement(int, int)
QWidget.setSizeIncrement(QSize)
-
ShowStdIcons.setSizePolicy(QSizePolicy)
QWidget.setSizePolicy(QSizePolicy.Policy, QSizePolicy.Policy)
-
ShowStdIcons.setStatusTip(QString)
-
ShowStdIcons.setStyle(QStyle)
-
ShowStdIcons.setStyleSheet(QString)
-
ShowStdIcons.setTabOrder(QWidget, QWidget)
-
ShowStdIcons.setToolTip(QString)
-
ShowStdIcons.setUpdatesEnabled(bool)
-
ShowStdIcons.setVisible(bool)
-
ShowStdIcons.setWhatsThis(QString)
-
ShowStdIcons.setWindowFilePath(QString)
-
ShowStdIcons.setWindowFlags(Qt.WindowFlags)
-
ShowStdIcons.setWindowIcon(QIcon)
-
ShowStdIcons.setWindowIconText(QString)
-
ShowStdIcons.setWindowModality(Qt.WindowModality)
-
ShowStdIcons.setWindowModified(bool)
-
ShowStdIcons.setWindowOpacity(float)
-
ShowStdIcons.setWindowRole(QString)
-
ShowStdIcons.setWindowState(Qt.WindowStates)
-
ShowStdIcons.setWindowTitle(QString)
-
ShowStdIcons.show()
-
ShowStdIcons.showEvent(QShowEvent)
-
ShowStdIcons.showFullScreen()
-
ShowStdIcons.showMaximized()
-
ShowStdIcons.showMinimized()
-
ShowStdIcons.showNormal()
-
ShowStdIcons.signalsBlocked() → bool
-
ShowStdIcons.size() → QSize
-
ShowStdIcons.sizeHint() → QSize
-
ShowStdIcons.sizeIncrement() → QSize
-
ShowStdIcons.sizePolicy() → QSizePolicy
-
ShowStdIcons.stackUnder(QWidget)
-
ShowStdIcons.startTimer(int) → int
-
ShowStdIcons.statusTip() → QString
-
ShowStdIcons.style() → QStyle
-
ShowStdIcons.styleSheet() → QString
-
ShowStdIcons.tabletEvent(QTabletEvent)
-
ShowStdIcons.testAttribute(Qt.WidgetAttribute) → bool
-
ShowStdIcons.thread() → QThread
-
ShowStdIcons.timerEvent(QTimerEvent)
-
ShowStdIcons.toolTip() → QString
-
ShowStdIcons.topLevelWidget() → QWidget
-
ShowStdIcons.tr(str, str disambiguation=None, int n=-1) → QString
-
ShowStdIcons.trUtf8(str, str disambiguation=None, int n=-1) → QString
-
ShowStdIcons.underMouse() → bool
-
ShowStdIcons.ungrabGesture(Qt.GestureType)
-
ShowStdIcons.unsetCursor()
-
ShowStdIcons.unsetLayoutDirection()
-
ShowStdIcons.unsetLocale()
-
ShowStdIcons.update()
QWidget.update(QRect)
QWidget.update(QRegion)
QWidget.update(int, int, int, int)
-
ShowStdIcons.updateGeometry()
-
ShowStdIcons.updateMicroFocus()
-
ShowStdIcons.updatesEnabled() → bool
-
ShowStdIcons.visibleRegion() → QRegion
-
ShowStdIcons.whatsThis() → QString
-
ShowStdIcons.wheelEvent(QWheelEvent)
-
ShowStdIcons.width() → int
-
ShowStdIcons.widthMM() → int
-
ShowStdIcons.winId() → int
-
ShowStdIcons.window() → QWidget
-
ShowStdIcons.windowActivationChange(bool)
-
ShowStdIcons.windowFilePath() → QString
-
ShowStdIcons.windowFlags() → Qt.WindowFlags
-
ShowStdIcons.windowIcon() → QIcon
-
ShowStdIcons.windowIconText() → QString
-
ShowStdIcons.windowModality() → Qt.WindowModality
-
ShowStdIcons.windowOpacity() → float
-
ShowStdIcons.windowRole() → QString
-
ShowStdIcons.windowState() → Qt.WindowStates
-
ShowStdIcons.windowTitle() → QString
-
ShowStdIcons.windowType() → Qt.WindowType
-
ShowStdIcons.x() → int
-
ShowStdIcons.x11Info() → QX11Info
-
ShowStdIcons.x11PictureHandle() → int
-
ShowStdIcons.y() → int
-
guidata.qthelpers.add_actions(target, actions)[source]
Add actions (list of QAction instances) to target (menu, toolbar)
-
guidata.qthelpers.add_separator(target)[source]
Add separator to target only if last action is not a separator
-
guidata.qthelpers.create_action(parent, title, triggered=None, toggled=None, shortcut=None, icon=None, tip=None, checkable=None, context=1, enabled=None)[source]
Create a new QAction
-
guidata.qthelpers.create_groupbox(parent, title=None, toggled=None, checked=None, flat=False, layout=None)[source]
Create a QGroupBox
-
guidata.qthelpers.create_toolbutton(parent, icon=None, text=None, triggered=None, tip=None, toggled=None, shortcut=None, autoraise=True, enabled=None)[source]
Create a QToolButton
-
guidata.qthelpers.get_std_icon(name, size=None)[source]
Get standard platform icon
Call ‘show_std_icons()’ for details
-
guidata.qthelpers.keybinding(attr)[source]
Return keybinding
-
guidata.qthelpers.show_std_icons()[source]
Show all standard Icons
-
guidata.qthelpers.text_to_qcolor(text)[source]
Create a QColor from specified string
disthelpers
The guidata.disthelpers module provides helper functions for Python
package distribution on Microsoft Windows platforms with py2exe or on
all platforms thanks to cx_Freeze.
-
class guidata.disthelpers.Distribution[source]
Distribution object
Help creating an executable using py2exe or cx_Freeze
-
add_executable(script, target_name, icon=None)[source]
Add executable to the cx_Freeze distribution
Not supported for py2exe
-
add_matplotlib()[source]
Include module Matplotlib to the distribution
-
add_module_data_dir(module_name, data_dir_name, extensions, copy_to_root=True, verbose=False)[source]
Collect data files in data_dir_name for module module_name
and add them to data_files
extensions: list of file extensions, e.g. (‘.png’, ‘.svg’)
-
add_module_data_files(module_name, data_dir_names, extensions, copy_to_root=True, verbose=False)[source]
Collect data files for module module_name and add them to data_files
data_dir_names: list of dirnames, e.g. (‘images’, )
extensions: list of file extensions, e.g. (‘.png’, ‘.svg’)
-
add_modules(*module_names)[source]
Include module module_name
- Notes:
- bin_path_excludes is specific to cx_Freeze (ignored if it’s None)
- if vs2008 is None, it’s set to True by default on Windows platforms,
False on non-Windows platforms
-
add_pyqt4()[source]
Include module PyQt4 to the distribution
-
add_text_data_file(filename, contents)[source]
Create temporary data file filename with contents
and add it to data_files
-
build(library, cleanup=True, create_archive=None)[source]
Build executable with given library.
- library:
- ‘py2exe’: deploy using the py2exe library
- ‘cx_Freeze’: deploy using the cx_Freeze library
cleanup: remove ‘build/dist’ directories before building distribution
- create_archive (requires the executable zip):
- None or False: do nothing
- ‘add’: add target directory to a ZIP archive
- ‘move’: move target directory to a ZIP archive
-
build_cx_freeze(cleanup=True, create_archive=None)[source]
Build executable with cx_Freeze
cleanup: remove ‘build/dist’ directories before building distribution
- create_archive (requires the executable zip):
- None or False: do nothing
- ‘add’: add target directory to a ZIP archive
- ‘move’: move target directory to a ZIP archive
-
build_py2exe(cleanup=True, compressed=2, optimize=2, company_name=None, copyright=None, create_archive=None)[source]
Build executable with py2exe
cleanup: remove ‘build/dist’ directories before building distribution
- create_archive (requires the executable zip):
- None or False: do nothing
- ‘add’: add target directory to a ZIP archive
- ‘move’: move target directory to a ZIP archive
-
target_dir[source]
Return target directory (default: ‘dist’)
-
guidata.disthelpers.create_vs2008_data_files(verbose=False)[source]
Including Microsoft Visual C++ 2008 DLLs
-
guidata.disthelpers.get_changeset(path, rev=None)[source]
Return Mercurial repository path revision number
-
guidata.disthelpers.prepend_module_to_path(module_path)[source]
Prepend to sys.path module located in module_path
Return string with module infos: name, revision, changeset
Use this function:
1) In your application to import local frozen copies of internal libraries
2) In your py2exe distributed package to add a text file containing the
returned string
-
guidata.disthelpers.prepend_modules_to_path(module_base_path)[source]
Prepend to sys.path all modules located in module_base_path
-
guidata.disthelpers.remove_at_exit(fname)[source]
Remove temporary file fname at exit
-
guidata.disthelpers.remove_dir(dirname)[source]
Remove directory dirname and all its contents
Print details about the operation (progress, success/failure)
-
guidata.disthelpers.strip_version(version)[source]
Return version number with digits only
(Windows does not support strings in version numbers)
-
guidata.disthelpers.to_include_files(data_files)[source]
Convert data_files list to include_files list
- data_files:
- this is the py2exe data files format
- list of tuples (dest_dirname, (src_fname1, src_fname2, ...))
- include_files:
-
userconfig
The guidata.userconfig module provides user configuration file (.ini file)
management features based on ConfigParser (standard Python library).
-
class guidata.userconfig.UserConfig(defaults)[source]
UserConfig class, based on ConfigParser
name: name of the config
options: dictionnary containing options or list of tuples
(section_name, options)
Note that ‘get’ and ‘set’ arguments number and type
differ from the overriden methods
-
OPTCRE = <_sre.SRE_Pattern object at 0x8c9b9b8>
-
SECTCRE = <_sre.SRE_Pattern object at 0x40420d10>
-
add_section(section)
Create a new section in the configuration.
Raise DuplicateSectionError if a section by the specified name
already exists. Raise ValueError if name is DEFAULT or any of it’s
case-insensitive variants.
-
check_default_values()[source]
Check the static options for forbidden data types
-
cleanup()[source]
Remove .ini file associated to config
-
filename()[source]
Create a .ini filename located in user home directory
-
get(section, option, default=<class guidata.userconfig.NoDefault at 0x8ea51ac>)[source]
Get an option
section=None: attribute a default section name
default: default value (if not specified, an exception
will be raised if option doesn’t exist)
-
get_default(section, option)[source]
Get Default value for a given (section, option)
-> useful for type checking in ‘get’ method
-
get_version(version='0.0.0')[source]
Return configuration (not application!) version
-
has_option(section, option)
Check for the existence of a given option in a given section.
-
has_section(section)
Indicate whether the named section is present in the configuration.
The DEFAULT section is not acknowledged.
-
items(section, raw=False, vars=None)
Return a list of tuples with (name, value) for each option
in the section.
All % interpolations are expanded in the return values, based on the
defaults passed into the constructor, unless the optional argument
`raw’ is true. Additional substitutions may be provided using the
`vars’ argument, which must be a dictionary whose contents overrides
any pre-existing defaults.
The section DEFAULT is special.
-
options(section)
Return a list of option names for the given section name.
-
read(filenames)
Read and parse a filename or a list of filenames.
Files that cannot be opened are silently ignored; this is
designed so that you can specify a list of potential
configuration file locations (e.g. current directory, user’s
home directory, systemwide directory), and all existing
configuration files in the list will be read. A single
filename may also be given.
Return list of successfully read files.
-
readfp(fp, filename=None)
Like read() but the argument must be a file-like object.
The `fp’ argument must have a `readline’ method. Optional
second argument is the `filename’, which if not given, is
taken from fp.name. If fp has no `name’ attribute, `<???>’ is
used.
-
remove_option(section, option)
Remove an option.
-
remove_section(section)
Remove a file section.
-
reset_to_defaults(save=True, verbose=False)[source]
Reset config to Default values
-
sections()
Return a list of section names, excluding [DEFAULT]
-
set(section, option, value, verbose=False, save=True)[source]
Set an option
section=None: attribute a default section name
-
set_as_defaults()[source]
Set defaults from the current config
-
set_default(section, option, default_value)[source]
Set Default value for a given (section, option)
-> called when a new (section, option) is set and no default exists
-
set_version(version='0.0.0', save=True)[source]
Set configuration (not application!) version
-
write(fp)
Write an .ini-format representation of the configuration state.
-
guidata.userconfig.get_home_dir()[source]
Return user home directory
-
guidata.userconfig.utf8(x)[source]
Encode unicode string in UTF-8
utils
The guidata.utils module provides various utility helper functions
(pure python).
-
class guidata.utils.FormatTime(hours_fmt='%d H ', min_fmt='%d min ', sec_fmt='%d s')[source]
Helper object that substitute as a string to
format seconds into (nn H mm min ss s)
-
class guidata.utils.Timer[source]
MATLAB-like timer: tic, toc
-
tic(cat)[source]
Starting timer
-
toc(cat, msg='delta:')[source]
Stopping timer
-
guidata.utils.add_extension(item, value)[source]
Add extension to filename
item: data item representing a file path
value: possible value for data item
-
guidata.utils.assert_interface_supported(klass, iface)[source]
Makes sure a class supports an interface
-
guidata.utils.assert_interfaces_valid(klass)[source]
Makes sure a class supports the interfaces
it declares
-
guidata.utils.bind(fct, value)[source]
Returns a callable representing the function ‘fct’ with it’s
first argument bound to the value
if g = bind(f,1) and f is a function of x,y,z
then g(y,z) will return f(1,y,z)
-
guidata.utils.get_module_path(modname)[source]
Return module modname base path
-
guidata.utils.is_module_available(module_name)[source]
Return True if Python module is available
-
guidata.utils.is_program_installed(basename)[source]
Return program absolute path if installed in PATH
Otherwise, return None
-
guidata.utils.isodate_to_localtime(datestr)[source]
Convert ISO date to local time
-
guidata.utils.localtime_to_isodate(time_struct)[source]
Convert local time to ISO date
-
guidata.utils.min_equals_max(min, max)[source]
Return True if minimium value equals maximum value
Return False if not, or if maximum or minimum value is not defined
-
guidata.utils.pairs(iterable)[source]
A simple generator that takes a list and generates
pairs [ (l[0],l[1]), ..., (l[n-2], l[n-1])]
-
guidata.utils.restore_dataset(source, dest)[source]
Restore dest dataset items from source dataset
This function is almost the same as update_dataset but requires
the source to be a DataSet instead of the destination.
-
guidata.utils.run_program(name, args='', cwd=None, shell=True, wait=False)[source]
Run program in a separate process
-
guidata.utils.trace(fct)[source]
A decorator that traces function entry/exit
used for debugging only
-
guidata.utils.unicode_to_stdout(ustr)[source]
convert a unicode string to a byte string encoded
for stdout output
-
guidata.utils.update_dataset(dest, source, visible_only=False)[source]
Update dest dataset items from source dataset
dest should inherit from DataSet, whereas source can be any
Python object containing matching attribute names.
For each DataSet item, the function will try to get the attribute
of the same name from the source.
visible_only: if True, update only visible items
-
guidata.utils.utf8_to_unicode(string)[source]
Convert UTF-8 string to Unicode