![]() |
An open-source, flexible 3D physical simulation framework
|
The PropertyDialog provides the QtProperty functionality. More...
#include <PropertyDialog.h>
Public Slots | |
virtual void | accept () |
Associated with the OK button. More... | |
virtual void | reject () |
Associated with the Cancel button. More... | |
Signals | |
void | geometryChanged () |
Emitted when paintEvent is received. More... | |
void | closeSignal () |
Emitted when a QCloseEvent has been received. More... | |
void | tabValueChanged (QtProperty *property, const QVariant &value) |
Emitted when a property in a tab has changed its value. More... | |
Public Member Functions | |
PropertyDialog (QWidget *parent) | |
A contructor. More... | |
virtual | ~PropertyDialog () |
A destructor. More... | |
QtVariantProperty * | addGenericProperty (const std::string &path, int type, const QVariant &value, std::map< QString, QVariant > *attributes=NULL, QStringList *options=NULL) |
Creates a property. More... | |
QtVariantProperty * | addGenericProperty (QtVariantProperty *parent, QtVariantProperty *property) |
Adds the property to the parent's subproperties. More... | |
QtVariantProperty * | addTabbedProperty (const std::string &path, int type, const QVariant &value, std::map< QString, QVariant > *attributes=NULL, QStringList *options=NULL) |
Creates a PropertyDialog tab widget and adds the generic property to it. More... | |
QtVariantProperty * | insertGenericProperty (QtVariantProperty *parent, QtVariantProperty *property, QtVariantProperty *after) |
Inserts the property to the parent's subproperties after the after property. More... | |
void | removeGenericProperty (QtVariantProperty *property) |
Removes the property. More... | |
void | removeAllSubProperties (QtVariantProperty *parent) |
Removes all subproperties of the parent property. More... | |
void | destroyAllSubProperties (QtProperty *parent) |
Detaches and destroys all subproperties of the parent. More... | |
void | addAllSubProperties (QtVariantProperty *parent, QList< QtVariantProperty *> list) |
Adds all properties from the list to the parent's subproperties. More... | |
void | setPropertyColor (QtVariantProperty *property, QColor color) |
Sets the background color of a property in the Tree Property Browser. More... | |
QColor | getPropertyColor (QtVariantProperty *property) const |
Returns the background color of the property in the Tree Property Browser. More... | |
QtProperty * | activeItem (void) |
Returns the item that is currently focused on. More... | |
QtProperty * | currentItem (void) |
Returns the top level item that is currently focused on. More... | |
void | setCurrentItem (QtProperty *property) |
Sets the focus on the top level item property in the Tree Property Browser. More... | |
QPushButton * | addGenericButton (const char *name, const QObject *recv, const char *method) |
Creates a QPushButton with the given name and connects its clicked() slot with the method of the receiver recv . More... | |
void | setViewButtonVisibility (bool visible) |
Sets the visibility of the view button. More... | |
void | setButtonBoxVisibility (bool visible) |
Sets the visibility of the button box. More... | |
void | clearButtonBox (void) |
Removes all buttons from the button box. More... | |
void | hideAllButtons (void) |
Hides the view button and the button box. More... | |
void | setViewMode (const ViewMode &mode) |
Sets the view mode to either tree or button view mode. More... | |
void | setPropCallback (PropertyCallback *pc) |
Sets the callback object. More... | |
ViewMode | getViewMode (void) const |
Returns the current view mode. More... | |
void | expandTree (QtProperty *item) |
Expands the branch of the property item . More... | |
void | collapseTree (QtProperty *item) |
Collapses the branch of the property item . More... | |
bool | isPropertyVisible (QtProperty *prop) const |
Protected Slots | |
virtual void | valueChanged (QtProperty *property, const QVariant &value) |
Called every time a property has changed its value. More... | |
virtual void | currentItemChanged (QtBrowserItem *current) |
Called every time another branch of a QtTreePropertyBrowser has been selected. More... | |
void | toggleView () |
Switches between tree an button view modes. More... | |
Protected Member Functions | |
void | customizeItem (QtVariantProperty *item, int type, const QVariant &value, std::map< QString, QVariant > *attributes=NULL, QStringList *options=NULL) |
Adjusts the attributes and value of a property. More... | |
virtual void | closeEvent (QCloseEvent *event) |
Cleans up before closing. More... | |
void | resizeEvent (QResizeEvent *event) |
Used for geometry handling. More... | |
void | moveEvent (QMoveEvent *event) |
Used for geometry handling. More... | |
Protected Attributes | |
QVBoxLayout * | vBoxLayout |
A vertical layout. More... | |
QHBoxLayout * | hBoxLayout |
A horizontal layout. More... | |
QDialogButtonBox * | buttonBox |
A container for the buttons. More... | |
QPushButton * | viewButton |
A button that toggles the view mode. More... | |
QTabWidget * | tabWidget |
A tab widget handling the tabbed view. More... | |
QScrollArea * | scrollArea |
A scroll area for the property editors. More... | |
QtVariantEditorFactory * | variantFactory |
The factory for the properties. More... | |
QtVariantPropertyManager * | variantManager |
The manager of the properties. More... | |
QtTreePropertyBrowser * | variantEditorTree |
The tree property browser. More... | |
QtButtonPropertyBrowser * | variantEditorButton |
The button property browser. More... | |
PropertyCallback * | propertyCallback |
The callback instance associated with this instance. More... | |
QList< QtProperty * > | myProperties |
Top level properties. More... | |
std::map< QString, PropertyDialog * > | myTabs |
Tabs with their names. More... | |
int | tabView |
An indicator for the tabbed view. More... | |
ViewMode | viewMode |
The view mode of the dialog. More... | |
Private Member Functions | |
void | expandTree (QList< QtBrowserItem *> list) |
void | collapseTree (QList< QtBrowserItem *> list) |
QtProperty * | getParent (QtProperty *parent, QtVariantProperty *property) const |
QtProperty * | getTopLevelParent (QtProperty *property) const |
The PropertyDialog provides the QtProperty functionality.
PropertyDialog allows creation and managemenet of properties of various types using the QtProperty extension.
Definition at line 69 of file PropertyDialog.h.
mars::main_gui::PropertyDialog::PropertyDialog | ( | QWidget * | parent | ) |
A contructor.
Definition at line 42 of file PropertyDialog.cpp.
|
virtual |
A destructor.
Definition at line 100 of file PropertyDialog.cpp.
|
virtualslot |
Associated with the OK button.
Definition at line 500 of file PropertyDialog.cpp.
QtProperty * mars::main_gui::PropertyDialog::activeItem | ( | void | ) |
Returns the item that is currently focused on.
Definition at line 466 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::addAllSubProperties | ( | QtVariantProperty * | parent, |
QList< QtVariantProperty *> | list | ||
) |
Adds all properties from the list to the parent's subproperties.
Definition at line 347 of file PropertyDialog.cpp.
QPushButton * mars::main_gui::PropertyDialog::addGenericButton | ( | const char * | name, |
const QObject * | recv, | ||
const char * | method | ||
) |
Creates a QPushButton with the given name and connects its clicked()
slot with the method
of the receiver recv
.
Definition at line 554 of file PropertyDialog.cpp.
QtVariantProperty* mars::main_gui::PropertyDialog::addGenericProperty | ( | const std::string & | path, |
int | type, | ||
const QVariant & | value, | ||
std::map< QString, QVariant > * | attributes = NULL , |
||
QStringList * | options = NULL |
||
) |
Creates a property.
path | If path begins with "../" then the property is created in this dialog else a tab widget is created. |
type | A QVariant::Type. |
value | The initial value. |
options | Items for enumTypeId() and flagTypeId() |
QtVariantProperty * mars::main_gui::PropertyDialog::addGenericProperty | ( | QtVariantProperty * | parent, |
QtVariantProperty * | property | ||
) |
Adds the property to the parent's subproperties.
Definition at line 275 of file PropertyDialog.cpp.
QtVariantProperty * mars::main_gui::PropertyDialog::addTabbedProperty | ( | const std::string & | path, |
int | type, | ||
const QVariant & | value, | ||
std::map< QString, QVariant > * | attributes = NULL , |
||
QStringList * | options = NULL |
||
) |
Creates a PropertyDialog tab widget and adds the generic property to it.
Definition at line 105 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::clearButtonBox | ( | void | ) |
Removes all buttons from the button box.
Definition at line 576 of file PropertyDialog.cpp.
|
protectedvirtual |
Cleans up before closing.
Definition at line 512 of file PropertyDialog.cpp.
|
signal |
Emitted when a QCloseEvent has been received.
void mars::main_gui::PropertyDialog::collapseTree | ( | QtProperty * | item | ) |
Collapses the branch of the property item
.
Definition at line 270 of file PropertyDialog.cpp.
|
private |
Definition at line 250 of file PropertyDialog.cpp.
QtProperty * mars::main_gui::PropertyDialog::currentItem | ( | void | ) |
Returns the top level item that is currently focused on.
Definition at line 482 of file PropertyDialog.cpp.
|
protectedvirtualslot |
Called every time another branch of a QtTreePropertyBrowser has been selected.
current | The current top level item that is selected. |
Definition at line 456 of file PropertyDialog.cpp.
|
protected |
Adjusts the attributes and value of a property.
Definition at line 419 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::destroyAllSubProperties | ( | QtProperty * | parent | ) |
Detaches and destroys all subproperties of the parent.
Definition at line 355 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::expandTree | ( | QtProperty * | item | ) |
Expands the branch of the property item
.
Definition at line 266 of file PropertyDialog.cpp.
|
private |
Definition at line 258 of file PropertyDialog.cpp.
|
signal |
Emitted when paintEvent is received.
|
private |
Definition at line 369 of file PropertyDialog.cpp.
QColor mars::main_gui::PropertyDialog::getPropertyColor | ( | QtVariantProperty * | property | ) | const |
Returns the background color of the property in the Tree Property Browser.
Definition at line 398 of file PropertyDialog.cpp.
|
private |
Definition at line 407 of file PropertyDialog.cpp.
ViewMode mars::main_gui::PropertyDialog::getViewMode | ( | void | ) | const |
Returns the current view mode.
Definition at line 586 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::hideAllButtons | ( | void | ) |
Hides the view button and the button box.
Definition at line 571 of file PropertyDialog.cpp.
QtVariantProperty * mars::main_gui::PropertyDialog::insertGenericProperty | ( | QtVariantProperty * | parent, |
QtVariantProperty * | property, | ||
QtVariantProperty * | after | ||
) |
Inserts the property to the parent's subproperties after the after property.
Definition at line 288 of file PropertyDialog.cpp.
bool mars::main_gui::PropertyDialog::isPropertyVisible | ( | QtProperty * | prop | ) | const |
Definition at line 595 of file PropertyDialog.cpp.
|
protected |
Used for geometry handling.
Definition at line 549 of file PropertyDialog.cpp.
|
virtualslot |
Associated with the Cancel button.
Definition at line 506 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::removeAllSubProperties | ( | QtVariantProperty * | parent | ) |
Removes all subproperties of the parent property.
Definition at line 336 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::removeGenericProperty | ( | QtVariantProperty * | property | ) |
Removes the property.
Definition at line 300 of file PropertyDialog.cpp.
|
protected |
Used for geometry handling.
Definition at line 544 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::setButtonBoxVisibility | ( | bool | visible | ) |
Sets the visibility of the button box.
Definition at line 563 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::setCurrentItem | ( | QtProperty * | property | ) |
Sets the focus on the top level item property in the Tree Property Browser.
Definition at line 449 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::setPropCallback | ( | PropertyCallback * | pc | ) |
Sets the callback object.
Definition at line 591 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::setPropertyColor | ( | QtVariantProperty * | property, |
QColor | color | ||
) |
Sets the background color of a property in the Tree Property Browser.
Definition at line 390 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::setViewButtonVisibility | ( | bool | visible | ) |
Sets the visibility of the view button.
Definition at line 567 of file PropertyDialog.cpp.
void mars::main_gui::PropertyDialog::setViewMode | ( | const ViewMode & | mode | ) |
Sets the view mode to either tree or button view mode.
Definition at line 580 of file PropertyDialog.cpp.
|
signal |
Emitted when a property in a tab has changed its value.
Forwarded to the corresponding TabPropertyDialog.
|
protectedslot |
Switches between tree an button view modes.
Definition at line 525 of file PropertyDialog.cpp.
|
protectedvirtualslot |
Called every time a property has changed its value.
property | The property with a new value. |
value | The new value. |
Definition at line 441 of file PropertyDialog.cpp.
|
protected |
A container for the buttons.
Definition at line 228 of file PropertyDialog.h.
|
protected |
A horizontal layout.
Definition at line 226 of file PropertyDialog.h.
|
protected |
Top level properties.
Definition at line 248 of file PropertyDialog.h.
|
protected |
Tabs with their names.
Definition at line 250 of file PropertyDialog.h.
|
protected |
The callback instance associated with this instance.
Definition at line 245 of file PropertyDialog.h.
|
protected |
A scroll area for the property editors.
Definition at line 234 of file PropertyDialog.h.
|
protected |
An indicator for the tabbed view.
Definition at line 252 of file PropertyDialog.h.
|
protected |
A tab widget handling the tabbed view.
Definition at line 232 of file PropertyDialog.h.
|
protected |
The button property browser.
Definition at line 243 of file PropertyDialog.h.
|
protected |
The tree property browser.
Definition at line 241 of file PropertyDialog.h.
|
protected |
The factory for the properties.
Definition at line 237 of file PropertyDialog.h.
|
protected |
The manager of the properties.
Definition at line 239 of file PropertyDialog.h.
|
protected |
A vertical layout.
Definition at line 224 of file PropertyDialog.h.
|
protected |
A button that toggles the view mode.
Definition at line 230 of file PropertyDialog.h.
|
protected |
The view mode of the dialog.
Definition at line 254 of file PropertyDialog.h.