All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Slots | Public Member Functions
Qtilities::CoreGui::ObjectPropertyBrowser Class Reference

The ObjectPropertyBrowser class provides an interface to the Qt Property Editor solution. More...

#include <ObjectPropertyBrowser.h>

List of all members.

Public Types

enum  BrowserType { TreeBrowser, GroupBoxBrowser, ButtonBrowser }
 This enumeration contains all the possible modes in which the property editor can be used. More...

Public Slots

void refresh (bool has_changes=true)
 Refresh function which checks all properties on the current object and refreshes the property editor.
void setObject (QObject *obj, bool monitor_changes=true)
 Sets the object for which the properties must be shown.
void setObject (QPointer< QObject > obj, bool monitor_changes=true)
 Sets the object for which the properties must be shown.
void setObject (QList< QObject * > objects, bool monitor_changes=true)
 Sets the object for which the properties must be shown.
void setObject (QList< QPointer< QObject > > objects, bool monitor_changes=true)
 Sets the object by providing a list of smart pointers.

Public Member Functions

QtAbstractPropertyBrowser * abstractPropertyBrowser () const
 Return a reference to the QtAbstractPropertyBrowser property browser used internally.
void clearFilter ()
 Clears the current filter list. The internal data structures will be updated automatically to include the previously filtered classes.
QStringList filterList () const
 Gets the current filter list.
bool filterListInversed ()
 Gets the filter list inverse setting. True if the inverse is enabled, false otherwise.
QObject * object () const
 Sets the object to inspect and display properties for.
void setFilterList (QStringList filter_list, bool inversed_list=false)
 Sets up a filter list. Classes specified in the filter list will not be editable. The internal data structures will be updated automatically to exclude the previously filtered classes.
void setFilterListInversed (bool toggle)
 Sets the filter list to inverse mode, thus you can filter all classes except a specific set.
QSize sizeHint () const
 Override size hint in order to resize it according to the number of properties displayed.
void toggleReadOnlyPropertiesDisabled (bool toggle)
 Toggle if read only properties should be disabled in the property editor. If not they will be editable, but changes won't be written back to the object.

Detailed Description

The ObjectPropertyBrowser class provides an interface to the Qt Property Editor solution.

To view the properties of an object, set the object using the setObject() function and the current object can be obtained using the object() function. It is possible to filter the inherited classes which are shown by the property browser by calling the setFilterList() function. The current filter can be obtained using the filterList() function and it can be cleared using the clearFilter() function. It is also possible to create an inversed filter using the setFilterListInversed() function. This is usefull when you want to display all inherited classes expect the ones in the filter list.

The properties can be displayed in different ways, defined by the BrowserType enumeration.

The widget embedded in the debug plugin is shown below for an example object.

debugging_static_properties.jpg
Static Properties Browser
See also:
ObjectDynamicPropertyBrowser

Member Enumeration Documentation

This enumeration contains all the possible modes in which the property editor can be used.

Enumerator:
TreeBrowser 

Object's inherited classes and their properties are displayed in a tree.

property_editor_tree_browser.jpg
Property Browser (Tree Browser Mode)
GroupBoxBrowser 

Object's inherited classes and their properties are displayed in group boxes.

property_editor_groupbox_browser.jpg
Property Browser (Groupbox Browser Mode)
ButtonBrowser 

Object's inherited classes and their properties are displayed in the form of buttons.

property_editor_button_browser.jpg
Property Browser (Button Browser Mode)

Member Function Documentation

QtAbstractPropertyBrowser * Qtilities::CoreGui::ObjectPropertyBrowser::abstractPropertyBrowser ( ) const

Return a reference to the QtAbstractPropertyBrowser property browser used internally.

This function was added in Qtilities v1.2.

void Qtilities::CoreGui::ObjectPropertyBrowser::refresh ( bool  has_changes = true)
slot

Refresh function which checks all properties on the current object and refreshes the property editor.

See also:
setObject()
void Qtilities::CoreGui::ObjectPropertyBrowser::setFilterList ( QStringList  filter_list,
bool  inversed_list = false 
)

Sets up a filter list. Classes specified in the filter list will not be editable. The internal data structures will be updated automatically to exclude the previously filtered classes.

Note:
For optimal performance, set your filter list before calling the setObject() function.
void Qtilities::CoreGui::ObjectPropertyBrowser::setObject ( QObject *  obj,
bool  monitor_changes = true 
)
slot

Sets the object for which the properties must be shown.

Parameters:
objThe object which must be used.
monitor_changesWhen true this function will check if the object implements the Qtilities::Core::Interfaces::IModificationNotifier interface, and if so it will monitor it for changes. When it changes the property browser will automatically call refresh().
void Qtilities::CoreGui::ObjectPropertyBrowser::setObject ( QPointer< QObject >  obj,
bool  monitor_changes = true 
)
slot

Sets the object for which the properties must be shown.

Parameters:
objThe object which must be used.
monitor_changesWhen true this function will check if the object implements the Qtilities::Core::Interfaces::IModificationNotifier interface, and if so it will monitor it for changes. When it changes the property browser will automatically call refresh().
void Qtilities::CoreGui::ObjectPropertyBrowser::setObject ( QList< QObject * >  objects,
bool  monitor_changes = true 
)
slot

Sets the object for which the properties must be shown.

Function which allows this widget to be connected to the Qtilities::Core::Interfaces::IObjectManager::metaTypeActiveObjectsChanged() signal.

Parameters:
objectsA list of objects. When the list contains 1 item, it will be used in this widget.
monitor_changesWhen true this function will check if the object implements the Qtilities::Core::Interfaces::IModificationNotifier interface, and if so it will monitor it for changes. When it changes the property browser will automatically call refresh().
void Qtilities::CoreGui::ObjectPropertyBrowser::setObject ( QList< QPointer< QObject > >  objects,
bool  monitor_changes = true 
)
slot

Sets the object by providing a list of smart pointers.

Parameters:
objectsA list of objects. When the list contains 1 item, it will be used in this widget.
monitor_changesWhen true this function will check if the object implements the Qtilities::Core::Interfaces::IModificationNotifier interface, and if so it will monitor it for changes. When it changes the property browser will automatically call refresh().


Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé