Represents on line in a QTreeWidget.
Provides a combobox, and optional color/gradient selection.
A FieldTreeWidgetItem can be added to a QTreeWidget. In its first column text can be displayed, in the second column a combobox is shown with user defined entries. The context menu (right click) of the item provides color and colormap selection ( if enabled )
This class is used to configure the display options of a waLBerla::field
#include <DisplayPropertiesItem.h>
Signals | |
void | optionChanged () |
Called whenever a option has changed (combobox, color, colormap) More... | |
void | colorSelected (const QColor &newColor) |
Called when user selected a new color. More... | |
void | colormapSelected () |
Called when user selected a new colormap, use getColorFromColormap() to retrieve colormap entries. More... | |
void | comboBoxSelectionChanged (int selectedOption) |
Called when a new combobox item was selected. More... | |
Public Member Functions | |
DisplayPropertiesItem (const QStringList &comboBoxEntries, QTreeWidgetItem *parent, bool checkbox=true) | |
Constructs the item with the given combobox entries. More... | |
virtual | ~DisplayPropertiesItem () |
void | enableColorSelect (bool enable=true) |
void | enableGradientSelect (bool enable=true) |
QColor | getSelectedColor () const |
Returns currently selected color. More... | |
QColor | getColorFromColormap (double value) |
Returns a color for value between 0 and 1, according to current colormap. More... | |
void | setColor (QColor c) |
Sets the display color. More... | |
int | getComboBoxSelection () |
Returns index of selected combobox item (as passed in constructor) More... | |
bool | isEnabled () const |
True if checkbox before text is selected. More... | |
virtual void | showContextMenu (QPoint globalPos) |
Protected Member Functions | |
virtual void | showGradientSelect () |
virtual void | showColorSelect () |
void | updateColormapFromGradient () |
Protected Attributes | |
bool | gradientSelectEnabled_ |
bool | colorSelectEnabled_ |
QColor | dispColor_ |
QLinearGradient | colorMapGradient_ |
QImage | colorMap_ |
walberla::gui::DisplayPropertiesItem::DisplayPropertiesItem | ( | const QStringList & | comboBoxEntries, |
QTreeWidgetItem * | parent, | ||
bool | checkbox = true |
||
) |
Constructs the item with the given combobox entries.
parent | the parent item, must not be NULL |
|
inlinevirtual |
|
signal |
Called when user selected a new colormap, use getColorFromColormap() to retrieve colormap entries.
|
signal |
Called when user selected a new color.
|
signal |
Called when a new combobox item was selected.
|
inline |
|
inline |
QColor walberla::gui::DisplayPropertiesItem::getColorFromColormap | ( | double | value | ) |
Returns a color for value between 0 and 1, according to current colormap.
int walberla::gui::DisplayPropertiesItem::getComboBoxSelection | ( | ) |
Returns index of selected combobox item (as passed in constructor)
|
inline |
Returns currently selected color.
bool walberla::gui::DisplayPropertiesItem::isEnabled | ( | ) | const |
True if checkbox before text is selected.
|
signal |
Called whenever a option has changed (combobox, color, colormap)
void walberla::gui::DisplayPropertiesItem::setColor | ( | QColor | c | ) |
Sets the display color.
|
protectedvirtual |
|
virtual |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |