Computer Assited Medical Intervention Tool Kit
version 4.1
|
The description of this class will come soon ! More...
#include <qttreepropertybrowser.h>
Inherits QtAbstractPropertyBrowser.
Public Types | |
enum | ResizeMode { Interactive, Stretch, Fixed, ResizeToContents } |
Signals | |
void | collapsed (QtBrowserItem *item) |
void | expanded (QtBrowserItem *item) |
Signals inherited from QtAbstractPropertyBrowser | |
void | currentItemChanged (QtBrowserItem *) |
Protected Member Functions | |
void | itemChanged (QtBrowserItem *item) override |
void | itemInserted (QtBrowserItem *item, QtBrowserItem *afterItem) override |
void | itemRemoved (QtBrowserItem *item) override |
Protected Member Functions inherited from QtAbstractPropertyBrowser | |
virtual QWidget * | createEditor (QtProperty *property, QWidget *parent) |
Properties | |
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... | |
int | indentation |
indentation of the items in the tree view. More... | |
bool | propertiesWithoutValueMarked |
whether to enable or disable marking properties without value. More... | |
ResizeMode | resizeMode |
the resize mode of setions in the header. More... | |
bool | rootIsDecorated |
whether to show controls for expanding and collapsing root items. More... | |
int | splitterPosition |
the position of the splitter between the colunms. More... | |
Private Member Functions | |
Q_PRIVATE_SLOT (d_func(), void slotCollapsed(const QModelIndex &)) Q_PRIVATE_SLOT(d_func() | |
void void | slotCurrentBrowserItemChanged (QtBrowserItem *)) Q_PRIVATE_SLOT(d_func() |
void | slotExpanded (const QModelIndex &)) Q_PRIVATE_SLOT(d_func() |
Private Attributes | |
QtTreePropertyBrowserPrivate * | d_ptr |
Additional Inherited Members | |
Public Slots inherited from QtAbstractPropertyBrowser | |
QtBrowserItem * | addProperty (QtProperty *property) |
QtBrowserItem * | insertProperty (QtProperty *property, QtProperty *afterProperty) |
void | removeProperty (QtProperty *property) |
The description of this class will come soon !
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.
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.
Enumerator | |
---|---|
Interactive | |
Stretch | |
Fixed | |
ResizeToContents |
QtTreePropertyBrowser::QtTreePropertyBrowser | ( | QWidget * | parent = nullptr | ) |
Creates a property browser with the given parent.
References QtAbstractPropertyBrowser::currentItemChanged(), d_ptr, QtTreePropertyBrowserPrivate::init(), QtTreePropertyBrowserPrivate::q_ptr, and slotCurrentBrowserItemChanged().
|
override |
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.
References d_ptr, indentation(), and QtTreePropertyBrowserPrivate::m_treeWidget.
bool QtTreePropertyBrowser::alternatingRowColors | ( | ) | const |
Referenced by setRootIsDecorated().
QColor QtTreePropertyBrowser::backgroundColor | ( | QtBrowserItem * | item | ) | const |
Returns the item's color. If there is no color set for item it returns invalid color.
References d_ptr, and QtTreePropertyBrowserPrivate::m_indexToBackgroundColor.
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.
References QtTreePropertyBrowserPrivate::calculatedBackgroundColor(), and d_ptr.
|
signal |
This signal is emitted when the item is collapsed.
void QtTreePropertyBrowser::editItem | ( | QtBrowserItem * | item | ) |
Sets the current item to item and opens the relevant editor for it.
References d_ptr, and QtTreePropertyBrowserPrivate::editItem().
|
signal |
This signal is emitted when the item is expanded.
int QtTreePropertyBrowser::indentation | ( | ) | const |
Referenced by ~QtTreePropertyBrowser().
bool QtTreePropertyBrowser::isExpanded | ( | QtBrowserItem * | item | ) | const |
Returns true if the item is expanded; otherwise returns false.
References d_ptr, and QtTreePropertyBrowserPrivate::m_indexToItem.
Referenced by MainWindow::updateExpandState().
bool QtTreePropertyBrowser::isHeaderVisible | ( | ) | const |
References d_ptr, and QtTreePropertyBrowserPrivate::m_headerVisible.
bool QtTreePropertyBrowser::isItemVisible | ( | QtBrowserItem * | item | ) | const |
Returns true if the item is visible; otherwise returns false.
References d_ptr, and QtTreePropertyBrowserPrivate::m_indexToItem.
|
overrideprotectedvirtual |
Implements QtAbstractPropertyBrowser.
References d_ptr, and QtTreePropertyBrowserPrivate::propertyChanged().
|
overrideprotectedvirtual |
Implements QtAbstractPropertyBrowser.
References d_ptr, and QtTreePropertyBrowserPrivate::propertyInserted().
|
overrideprotectedvirtual |
Implements QtAbstractPropertyBrowser.
References d_ptr, and QtTreePropertyBrowserPrivate::propertyRemoved().
bool QtTreePropertyBrowser::propertiesWithoutValueMarked | ( | ) | const |
Referenced by setPropertiesWithoutValueMarked().
|
private |
ResizeMode QtTreePropertyBrowser::resizeMode | ( | ) | const |
Referenced by setHeaderVisible().
bool QtTreePropertyBrowser::rootIsDecorated | ( | ) | const |
Referenced by setIndentation().
void QtTreePropertyBrowser::setAlternatingRowColors | ( | bool | enable | ) |
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)
References d_ptr, QtTreePropertyBrowserPrivate::m_indexToBackgroundColor, QtTreePropertyBrowserPrivate::m_indexToItem, and QtTreePropertyBrowserPrivate::m_treeWidget.
void QtTreePropertyBrowser::setExpanded | ( | QtBrowserItem * | item, |
bool | expanded | ||
) |
Sets the item to either collapse or expanded, depending on the value of expanded.
References d_ptr, and QtTreePropertyBrowserPrivate::m_indexToItem.
Referenced by MainWindow::addProperty().
void QtTreePropertyBrowser::setHeaderVisible | ( | bool | visible | ) |
void QtTreePropertyBrowser::setIndentation | ( | int | i | ) |
References d_ptr, QtTreePropertyBrowserPrivate::m_treeWidget, and rootIsDecorated().
void QtTreePropertyBrowser::setItemVisible | ( | QtBrowserItem * | item, |
bool | visible | ||
) |
Sets the item to be visible, depending on the value of visible.
References d_ptr, and QtTreePropertyBrowserPrivate::m_indexToItem.
void QtTreePropertyBrowser::setPropertiesWithoutValueMarked | ( | bool | mark | ) |
void QtTreePropertyBrowser::setResizeMode | ( | QtTreePropertyBrowser::ResizeMode | mode | ) |
void QtTreePropertyBrowser::setRootIsDecorated | ( | bool | show | ) |
void QtTreePropertyBrowser::setSplitterPosition | ( | int | position | ) |
References d_ptr, and QtTreePropertyBrowserPrivate::m_treeWidget.
|
private |
Referenced by QtTreePropertyBrowser().
|
private |
int QtTreePropertyBrowser::splitterPosition | ( | ) | const |
Referenced by setResizeMode().
|
private |
Referenced by backgroundColor(), calculatedBackgroundColor(), editItem(), isExpanded(), isHeaderVisible(), isItemVisible(), itemChanged(), itemInserted(), itemRemoved(), QtTreePropertyBrowser(), setAlternatingRowColors(), setBackgroundColor(), setExpanded(), setHeaderVisible(), setIndentation(), setItemVisible(), setPropertiesWithoutValueMarked(), setResizeMode(), setRootIsDecorated(), setSplitterPosition(), and ~QtTreePropertyBrowser().
|
readwrite |
whether to draw the background using alternating colors. By default this property is set to true.
|
readwrite |
whether to show the header.
|
readwrite |
indentation of the items in the tree view.
|
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.
|
readwrite |
the resize mode of setions in the header.
|
readwrite |
whether to show controls for expanding and collapsing root items.
|
readwrite |
the position of the splitter between the colunms.