vizkit3d
Public Types | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
QtTreePropertyBrowser Class Reference

The QtTreePropertyBrowser class provides QTreeWidget based property browser. More...

#include <qttreepropertybrowser.h>

Inheritance diagram for QtTreePropertyBrowser:
QtAbstractPropertyBrowser vizkit3d::QPropertyBrowserWidget

Public Types

enum  ResizeMode { Interactive, Stretch, Fixed, ResizeToContents }
 

Signals

void collapsed (QtBrowserItem *item)
 
void expanded (QtBrowserItem *item)
 
- Signals inherited from QtAbstractPropertyBrowser
void currentItemChanged (QtBrowserItem *)
 

Public Member Functions

 QtTreePropertyBrowser (QWidget *parent=0)
 
 ~QtTreePropertyBrowser ()
 
int indentation () const
 
void setIndentation (int i)
 
bool rootIsDecorated () const
 
void setRootIsDecorated (bool show)
 
bool alternatingRowColors () const
 
void setAlternatingRowColors (bool enable)
 
bool isHeaderVisible () const
 
void setHeaderVisible (bool visible)
 
ResizeMode resizeMode () const
 
void setResizeMode (ResizeMode mode)
 
int splitterPosition () const
 
void setSplitterPosition (int position)
 
void setExpanded (QtBrowserItem *item, bool expanded)
 
bool isExpanded (QtBrowserItem *item) const
 
bool isItemVisible (QtBrowserItem *item) const
 
void setItemVisible (QtBrowserItem *item, bool visible)
 
void setBackgroundColor (QtBrowserItem *item, const QColor &color)
 
QColor backgroundColor (QtBrowserItem *item) const
 
QColor calculatedBackgroundColor (QtBrowserItem *item) const
 
void setPropertiesWithoutValueMarked (bool mark)
 
bool propertiesWithoutValueMarked () const
 
void editItem (QtBrowserItem *item)
 
- Public Member Functions inherited from QtAbstractPropertyBrowser
 QtAbstractPropertyBrowser (QWidget *parent=0)
 
 ~QtAbstractPropertyBrowser ()
 
QList< QtProperty * > properties () const
 
QList< QtBrowserItem * > items (QtProperty *property) const
 
QtBrowserItemtopLevelItem (QtProperty *property) const
 
QList< QtBrowserItem * > topLevelItems () const
 
void clear ()
 
template<class PropertyManager >
void setFactoryForManager (PropertyManager *manager, QtAbstractEditorFactory< PropertyManager > *factory)
 
void unsetFactoryForManager (QtAbstractPropertyManager *manager)
 
QtBrowserItemcurrentItem () const
 
void setCurrentItem (QtBrowserItem *)
 

Protected Member Functions

virtual void itemInserted (QtBrowserItem *item, QtBrowserItem *afterItem)
 
virtual void itemRemoved (QtBrowserItem *item)
 
virtual void itemChanged (QtBrowserItem *item)
 
- Protected Member Functions inherited from QtAbstractPropertyBrowser
virtual QWidget * createEditor (QtProperty *property, QWidget *parent)
 

Properties

int indentation
 indentation of the items in the tree view. More...
 
bool rootIsDecorated
 whether to show controls for expanding and collapsing root items. More...
 
bool alternatingRowColors
 whether to draw the background using alternating colors. By default this property is set to true. More...
 
bool headerVisible
 whether to show the header. More...
 
ResizeMode resizeMode
 the resize mode of setions in the header. More...
 
int splitterPosition
 the position of the splitter between the colunms. More...
 
bool propertiesWithoutValueMarked
 whether to enable or disable marking properties without value. More...
 

Additional Inherited Members

- Public Slots inherited from QtAbstractPropertyBrowser
QtBrowserItemaddProperty (QtProperty *property)
 
QtBrowserIteminsertProperty (QtProperty *property, QtProperty *afterProperty)
 
void removeProperty (QtProperty *property)
 

Detailed Description

The QtTreePropertyBrowser class provides QTreeWidget based property browser.

A property browser is a widget that enables the user to edit a given set of properties. Each property is represented by a label specifying the property's name, and an editing widget (e.g. a line edit or a combobox) holding its value. A property can have zero or more subproperties.

QtTreePropertyBrowser provides a tree based view for all nested properties, i.e. properties that have subproperties can be in an expanded (subproperties are visible) or collapsed (subproperties are hidden) state. For example:

Use the QtAbstractPropertyBrowser API to add, insert and remove properties from an instance of the QtTreePropertyBrowser class. The properties themselves are created and managed by implementations of the QtAbstractPropertyManager class.

See also
QtGroupBoxPropertyBrowser, QtAbstractPropertyBrowser

Member Enumeration Documentation

◆ ResizeMode

The resize mode specifies the behavior of the header sections.

Interactive The user can resize the sections. The sections can also be resized programmatically using setSplitterPosition().

Fixed The user cannot resize the section. The section can only be resized programmatically using setSplitterPosition().

Stretch QHeaderView will automatically resize the section to fill the available space. The size cannot be changed by the user or programmatically.

ResizeToContents QHeaderView will automatically resize the section to its optimal size based on the contents of the entire column. The size cannot be changed by the user or programmatically.

See also
setResizeMode()
Enumerator
Interactive 
Stretch 
Fixed 
ResizeToContents 

Constructor & Destructor Documentation

◆ QtTreePropertyBrowser()

QtTreePropertyBrowser::QtTreePropertyBrowser ( QWidget *  parent = 0)

Creates a property browser with the given parent.

◆ ~QtTreePropertyBrowser()

QtTreePropertyBrowser::~QtTreePropertyBrowser ( )

Destroys this property browser.

