The ObserverWidget class provides a ready-to-use widget to display information about a specific observer context. More...
#include <ObserverWidget.h>
Public Slots | |
void | clearSelection () |
Clears the current selection in the view. | |
void | expandNodes (const QStringList &node_names) |
Expand all nodes for which their display names matches the node_names parameters. | |
void | expandNodes (QModelIndexList indexes) |
Expand all nodes specified by the indexes in indexes . | |
virtual void | handle_actionNewItem_triggered () |
This function is triggered by the Qtilities::Core::ObserverHints::ActionNewItem action. | |
virtual void | handle_actionPaste_triggered () |
Function which is connected to the Qtilities::CoreGui::Actions::qti_action_EDIT_PASTE action if it exists. | |
void | handleLayoutChangeCompleted () |
Handle post layout changed actions in table view mode. | |
void | handleSearchItemTypesChanged () |
Handle changes to the type of items which must be filtered. | |
void | handleSearchOptionsChanged () |
Handles search options changes in the SearchBoxWidget if present. | |
void | handleSearchStringChanged (const QString &filter_string) |
Handles search string changes in the SearchBoxWidget if present. | |
void | handleSelectionModelChange () |
Handles the selection model change. | |
void | handleSettingsUpdateRequest (const QString &request_id) |
Monitors the settings update request signal on the QtilitiesCoreGui instance. | |
virtual void | refresh () |
Refreshes the current item view. | |
void | refreshActions () |
Refreshes the state of all actions. | |
void | resizeColumns () |
Resizes columns to their match their contents. | |
void | resizeTableViewRows (int height=-1) |
Slot which resizes the rows in table view mode. | |
ObserverTreeItem::TreeItemTypeFlags | searchBoxCheckedItemFilters () const |
Gets the active item type filters in the menu on the search box widget used in this ObserverWidget. | |
void | selectCategories (QList< QtilitiesCategory > categories) |
Selects the specified categories in the active item view. | |
void | selectCategory (QtilitiesCategory category) |
Selects the specified object in the active item view. | |
virtual void | selectionCopy () |
Function to copy the current selection to the application clipboard. | |
virtual void | selectionCut () |
Function to cut the current selection to the application clipboard. | |
virtual void | selectionDelete () |
Deletes the current selected items. | |
virtual void | selectionDeleteAll () |
Deletes all subjects under the current selection parent or in the selected context. | |
virtual void | selectionDetach () |
Detaches the current selected objects in the item view from the current selection parent. | |
virtual void | selectionDetachAll () |
Detaches all subjects from the current selection parent. | |
virtual void | selectionPushDown () |
In TableView mode this function can be used to push down into (set the observer context of the widget) to the current selected observer. | |
virtual void | selectionPushDownNew () |
In TableView mode this function can be used to push down into (set the observer context of the widget) to the current selected observer in a new ObserverWidget. | |
virtual void | selectionPushUp () |
In TableView mode this function can be used to push up to (set the observer context of the widget) to the current selection parent. | |
virtual void | selectionPushUpNew () |
In TableView mode this function can be used to push up to (set the observer context of the widget) to the current selection parent in a new ObserverWidget. | |
void | selectObject (QObject *object) |
Selects the specified object in the active item view. | |
void | selectObjects (QList< QObject * > objects) |
Selects the specified objects in the active item view. | |
void | selectObjects (QList< QPointer< QObject > > objects) |
Selects the specified objects in a smart pointer list in the active item view. | |
void | setPreferredDynamicPropertyEditorDockArea (Qt::DockWidgetArea property_editor_dock_area) |
Sets the desired area of the dynamic property editor (if it is used by the observer context). | |
void | setPreferredDynamicPropertyEditorType (ObjectDynamicPropertyBrowser::BrowserType property_editor_type) |
Sets the desired type of the dynamic property editor (if it is used by the observer context). | |
void | setPreferredPropertyEditorDockArea (Qt::DockWidgetArea property_editor_dock_area) |
Sets the desired area of the property editor (if it is used by the observer context). | |
void | setPreferredPropertyEditorType (ObjectPropertyBrowser::BrowserType property_editor_type) |
Sets the desired type of the property editor (if it is used by the observer context). | |
void | setPreferredPropertyFilter (QStringList filter_list, bool inversed_filter=false) |
Sets the desired property browser filter list to be used when constructing a property browser in this widget. | |
void | setSearchBoxCheckedItemFilters (ObserverTreeItem::TreeItemTypeFlags item_filter_flags) |
Sets the active item type filters in the menu on the search box widget used in this ObserverWidget. | |
virtual void | toggleDisplayMode () |
Toggles the display mode of the ObserverWidget. | |
void | toggleSearchBox () |
Toggles the visibility of the SearchBoxWidget at the bottom of the ObserverWidget. | |
virtual void | viewCollapseAll () |
Collapse all items in the tree view to a depth of 1 in TreeView mode. | |
virtual void | viewExpandAll () |
Expand all items in the tree view in TreeView mode. | |
virtual void | writeSettings () |
Slot connected to QCoreApplication::aboutToQuit() signal. |
Signals | |
void | addActionNewItem_triggered (QObject *object, Observer *parent_observer=0) |
Signal which is emitted when the add new item action is triggered. | |
void | displayModeChanged (Qtilities::DisplayMode display_mode) |
Signal which is emitted when the display mode of this widget is toggled. | |
void | doubleClickRequest (QObject *object, Observer *parent_observer=0) |
Signal which is emitted when the user double clicks on an item in the observer widget. | |
void | expandedNodesChanged (const QStringList &node_names) |
Signal which is emitted when the expanded nodes changes. | |
void | newObserverWidgetCreated (ObserverWidget *new_widget) |
Signal which is emitted when the user pushes up/down in a new observer widget. The new widget is passed as a paramater. | |
void | observerContextChanged (Observer *new_context) |
Signal which is emitted when the observer context of this widget changes. | |
void | readOnlyStateChanged (bool read_only) |
Signal which is emitted when this widget's read only state changes. | |
void | selectedObjectsChanged (QList< QObject * > selected_objects, Observer *selection_parent=0) |
Signal which is emitted when object selection changes. | |
void | treeModelBuildEnded () const |
Signal which is emitted when a new tree building cycle ends (Only when in TreeView mode). | |
void | treeModelBuildStarted (int task_id) const |
Signal which is emitted when a new tree building cycle starts (Only when in TreeView mode). |
Public Member Functions | |
IActionProvider * | actionProvider () |
Returns the action handler interface for this observer widget. | |
ObserverHints * | activeHints () const |
This function will provide the hints which should be used by this widget at any time. | |
bool | appendSelectedContexts () const |
Indicates if this observer widget appends contexts of selected objects implementing IContext. | |
bool | confirmDeletes () const |
Function to get the interaction with the user when deleting subjects. | |
QString | contextHelpId () const |
Returns a help ID for this context. | |
QString | contextString () const |
In the case of an ObserverWidget, the contextString() is the same as the globalMetaType(). | |
int | defaultRowHeight () const |
Function to get the default height used for the table view when this widget is used in TableView mode. | |
void | disableAutoColumnResizing () |
Disables automatic column resizing in the displayed table or tree view, depending on the displayMode(). | |
void | disableProxyModels () const |
Disables usage of proxy filter models. | |
DisplayMode | displayMode () const |
Gets the display mode of the widget. | |
Qt::MouseButton | dragDropCopyButton () const |
Gets the mouse button to use for drag and drop copy operations. | |
Qt::MouseButton | dragDropMoveButton () const |
Gets the mouse button to use for drag and drop move operations. | |
ObjectDynamicPropertyBrowser * | dynamicPropertyBrowser () |
Returns the dynamic property editor used inside the observer widget. This can be 0 depending on the display flags used. Always call this function after initialize(). | |
QDockWidget * | dynamicPropertyBrowserDock () |
Returns the dock widget containing the dynamic property browser. | |
void | enableAutoColumnResizing () |
Enables automatic column resizing in the displayed table or tree view, depending on the displayMode(). | |
bool | eventFilter (QObject *object, QEvent *event) |
Event filter which has responsibilities such as drag and drop operations etc. | |
QStringList | findExpandedItems () const |
Finds all expanded items in the current view. | |
QString | globalMetaType () const |
Gets the global meta type used for this observer widget. | |
virtual void | initialize (bool hints_only=false) |
Initializes the observer widget. Make sure to set the item model as well as the flags you would like to use before calling initialize. | |
QStringList | lastExpandedItemsResults () const |
Returns the last set of calculated expanded items from the last findExpandedItems() call without calculating them again. | |
bool | lazyInitEnabled () const |
Gets if lazy initialization is enabled. | |
QStack< int > | navigationStack () const |
Gets the current navigation stack of this widget. | |
QObject * | objectBase () |
Returns the QObject* base of the interface. | |
const QObject * | objectBase () const |
Returns a const QObject* base of the interface. | |
ObserverWidget (DisplayMode display_mode=TreeView, QWidget *parent=0, Qt::WindowFlags f=0) | |
Default constructor. | |
ObserverWidget (Observer *observer_context, DisplayMode display_mode=TreeView, QWidget *parent=0, Qt::WindowFlags f=0) | |
A constructor which takes the observer context to be displayed as the first parameter. | |
ObjectPropertyBrowser * | propertyBrowser () |
Returns the property editor used inside the observer widget. This can be 0 depending on the display flags used. Always call this function after initialize(). | |
QDockWidget * | propertyBrowserDock () |
Returns the dock widget containing the property browser. | |
bool | readOnly () const |
Gets if this widget must be read only, thus its actions and property editor will be read only. | |
virtual void | readSettings () |
Restores the widget to a previous state. | |
void | refreshActionToolBar (bool force_full_refresh=false) |
Refreshes the action toolbar with the current state of the actions. | |
SearchBoxWidget * | searchBoxWidget () |
Returns the SearchBoxWidget contained inside the observer widget. | |
QModelIndexList | selectedIndexes () const |
Provides a list of QModelIndexes which are currently selected. Use this call instead of the item model selection's selectedIndexes() call since this function will map the indexes from the proxy model's indexes to the real model's indexes. | |
QList< QObject * > | selectedObjects () const |
Provides a list of QObject pointers to all the selected objects. | |
bool | selectedObjectsContextMatch () const |
Checks if all current selectedObjects() are in the same context. | |
bool | selectedObjectsHintsMatch () const |
Checks if all current selectedObjects() share the same ObserverHints. | |
Observer * | selectionParent () const |
Provides a pointer to the current selection's parent. If no objects are selected, 0 is returned. | |
void | setAppendSelectedContexts (bool enable) |
Enables/disables appending of selected contexts when selected objects change. | |
void | setConfirmDeletes (bool confirm_deletes) |
Function to set the interaction with the user when deleting subjects. | |
bool | setCustomHints (ObserverHints *custom_hints) |
This function allows you to copy the custom hints used by this ObserverWidget from a different ObserverHints instance. | |
bool | setCustomTableModel (ObserverTableModel *table_model) |
Function which sets a custom table model to be used in this widget when its in TableView mode. | |
bool | setCustomTableProxyModel (QAbstractProxyModel *proxy_model) |
Function which sets a custom table proxy model to be used in this widget when its in TableView mode. | |
bool | setCustomTreeModel (ObserverTreeModel *tree_model) |
Function which sets a custom tree model to be used in this widget when its in TreeView mode. | |
bool | setCustomTreeProxyModel (QAbstractProxyModel *proxy_model) |
Function which sets a custom tree proxy model to be used in this widget when its in TreeView mode. | |
void | setDefaultRowHeight (int height) |
Function to set the default height used for the table view when this widget is used in TableView mode. | |
void | setDisplayMode (DisplayMode display_mode) |
Sets the display mode of the widget. | |
void | setDragDropCopyButton (Qt::MouseButton mouse_button) |
Sets the mouse button to use for drag and drop copy operations. | |
void | setDragDropMoveButton (Qt::MouseButton mouse_button) |
Sets the mouse button to use for drag and drop move operations. | |
bool | setGlobalMetaType (const QString &meta_type) |
Sets the global meta type used for this observer widget. | |
void | setNavigationStack (QStack< int > navigation_stack) |
Allows you to set the navigation stack of this widget. | |
bool | setObserverContext (Observer *observer) |
Implementation of virtual function ObserverAwareBase::setObserverContext(). | |
virtual void | setReadOnly (bool read_only) |
Sets if this widget must be read only, thus its actions and property editor will be read only. | |
void | setSharedGlobalMetaType (const QString &shared_meta_type) |
Function which allows this observer widget to share global object activity with other observer widgets. | |
void | setTreeExpandCollapseVisible (bool is_visible) |
Sets if the "Expand All"/"Collapse All" actions should be visible when in TreeView mode. | |
QString | sharedGlobalMetaType () const |
Function to get the shared global activity meta type of this observer widget. | |
QTableView * | tableView () |
Function providing access to the contained table view. | |
void | toggleLazyInit (bool enabled) |
Enables/disables lazy initialization. | |
void | toggleUseGlobalActiveObjects (bool toggle) |
Function to toggle if this observer widget updates global active objects under its globalMetaType() meta type. | |
void | toggleUseObserverHints (bool toggle) |
Function to toggle usage of hints from the active parent observer. If not default hints will be used. | |
int | topLevelObserverID () |
Returns the observer ID of the top level observer in the widget. If the top level observer is not defined, -1 is returned. | |
bool | treeExpandCollapseVisible () const |
Gets if the "Expand All"/"Collapse All" actions should be visible when in TreeView mode. | |
QTreeView * | treeView () |
Function providing access to the contained tree view. | |
void | updateGlobalActiveSubjects () |
Sets the global object subject type used by this observer widget. | |
bool | useGlobalActiveObjects () const |
Indicates if this observer widget updates global active objects. | |
bool | usesObserverHints () const |
Indicates if this widget uses its own custom hints or that of the active observer. | |
QAbstractItemView * | view () |
Function providing access to the QAbstractItemView view base class. | |
virtual | ~ObserverWidget () |
Default destructor. | |
Public Member Functions inherited from Qtilities::Core::ObserverAwareBase | |
Observer * | observerContext () const |
Gets a pointer to the observer context. |
Protected Member Functions | |
void | constructActions () |
Constructs actions inside the observer widget. | |
void | constructDynamicPropertyBrowser () |
Constructs the dynamic property browser and show it. If it already exists, this function does nothing. | |
void | constructPropertyBrowser () |
Constructs the property browser and show it. If it already exists, this function does nothing. | |
void | deleteActionToolBars () |
Deletes all the current action toolbars. | |
void | refreshDynamicPropertyBrowser () |
Refreshes the dynamic property browser, thus hide or show it depending on the active display flags. | |
void | refreshPropertyBrowser () |
Refreshes the property browser, thus hide or show it depending on the active display flags. |
The ObserverWidget class provides a ready-to-use widget to display information about a specific observer context.
The ObserverWidget class provides a ready-to-use widget to display information about a specific observer context, reducing the workload when you need to display data related to a specific observer context. The goal of the observer widget is to maximize the possible number of usage scenarios by being as customizable as possible.
Below is an example of a basic observer widget in tree mode.
The Observer Widgets article provides a comprehensive overview of the different ways that the observer widget can be used.
Qtilities::CoreGui::ObserverWidget::ObserverWidget | ( | DisplayMode | display_mode = TreeView , |
QWidget * | parent = 0 , |
||
Qt::WindowFlags | f = 0 |
||
) |
Default constructor.
display_mode | The display mode that should be used. |
parent | The parent widget. |
f | The Qt::WindowFlags which must be used for the widget. |
Qtilities::CoreGui::ObserverWidget::ObserverWidget | ( | Observer * | observer_context, |
DisplayMode | display_mode = TreeView , |
||
QWidget * | parent = 0 , |
||
Qt::WindowFlags | f = 0 |
||
) |
A constructor which takes the observer context to be displayed as the first parameter.
This constructor can be used if no functions need to be called on the observer widget object before initializing it. The result is less code:
observer_context | The observer context to be displayed. If invalid, the constructor will not call setObserverContext() and initialize(). |
display_mode | The display mode that should be used. |
parent | The parent widget. |
f | The Qt::WindowFlags which must be used for the widget. |
Qtilities::CoreGui::Interfaces::IActionProvider * Qtilities::CoreGui::ObserverWidget::actionProvider | ( | ) |
Returns the action handler interface for this observer widget.
All constructed actions for the current observer context will be available through this function.
Actions are grouped into the following categories:
It is possible to add actions to these categories.
Qtilities::Core::ObserverHints * Qtilities::CoreGui::ObserverWidget::activeHints | ( | ) | const |
This function will provide the hints which should be used by this widget at any time.
|
signal |
Signal which is emitted when the add new item action is triggered.
The parameters used during this signal emission is defferent depending on the display mode and the selected objects. The following are the possible scenarios:
1) Table View Mode: no object selected:
object | The context displayed in the table. |
parent_observer | The last context in the navigation stack, if no such context exists 0 is returned. |
2) Table View Mode: 1 object selected:
If an observer is selected with the ObserverHints::SelectionUseSelectedContext hint the following parameters are used:
object | 0. |
parent_observer | The selected observer. |
If an observer is selected with no hints or the ObserverHints::SelectionUseParentContext hint, or if an normal object is selected:
object | The selected object. |
parent_observer | The context currently displayed in the table view. |
3) Table View Mode: multiple objects selected:
object | Null (0). |
parent_observer | The context currently displayed in the table view. |
4) Tree View Mode: no objects selected:
object | Null (0). |
parent_observer | The last context in the navigation stack, if no such context exists 0 is returned. |
5) Tree View Mode: 1 object selected:
If an observer is selected with the ObserverHints::SelectionUseSelectedContext hint the following parameters are used:
object | 0. |
parent_observer | The selected observer. |
If an observer is selected with no hints or the ObserverHints::SelectionUseParentContext hint, or if an normal object is selected:
object | The selected object. |
parent_observer | The parent context of the selected object. If it does not have a parent, 0. |
6) Tree View Mode: multiple objects selected:
object | Null (0). |
parent_observer | The parent context of the selected object. If it does not have a parent, 0. |
bool Qtilities::CoreGui::ObserverWidget::appendSelectedContexts | ( | ) | const |
Indicates if this observer widget appends contexts of selected objects implementing IContext.
False by default.
|
slot |
Clears the current selection in the view.
bool Qtilities::CoreGui::ObserverWidget::confirmDeletes | ( | ) | const |
Function to get the interaction with the user when deleting subjects.
The default is true.
|
protected |
Constructs the dynamic property browser and show it. If it already exists, this function does nothing.
This function was added in Qtilities v1.1.
|
protected |
Constructs the property browser and show it. If it already exists, this function does nothing.
This function was added in Qtilities v1.1.
int Qtilities::CoreGui::ObserverWidget::defaultRowHeight | ( | ) | const |
Function to get the default height used for the table view when this widget is used in TableView mode.
void Qtilities::CoreGui::ObserverWidget::disableAutoColumnResizing | ( | ) |
Disables automatic column resizing in the displayed table or tree view, depending on the displayMode().
void Qtilities::CoreGui::ObserverWidget::disableProxyModels | ( | ) | const |
Disables usage of proxy filter models.
This function must be called before initializing the widget for the first time, and it cannot be enabled once it was disabled.
Qtilities::DisplayMode Qtilities::CoreGui::ObserverWidget::displayMode | ( | ) | const |
Gets the display mode of the widget.
|
signal |
Signal which is emitted when the user double clicks on an item in the observer widget.
The parameters used during this signal emission is defferent depending on the display mode and the selected objects. The following are the possible scenarios:
1) Table View Mode: 1 object selected:
If an observer is double clicked with the ObserverHints::SelectionUseSelectedContext hint the following parameters are used:
object | 0. |
parent_observer | The selected observer. |
If an observer is double clicked with no hints or the ObserverHints::SelectionUseParentContext hint, or if an normal object is selected:
object | The selected object. |
parent_observer | The context currently displayed in the table view. |
2) Tree View Mode: 1 object selected:
If an observer is double clicked with the ObserverHints::SelectionUseSelectedContext hint the following parameters are used:
object | 0. |
parent_observer | The selected observer. |
If an observer is double clicked with no hints or the ObserverHints::SelectionUseParentContext hint, or if an normal object is selected:
object | The selected object. |
parent_observer | The parent context of the selected object. If it does not have a parent, 0. |
Qt::MouseButton Qtilities::CoreGui::ObserverWidget::dragDropCopyButton | ( | ) | const |
Gets the mouse button to use for drag and drop copy operations.
By default Qt::RightButton.
Qt::MouseButton Qtilities::CoreGui::ObserverWidget::dragDropMoveButton | ( | ) | const |
Gets the mouse button to use for drag and drop move operations.
By default Qt::RightButton.
Qtilities::CoreGui::ObjectDynamicPropertyBrowser * Qtilities::CoreGui::ObserverWidget::dynamicPropertyBrowser | ( | ) |
Returns the dynamic property editor used inside the observer widget. This can be 0 depending on the display flags used. Always call this function after initialize().
This function was added in Qtilities v1.1.
QDockWidget * Qtilities::CoreGui::ObserverWidget::dynamicPropertyBrowserDock | ( | ) |
Returns the dock widget containing the dynamic property browser.
This function was added in Qtilities v1.1.
void Qtilities::CoreGui::ObserverWidget::enableAutoColumnResizing | ( | ) |
Enables automatic column resizing in the displayed table or tree view, depending on the displayMode().
True by default which will cause the view's columns to be resized to their contents and the name column to be streched. If you would like to do this manually, for example if you want to stretch a custom column, you should disable this.
|
signal |
Signal which is emitted when the expanded nodes changes.
This function was added in Qtilities v1.1.
|
slot |
Expand all nodes for which their display names matches the node_names
parameters.
If any name in node_names does not exist in the tree it is ignored.
node_names | The node names to expand. When empty, viewExpandAll() will be called. |
This function was added in Qtilities v1.1.
|
slot |
Expand all nodes specified by the indexes in indexes
.
If any name in node_names does not exist in the tree it is ignored.
indexes | The indexes to expand. When empty, viewExpandAll() will be called. |
QStringList Qtilities::CoreGui::ObserverWidget::findExpandedItems | ( | ) | const |
Finds all expanded items in the current view.
It should not be neccesarry to use this function directly, rather use lastExpandedItemsResults() since the internal list of expanded items is automatically updated whenever the expansion state of any item in the view changes.
Use this function only if you want to force recalculation of the expanded items.
This function was added in Qtilities v1.1.
QString Qtilities::CoreGui::ObserverWidget::globalMetaType | ( | ) | const |
Gets the global meta type used for this observer widget.
The global meta type is a string which defines this observer widget. The string must be a string which can be registered in the context manager. Thus, such a string must not yet exist as a context in the context manager.
The global meta type is used for the following:
|
virtualslot |
Function which is connected to the Qtilities::CoreGui::Actions::qti_action_EDIT_PASTE action if it exists.
When initializing the Qtilities clipboard manager the paste action will be created automatically.
|
slot |
Handles the selection model change.
This function is called whenever the selection in the item view changes. The function will handle the selection change and then emit selectedObjectChanged().
In TreeView mode, the function will call the Qtilities::CoreGui::ObserverTreeModel::calculateSelectionParent() function to update the selection parent in the tree. Once the selection parent is updated, the setTreeSelectionParent() function will be called which will call initialize(true) on this widget in order to initialize the widget for the new selection parent.
|
virtual |
Initializes the observer widget. Make sure to set the item model as well as the flags you would like to use before calling initialize.
QStringList Qtilities::CoreGui::ObserverWidget::lastExpandedItemsResults | ( | ) | const |
Returns the last set of calculated expanded items from the last findExpandedItems() call without calculating them again.
When findExpandedItems() is called it stores the results internally. Thus function accesses those results without recalculating them.
This function was added in Qtilities v1.1.
bool Qtilities::CoreGui::ObserverWidget::lazyInitEnabled | ( | ) | const |
Gets if lazy initialization is enabled.
This function was added in Qtilities v1.1.
|
inlinevirtual |
Returns a const QObject* base of the interface.
This function can be used in const methods, but make sure that you don't modify things that should stay const. An example where this is used is when we want to get a property on an object in a const method. This is a const operation.
Implements Qtilities::Core::Interfaces::IObjectBase.
Qtilities::CoreGui::ObjectPropertyBrowser * Qtilities::CoreGui::ObserverWidget::propertyBrowser | ( | ) |
Returns the property editor used inside the observer widget. This can be 0 depending on the display flags used. Always call this function after initialize().
QDockWidget * Qtilities::CoreGui::ObserverWidget::propertyBrowserDock | ( | ) |
Returns the dock widget containing the property browser.
bool Qtilities::CoreGui::ObserverWidget::readOnly | ( | ) | const |
Gets if this widget must be read only, thus its actions and property editor will be read only.
|
signal |
Signal which is emitted when this widget's read only state changes.
|
virtual |
Restores the widget to a previous state.
For more information about the saving of settings by Qtilities classes, see Configuration settings storage in Qtilities.
|
virtualslot |
Refreshes the current item view.
This function will emit the refreshViewsData() signal on the top level observer context. The refresh operation will be followed by calling selectObjects() with the same objects which were selected before calling this function was called. The function will then call refreshAction() before it exists.
|
protected |
Refreshes the dynamic property browser, thus hide or show it depending on the active display flags.
This function was added in Qtilities v1.1.
|
slot |
Slot which resizes the rows in table view mode.
Slot which resizes the rows in table view mode.
height | The height which must be used. By default the default row heigth of 17 pixels is used. |
|
slot |
Gets the active item type filters in the menu on the search box widget used in this ObserverWidget.
By default, ObserverTreeItem::TreeItem
This function was added in Qtilities v1.2.
Qtilities::CoreGui::SearchBoxWidget * Qtilities::CoreGui::ObserverWidget::searchBoxWidget | ( | ) |
Returns the SearchBoxWidget contained inside the observer widget.
|
slot |
Selects the specified categories in the active item view.
categories | The categories that must be selected. If any categories in the list are not present in the view, they will be ignored. If the list is empty, nothing will happen. |
This function was added in Qtilities v1.1.
|
slot |
Selects the specified object in the active item view.
category | The category that must be selected. If the category is not present in the view, it will be ignored. |
This function was added in Qtilities v1.1.
QList< QObject * > Qtilities::CoreGui::ObserverWidget::selectedObjects | ( | ) | const |
Provides a list of QObject pointers to all the selected objects.
bool Qtilities::CoreGui::ObserverWidget::selectedObjectsContextMatch | ( | ) | const |
Checks if all current selectedObjects() are in the same context.
This function was added in Qtilities v1.1.
bool Qtilities::CoreGui::ObserverWidget::selectedObjectsHintsMatch | ( | ) | const |
Checks if all current selectedObjects() share the same ObserverHints.
When selectedObjectsContextMatch() is false, this function allows you to check if all selected subjects shares the same hints. This can happen in two scenarios:
This function was added in Qtilities v1.1.
|
virtualslot |
Deletes the current selected items.
|
virtualslot |
Deletes all subjects under the current selection parent or in the selected context.
|
virtualslot |
Detaches the current selected objects in the item view from the current selection parent.
|
virtualslot |
Detaches all subjects from the current selection parent.
|
virtualslot |
In TableView mode this function can be used to push down into (set the observer context of the widget) to the current selected observer.
This function only does something if an observer or an object which contains an observer is selected.
|
virtualslot |
In TableView mode this function can be used to push down into (set the observer context of the widget) to the current selected observer in a new ObserverWidget.
This function only does something if an observer or an object which contains an observer is selected.
|
virtualslot |
In TableView mode this function can be used to push up to (set the observer context of the widget) to the current selection parent.
|
virtualslot |
In TableView mode this function can be used to push up to (set the observer context of the widget) to the current selection parent in a new ObserverWidget.
|
slot |
Selects the specified object in the active item view.
object | The object that must be selected. If the object is not present in the view, it will be ignored. |
|
slot |
Selects the specified objects in the active item view.
objects | The objects that must be selected. If any objects in the list are not present in the view, they will be ignored. If the list is empty, nothing will happen. |
|
slot |
Selects the specified objects in a smart pointer list in the active item view.
objects | The objects that must be selected. If any objects in the list are not present in the view, they will be ignored. If the list is empty, the current selection will be cleared (or you could use clearSelection()). |
void Qtilities::CoreGui::ObserverWidget::setConfirmDeletes | ( | bool | confirm_deletes | ) |
Function to set the interaction with the user when deleting subjects.
bool Qtilities::CoreGui::ObserverWidget::setCustomHints | ( | ObserverHints * | custom_hints | ) |
This function allows you to copy the custom hints used by this ObserverWidget from a different ObserverHints instance.
This functions copies the hints provided by custom_hints, thus it does not manage the lifetime of the custom_hints instance passed to it.
bool Qtilities::CoreGui::ObserverWidget::setCustomTableModel | ( | ObserverTableModel * | table_model | ) |
Function which sets a custom table model to be used in this widget when its in TableView mode.
By default the observer widget uses the Qtilities::CoreGui::ObserverTableModel as the model for the table view. It is possible to use custom models which allows you to extend the default table model.
The observer widget will manage the lifetime of the custom model.
bool Qtilities::CoreGui::ObserverWidget::setCustomTableProxyModel | ( | QAbstractProxyModel * | proxy_model | ) |
Function which sets a custom table proxy model to be used in this widget when its in TableView mode.
By default the observer widget uses the Qtilities::CoreGui::ObserverTableModelProxyFilter as the proxy model for the table view. It is possible to use custom proxy models which allows you to extend the default proxy model.
The observer widget will manage the lifetime of the custom model.
bool Qtilities::CoreGui::ObserverWidget::setCustomTreeModel | ( | ObserverTreeModel * | tree_model | ) |
Function which sets a custom tree model to be used in this widget when its in TreeView mode.
By default the observer widget uses the Qtilities::CoreGui::ObserverTreeModel as the model for the tree view. It is possible to use custom models which allows you to extend the default tree model.
The observer widget will manage the lifetime of the custom model.
bool Qtilities::CoreGui::ObserverWidget::setCustomTreeProxyModel | ( | QAbstractProxyModel * | proxy_model | ) |
Function which sets a custom tree proxy model to be used in this widget when its in TreeView mode.
By default the observer widget uses the Qtilities::CoreGui::ObserverTreeModelProxyFilter as the proxy model for the tree view. It is possible to use custom proxy models which allows you to extend the default proxy model.
The observer widget will manage the lifetime of the custom model.
void Qtilities::CoreGui::ObserverWidget::setDefaultRowHeight | ( | int | height | ) |
Function to set the default height used for the table view when this widget is used in TableView mode.
The default is 17.
void Qtilities::CoreGui::ObserverWidget::setDisplayMode | ( | DisplayMode | display_mode | ) |
Sets the display mode of the widget.
void Qtilities::CoreGui::ObserverWidget::setDragDropCopyButton | ( | Qt::MouseButton | mouse_button | ) |
Sets the mouse button to use for drag and drop copy operations.
Setting the button to Qt::NoButton disables the copy drag/drop functionality.
void Qtilities::CoreGui::ObserverWidget::setDragDropMoveButton | ( | Qt::MouseButton | mouse_button | ) |
Sets the mouse button to use for drag and drop move operations.
Setting the button to Qt::NoButton disables the move drag/drop functionality.
bool Qtilities::CoreGui::ObserverWidget::setGlobalMetaType | ( | const QString & | meta_type | ) |
Sets the global meta type used for this observer widget.
void Qtilities::CoreGui::ObserverWidget::setNavigationStack | ( | QStack< int > | navigation_stack | ) |
Allows you to set the navigation stack of this widget.
The navigation stack keeps track of the user's navigation history of events related to pushing down into observers and pushing up into parents of observers. Using this function you can initialize the widget using a predefined stack. The stack stores IDs of observers assigned by the Qtilities::CoreGui::ObjectManager singleton.
|
slot |
Sets the desired area of the dynamic property editor (if it is used by the observer context).
This area will be used to position the dynamic property editor dock widget when the widget is first shown during a session. Afterwards the widget will remember where the dock widget is.
This function was added in Qtilities v1.1.
|
slot |
Sets the desired type of the dynamic property editor (if it is used by the observer context).
The dynamic property editor type must be set before calling initialize().
This function was added in Qtilities v1.1.
|
slot |
Sets the desired area of the property editor (if it is used by the observer context).
This area will be used to position the property editor dock widget when the widget is first shown during a session. Afterwards the widget will remember where the dock widget is.
|
slot |
Sets the desired type of the property editor (if it is used by the observer context).
The property editor type must be set before calling initialize().
|
virtual |
Sets if this widget must be read only, thus its actions and property editor will be read only.
|
slot |
Sets the active item type filters in the menu on the search box widget used in this ObserverWidget.
This function was added in Qtilities v1.2.
void Qtilities::CoreGui::ObserverWidget::setSharedGlobalMetaType | ( | const QString & | shared_meta_type | ) |
Function which allows this observer widget to share global object activity with other observer widgets.
This function will allow this observer widget to share global object activity with other observer widgets. Because the globalMetaType() for each observer widget must be unique, it is required to use a shared meta type for cases where global object activity needs to be shared between multiple observer widgets.
When using a shared global activity meta type, the normal globalMetaType() will be used for all the normal usage scenarios listed in the globalMetaType() documentation, except for the meta type used to identify a set of active objects in the object manager.
void Qtilities::CoreGui::ObserverWidget::setTreeExpandCollapseVisible | ( | bool | is_visible | ) |
Sets if the "Expand All"/"Collapse All" actions should be visible when in TreeView mode.
This function was added in Qtilities v1.2.
QString Qtilities::CoreGui::ObserverWidget::sharedGlobalMetaType | ( | ) | const |
Function to get the shared global activity meta type of this observer widget.
QTableView * Qtilities::CoreGui::ObserverWidget::tableView | ( | ) |
Function providing access to the contained table view.
|
virtualslot |
Toggles the display mode of the ObserverWidget.
void Qtilities::CoreGui::ObserverWidget::toggleLazyInit | ( | bool | enabled | ) |
Enables/disables lazy initialization.
Lazy initialization means that the internal item view model won't initialize itself during the initialize() call. Its usefull when using custom implemented proxy models etc. To initialize the model in lazy initialization mode call refresh().
Lazy initialization is disabled by default.
This function was added in Qtilities v1.1.
|
slot |
Toggles the visibility of the SearchBoxWidget at the bottom of the ObserverWidget.
void Qtilities::CoreGui::ObserverWidget::toggleUseGlobalActiveObjects | ( | bool | toggle | ) |
Function to toggle if this observer widget updates global active objects under its globalMetaType() meta type.
For more information on global active objects, see the Global object activity management section of the Object Management article.
void Qtilities::CoreGui::ObserverWidget::toggleUseObserverHints | ( | bool | toggle | ) |
Function to toggle usage of hints from the active parent observer. If not default hints will be used.
bool Qtilities::CoreGui::ObserverWidget::treeExpandCollapseVisible | ( | ) | const |
Gets if the "Expand All"/"Collapse All" actions should be visible when in TreeView mode.
*This is true by default.
This function was added in Qtilities v1.2.
QTreeView * Qtilities::CoreGui::ObserverWidget::treeView | ( | ) |
Function providing access to the contained tree view.
void Qtilities::CoreGui::ObserverWidget::updateGlobalActiveSubjects | ( | ) |
Sets the global object subject type used by this observer widget.
If objects are selected, they are set as the active objects. If no objects are selected, the observer context is set as the active object.
For more information see the Global object activity management section of the Object Management article.
bool Qtilities::CoreGui::ObserverWidget::useGlobalActiveObjects | ( | ) | const |
Indicates if this observer widget updates global active objects.
QAbstractItemView * Qtilities::CoreGui::ObserverWidget::view | ( | ) |
Function providing access to the QAbstractItemView view base class.
This function is usefull when you want to access functionality on the current view which is common to both QTreeView and QTableView, without needing to care about the view type.
This function was added in Qtilities v1.2.
|
virtualslot |
Slot connected to QCoreApplication::aboutToQuit() signal.
Saves settings about this ObserverWidget instance using QSettings. The following parameters are saved:
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|