QtiPlot 0.9.8.2
|
A complex widget allowing to customize a QwtLinearColorMap. More...
#include <ColorMapEditor.h>
Signals | |
void | scalingChanged () |
Public Member Functions | |
QwtLinearColorMap | colorMap () |
Returns the customized color map. | |
ColorMapEditor (const QLocale &locale=QLocale::system(), int precision=6, QWidget *parent=0) | |
Constructor. | |
void | setColorMap (const QwtLinearColorMap &map) |
Use this function to initialize the color map to be edited. | |
void | setRange (double min, double max) |
Use this function to initialize the values range. | |
Static Public Member Functions | |
static QString | saveToXmlString (const QwtLinearColorMap &color_map) |
Exports the map to a pseudo-XML string. | |
Protected Slots | |
void | deleteLevel () |
void | enableButtons (int row) |
bool | eventFilter (QObject *object, QEvent *e) |
void | insertLevel () |
void | setScaledColors (bool scale=true) |
void | showColorDialog (int row, int col) |
void | spinBoxActivated (DoubleSpinBox *) |
void | updateColorMap () |
Private Attributes | |
QwtLinearColorMap | color_map |
Color map object. | |
QLocale | d_locale |
Locale settings used to display level values. | |
int | d_precision |
Precision used to display level values. | |
QPushButton * | deleteBtn |
QPushButton * | insertBtn |
double | max_val |
double | min_val |
Levels range. | |
QCheckBox * | scaleColorsBox |
QTableWidget * | table |
Table displaying the values ranges in the first column and their corresponding colors in the second column. |
A complex widget allowing to customize a QwtLinearColorMap.
It uses a QTableWidget to display the values in one column and their corresponding colors in a second column. A click on a table color pops-up a QColorDialog allowing to customize it.
ColorMapEditor::ColorMapEditor | ( | const QLocale & | locale = QLocale::system() , |
int | precision = 6 , |
||
QWidget * | parent = 0 |
||
) |
Constructor.
parent | parent widget (only affects placement of the widget) |
References deleteBtn, deleteLevel(), insertBtn, insertLevel(), scaleColorsBox, setScaledColors(), showColorDialog(), and table.
QwtLinearColorMap ColorMapEditor::colorMap | ( | ) | [inline] |
Returns the customized color map.
References color_map.
Referenced by PlotDialog::acceptParams(), ColorMapDialog::apply(), ConfigDialog::apply(), and Plot3DDialog::updatePlot().
void ColorMapEditor::deleteLevel | ( | ) | [protected, slot] |
References enableButtons(), table, and updateColorMap().
Referenced by ColorMapEditor().
void ColorMapEditor::enableButtons | ( | int | row | ) | [protected, slot] |
References deleteBtn, insertBtn, and table.
Referenced by deleteLevel(), insertLevel(), showColorDialog(), and spinBoxActivated().
bool ColorMapEditor::eventFilter | ( | QObject * | object, |
QEvent * | e | ||
) | [protected, slot] |
References showColorDialog(), and table.
void ColorMapEditor::insertLevel | ( | ) | [protected, slot] |
References color_map, d_locale, d_precision, enableButtons(), max_val, min_val, DoubleSpinBox::setDecimals(), DoubleSpinBox::setRange(), DoubleSpinBox::setValue(), spinBoxActivated(), table, updateColorMap(), and DoubleSpinBox::value().
Referenced by ColorMapEditor().
QString ColorMapEditor::saveToXmlString | ( | const QwtLinearColorMap & | color_map | ) | [static] |
Exports the map to a pseudo-XML string.
Referenced by Graph3D::save(), Matrix::save(), and Spectrogram::saveToString().
void ColorMapEditor::scalingChanged | ( | ) | [signal] |
Referenced by setScaledColors().
void ColorMapEditor::setColorMap | ( | const QwtLinearColorMap & | map | ) |
Use this function to initialize the color map to be edited.
References color_map, d_locale, d_precision, max_val, min_val, scaleColorsBox, DoubleSpinBox::setDecimals(), DoubleSpinBox::setRange(), DoubleSpinBox::setValue(), spinBoxActivated(), table, and updateColorMap().
Referenced by PlotDialog::acceptParams(), ConfigDialog::initPlots3DPage(), PlotDialog::setActiveCurve(), ConfigDialog::setApplication(), ColorMapDialog::setMatrix(), and Plot3DDialog::setPlot().
void ColorMapEditor::setRange | ( | double | min, |
double | max | ||
) |
Use this function to initialize the values range.
References max_val, and min_val.
Referenced by PlotDialog::setActiveCurve(), ColorMapDialog::setMatrix(), and Plot3DDialog::setPlot().
void ColorMapEditor::setScaledColors | ( | bool | scale = true | ) | [protected, slot] |
References color_map, and scalingChanged().
Referenced by ColorMapEditor(), and updateColorMap().
void ColorMapEditor::showColorDialog | ( | int | row, |
int | col | ||
) | [protected, slot] |
References enableButtons(), table, and updateColorMap().
Referenced by ColorMapEditor(), and eventFilter().
void ColorMapEditor::spinBoxActivated | ( | DoubleSpinBox * | sb | ) | [protected, slot] |
References enableButtons(), and table.
Referenced by insertLevel(), and setColorMap().
void ColorMapEditor::updateColorMap | ( | ) | [protected, slot] |
References color_map, max_val, min_val, scaleColorsBox, setScaledColors(), and table.
Referenced by deleteLevel(), insertLevel(), setColorMap(), and showColorDialog().
QwtLinearColorMap ColorMapEditor::color_map [private] |
Color map object.
Referenced by colorMap(), insertLevel(), setColorMap(), setScaledColors(), and updateColorMap().
QLocale ColorMapEditor::d_locale [private] |
Locale settings used to display level values.
Referenced by insertLevel(), and setColorMap().
int ColorMapEditor::d_precision [private] |
Precision used to display level values.
Referenced by insertLevel(), and setColorMap().
QPushButton * ColorMapEditor::deleteBtn [private] |
Referenced by ColorMapEditor(), and enableButtons().
QPushButton* ColorMapEditor::insertBtn [private] |
Referenced by ColorMapEditor(), and enableButtons().
double ColorMapEditor::max_val [private] |
Referenced by insertLevel(), setColorMap(), setRange(), and updateColorMap().
double ColorMapEditor::min_val [private] |
Levels range.
Referenced by insertLevel(), setColorMap(), setRange(), and updateColorMap().
QCheckBox* ColorMapEditor::scaleColorsBox [private] |
Referenced by ColorMapEditor(), setColorMap(), and updateColorMap().
QTableWidget* ColorMapEditor::table [private] |
Table displaying the values ranges in the first column and their corresponding colors in the second column.
Referenced by ColorMapEditor(), deleteLevel(), enableButtons(), eventFilter(), insertLevel(), setColorMap(), showColorDialog(), spinBoxActivated(), and updateColorMap().