Note that the properties that were inserted into this browser are not destroyed since they may still be used in other browsers. The properties are owned by the manager that created them.

See also
QtProperty, QtAbstractPropertyManager

Member Function Documentation

◆ alternatingRowColors()

bool QtTreePropertyBrowser::alternatingRowColors ( ) const

◆ backgroundColor()

QColor QtTreePropertyBrowser::backgroundColor ( QtBrowserItem item) const

Returns the item's color. If there is no color set for item it returns invalid color.

See also
calculatedBackgroundColor(), setBackgroundColor()

◆ calculatedBackgroundColor()

QColor QtTreePropertyBrowser::calculatedBackgroundColor ( QtBrowserItem item) const

Returns the item's color. If there is no color set for item it returns parent item's color (if there is no color set for parent it returns grandparent's color and so on). In case the color is not set for item and it's top level item it returns invalid color.

See also
backgroundColor(), setBackgroundColor()

◆ collapsed

void QtTreePropertyBrowser::collapsed ( QtBrowserItem item)
signal

This signal is emitted when the item is collapsed.

See also
expanded(), setExpanded()

◆ editItem()

void QtTreePropertyBrowser::editItem ( QtBrowserItem item)

Sets the current item to item and opens the relevant editor for it.

◆ expanded

void QtTreePropertyBrowser::expanded ( QtBrowserItem item)
signal

This signal is emitted when the item is expanded.

See also
collapsed(), setExpanded()

◆ indentation()

int QtTreePropertyBrowser::indentation ( ) const

◆ isExpanded()

bool QtTreePropertyBrowser::isExpanded ( QtBrowserItem item) const

Returns true if the item is expanded; otherwise returns false.

See also
setExpanded()

◆ isHeaderVisible()

bool QtTreePropertyBrowser::isHeaderVisible ( ) const

◆ isItemVisible()

bool QtTreePropertyBrowser::isItemVisible ( QtBrowserItem item) const

Returns true if the item is visible; otherwise returns false.

See also
setItemVisible()
Since
4.5

◆ itemChanged()

void QtTreePropertyBrowser::itemChanged ( QtBrowserItem item)
protectedvirtual

◆ itemInserted()

void QtTreePropertyBrowser::itemInserted ( QtBrowserItem item,
QtBrowserItem afterItem 
)
protectedvirtual

◆ itemRemoved()

void QtTreePropertyBrowser::itemRemoved ( QtBrowserItem item)
protectedvirtual

◆ propertiesWithoutValueMarked()

bool QtTreePropertyBrowser::propertiesWithoutValueMarked ( ) const

◆ resizeMode()

ResizeMode QtTreePropertyBrowser::resizeMode ( ) const

◆ rootIsDecorated()

bool QtTreePropertyBrowser::rootIsDecorated ( ) const

◆ setAlternatingRowColors()

void QtTreePropertyBrowser::setAlternatingRowColors ( bool  enable)

◆ setBackgroundColor()

void QtTreePropertyBrowser::setBackgroundColor ( QtBrowserItem item,
const QColor &  color 
)

Sets the item's background color to color. Note that while item's background is rendered every second row is being drawn with alternate color (which is a bit lighter than items color)

See also
backgroundColor(), calculatedBackgroundColor()

◆ setExpanded()

void QtTreePropertyBrowser::setExpanded ( QtBrowserItem item,
bool  expanded 
)

Sets the item to either collapse or expanded, depending on the value of expanded.

See also
isExpanded(), expanded(), collapsed()

◆ setHeaderVisible()

void QtTreePropertyBrowser::setHeaderVisible ( bool  visible)

◆ setIndentation()

void QtTreePropertyBrowser::setIndentation ( int  i)

◆ setItemVisible()

void QtTreePropertyBrowser::setItemVisible ( QtBrowserItem item,
bool  visible 
)

Sets the item to be visible, depending on the value of visible.

See also
isItemVisible()
Since
4.5

◆ setPropertiesWithoutValueMarked()

void QtTreePropertyBrowser::setPropertiesWithoutValueMarked ( bool  mark)

◆ setResizeMode()

void QtTreePropertyBrowser::setResizeMode ( QtTreePropertyBrowser::ResizeMode  mode)

◆ setRootIsDecorated()

void QtTreePropertyBrowser::setRootIsDecorated ( bool  show)

◆ setSplitterPosition()

void QtTreePropertyBrowser::setSplitterPosition ( int  position)

◆ splitterPosition()

int QtTreePropertyBrowser::splitterPosition ( ) const

Property Documentation

◆ alternatingRowColors

bool QtTreePropertyBrowser::alternatingRowColors
readwrite

whether to draw the background using alternating colors. By default this property is set to true.

◆ headerVisible

QtTreePropertyBrowser::headerVisible
readwrite

whether to show the header.

◆ indentation

int QtTreePropertyBrowser::indentation
readwrite

indentation of the items in the tree view.

◆ propertiesWithoutValueMarked

bool QtTreePropertyBrowser::propertiesWithoutValueMarked
readwrite

whether to enable or disable marking properties without value.

When marking is enabled the item's background is rendered in dark color and item's foreground is rendered with light color.

See also
propertiesWithoutValueMarked()

◆ resizeMode

QtTreePropertyBrowser::ResizeMode QtTreePropertyBrowser::resizeMode
readwrite

the resize mode of setions in the header.

◆ rootIsDecorated

bool QtTreePropertyBrowser::rootIsDecorated
readwrite

whether to show controls for expanding and collapsing root items.

◆ splitterPosition

int QtTreePropertyBrowser::splitterPosition
readwrite

the position of the splitter between the colunms.


The documentation for this class was generated from the following files: