Widgets¶
Widgets.
-
class
objettoqt.widgets.OQWidget(*args, **kwargs)¶ Mixed
QWidgettype.Observes actions sent from an instance of
objetto.bases.BaseObject.- Inherits from:
-
class
objettoqt.widgets.OQWidgetList(parent=None, editor_widget_type=None, header=None, mime_type=None, *args, **kwargs)¶ List of widgets.
Observes actions sent from an instance of
objetto.bases.ListObject.- Inherits from:
- Parameters
editor_widget_type (type[objettoqt.mixins.OQWidgetMixin]) – Editor widget class for items.
header (objettoqt.models.AbstractListModelHeader or None) – Header (or None to use
objettoqt.widgets.OQWidgetListDefaultHeader).scrollable (bool) – Whether should be scrollable or change size according to editors.
-
OBase¶ read-only class attribute
Minimum objetto object base requirement.
-
setItemDelegate(value)¶ Prevent setting item delegate.
- Parameters
value (QItemDelegate) – Item delegate.
- Raises
RuntimeError – Always raised.
-
setModel(model)¶ Prevent setting model.
- Parameters
model (QAbstractItemModel) – Model.
- Raises
RuntimeError – Always raised.
-
setMinimumHeight(minimum_height)¶ Set minimum height.
- Parameters
minimum_height (int) – Minimum height.
-
setMaximumHeight(maximum_height)¶ Set maximum height.
- Parameters
maximum_height (int) – Maximum height.
-
setFixedSize(width_or_size, height=None)¶ Set fixed size.
-
setHorizontalScrollBarPolicy(policy)¶ Set horizontal scrollbar policy.
- Parameters
policy (ScrollBarPolicy) – Policy.
-
setVerticalScrollBarPolicy(policy)¶ Set vertical scrollbar policy.
- Parameters
policy (ScrollBarPolicy) – Policy.
-
setFlow(flow)¶ Set flow. Changing this will reset the scrollbars’ policies and any fixed sizes.
- Parameters
flow (Flow) – Flow.
-
minimumFitSize()¶ Get minimum ‘fit to contents’ size.
- Returns
Minimum ‘fit to contents’ size.
- Return type
-
setMinimumFitSize(minimum_size)¶ Set minimum ‘fit to contents’ size.
- Parameters
minimum_size (int) – Minimum ‘fit to contents’ size.
-
maximumFitSize()¶ Get maximum ‘fit to contents’ size.
- Returns
Maximum ‘fit to contents’ size.
- Return type
-
setMaximumFitSize(maximum_size)¶ Set maximum ‘fit to contents’ size.
- Parameters
maximum_size (int) – Maximum ‘fit to contents’ size.
-
fitToContents()¶ Get whether this list is set to fit its contents or not.
- Returns
True if fits its contents.
- Return type
-
setFitToContents(fit_to_contents=True)¶ Set whether this list is set to fit its contents or not. Changing this will reset the scrollbars’ policies and any fixed sizes.
- Parameters
fit_to_contents (bool) – True to fit its contents.
-
editors()¶ Get editor widgets.
- Returns
Editor widgets.
- Return type
-
resizeEvent(event)¶ Update layout on resize.
- Parameters
event (QResizeEvent) – Resize event.
-
editorWidgetType()¶ Get editor widget class.
- Returns
Editor widget class.
- Return type
-
class
objettoqt.widgets.OQWidgetListDefaultHeader(**initial)¶ Default header for
objettoqt.widgets.OQWidgetList.- Inherits from:
-
data(obj, row, role=PySide2.QtCore.Qt.ItemDataRole.DisplayRole)¶ Returns None for the
QtCore.Qt.DisplayRole.- Parameters
obj (objetto.objects.ListObject) – List object.
row (int) – Row.
role (ItemDataRole) – Role.
- Returns
Data.
- Return type
-
class
objettoqt.widgets.OQHistoryWidget(parent=None, headers=None, mime_type=None, *args, **kwargs)¶ Mixed
QTreeViewtype (for history objects).Observes actions sent from an instance of
objetto.history.HistoryObject.- Inherits from:
- Parameters
headers (tuple[objettoqt.models.AbstractListModelHeader] or None) – Headers (or None to use
objettoqt.widgets.OQHistoryWidgetDefaultHeader).extra_headers (collections.abc.Iterable[objettoqt.models.AbstractListModelHeader or str] or None) – Extra headers.
use_tree_list_view (bool or None) – If True, will use a tree list view instead of a list.
-
class
objettoqt.widgets.OQHistoryWidgetDefaultHeader(**initial)¶ Default header for
objettoqt.widgets.OQHistoryWidget.- Inherits from:
-
data(obj, row, role=PySide2.QtCore.Qt.ItemDataRole.DisplayRole)¶ Dim/brighten text depending on the history’s index.
- Parameters
obj (objetto.objects.ListObject) – History changes list.
row (int) – Row.
role (ItemDataRole) – Role.
- Returns
Data.
- Return type