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

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

#include <ObjectDynamicPropertyBrowser.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 ()
 Refresh function which gets 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 clear ()
 Clears currently displayed properties.
bool isToolBarVisible () const
 Function which checks if the toolbar is currently visible.
ObjectManager::PropertyTypes newPropertyType () const
 Gets what property type must be used when the user adds new properties.
QObject * object () const
 Sets the object to inspect and display properties for.
bool readOnly () const
 Gets if the property editor is read only.
void setNewPropertyType (ObjectManager::PropertyTypes new_property_type)
 Sets what property type must be used when the user adds new properties.
void setReadOnly (bool read_only)
 Sets if the property editor is read only.
QSize sizeHint () const
 Reimplement size hint for our case.
void toggleQtilitiesProperties (bool show_qtilities_properties)
 Toggles if Qtilities properties are shown.
void toggleToolBar ()
 Function which toggle the visibility of the toolbar with add/remove actions etc. on the property browser.

Detailed Description

The ObjectDynamicPropertyBrowser 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. The properties can be displayed in different ways, defined by the BrowserType enumeration.

This widget allows you to display the following type of properties:

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

debugging_dynamic_properties.jpg
Dynamic Properties Browser
See also:
Qtilities::Core::ObjectPropertyBrowser

This class was added in Qtilities v1.0.


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 * ObjectDynamicPropertyBrowser::abstractPropertyBrowser ( ) const

Return a reference to the QtAbstractPropertyBrowser property browser used internally.

This function was added in Qtilities v1.2.

bool ObjectDynamicPropertyBrowser::isToolBarVisible ( ) const

Function which checks if the toolbar is currently visible.

This function was added in Qtilities v1.2.

See also:
toggleToolBar()
ObjectManager::PropertyTypes Qtilities::CoreGui::ObjectDynamicPropertyBrowser::newPropertyType ( ) const

Gets what property type must be used when the user adds new properties.

Returns:
The property type used when the user adds new properties. Default is normal QVariants, thus ObjectManager::NonQtilitiesProperties.
bool ObjectDynamicPropertyBrowser::readOnly ( ) const

Gets if the property editor is read only.

This function was added in Qtilities v1.2.

void Qtilities::CoreGui::ObjectDynamicPropertyBrowser::refresh ( )
slot

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

See also:
setObject()
void Qtilities::CoreGui::ObjectDynamicPropertyBrowser::setNewPropertyType ( ObjectManager::PropertyTypes  new_property_type)

Sets what property type must be used when the user adds new properties.

Note:
Only ObjectManager::SharedProperties and ObjectManager::NonQtilitiesProperties types are allowed, when trying to set it to something else this function does nothing.
void Qtilities::CoreGui::ObjectDynamicPropertyBrowser::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::ObjectDynamicPropertyBrowser::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::ObjectDynamicPropertyBrowser::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, if it contains more than 1 this function does nothing.
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::ObjectDynamicPropertyBrowser::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, if it contains more than 1 this function does nothing.
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 ObjectDynamicPropertyBrowser::setReadOnly ( bool  read_only)

Sets if the property editor is read only.

This function was added in Qtilities v1.2.

void ObjectDynamicPropertyBrowser::toggleToolBar ( )

Function which toggle the visibility of the toolbar with add/remove actions etc. on the property browser.

This function was added in Qtilities v1.2.

See also:
isToolBarVisible()


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