ContourLinesEditor Class Reference

A complex widget allowing to customize contour line plots. More...

`#include <ContourLinesEditor.h>`

Inheritance diagram for ContourLinesEditor:

## Public Member Functions

| ContourLinesEditor (const QLocale &locale=QLocale::system(), int precision=6, QWidget *parent=0)
| Constructor. More...
void | setSpectrogram (Spectrogram *sp)
| Use this function to initialize the values. More...
void | showPenColumn (bool on=true)
void | updateContents ()
| Updates cell items when spectrogram contour lines changed. More...
void | updateContourLevels ()
| Updates levels in the target spectrogram and replots it. More...
void | updateContourPens ()
| ~ContourLinesEditor ()

## Protected Slots

void | deleteLevel ()
void | enableButtons (int row)
bool | eventFilter (QObject *object, QEvent *e)
void | insertLevel ()
void | showPenDialog (int row, int col)
void | spinBoxActivated (DoubleSpinBox *)
void | updatePen ()

## Private Member Functions

void | updatePenColumn ()

## Private Attributes

QCheckBox * | applyAllColorBox
QCheckBox * | applyAllStyleBox
QCheckBox * | applyAllWidthBox
QLocale | d_locale
| Locale settings used to display level values. More...
int | d_pen_index
QList< QPen > | d_pen_list
int | d_precision
| Precision used to display level values. More...
Spectrogram * | d_spectrogram
QPushButton * | deleteBtn
QPushButton * | insertBtn
ColorButton * | penColorBox
QDialog * | penDialog
PenStyleBox * | penStyleBox
DoubleSpinBox * | penWidthBox
QTableWidget * | table
| Table displaying the values ranges in the first column and their corresponding pens in the second column. More...

## Detailed Description

A complex widget allowing to customize contour line plots.

It uses a QTableWidget to display the values in one column and their corresponding pen in a second column. A click on a table color pops-up a dialog allowing to customize the pen.

## Constructor & Destructor Documentation

ContourLinesEditor::ContourLinesEditor | ( | const QLocale & | locale = `QLocale::system()`,
|  | int | precision = `6`,
|  | QWidget * | parent = `0`
| ) |  |

Constructor.

Parameters

  parent | parent widget (only affects placement of the widget)

References deleteBtn, deleteLevel(), insertBtn, insertLevel(), penDialog, showPenDialog(), and table.

ContourLinesEditor::~ContourLinesEditor | ( |  | ) |

References penDialog.

## Member Function Documentation

void ContourLinesEditor::deleteLevel | ( |  | ) |

protected slot

References d_pen_list, and table.

Referenced by ContourLinesEditor().

void ContourLinesEditor::enableButtons | ( | int | row | ) |

protected slot

References deleteBtn, and insertBtn.

Referenced by insertLevel(), showPenDialog(), and spinBoxActivated().

bool ContourLinesEditor::eventFilter | ( | QObject * | object,
|  | QEvent * | e
| ) |  |

protected slot

References showPenDialog(), and table.

void ContourLinesEditor::insertLevel | ( |  | ) |

protected slot

References Spectrogram::contourPen(), d_locale, d_pen_list, d_precision, d_spectrogram, enableButtons(), Spectrogram::range(), DoubleSpinBox::setDecimals(), DoubleSpinBox::setRange(), DoubleSpinBox::setValue(), spinBoxActivated(), table, and DoubleSpinBox::value().

Referenced by ContourLinesEditor().

void ContourLinesEditor::setSpectrogram | ( | Spectrogram * | sp | ) |

Use this function to initialize the values.

References d_spectrogram, and updateContents().

Referenced by PlotDialog::setActiveCurve().

void ContourLinesEditor::showPenColumn | ( | bool | on = `true` | ) |

References table.

Referenced by PlotDialog::showCustomPenColumn().

void ContourLinesEditor::showPenDialog | ( | int | row,
|  | int | col
| ) |  |

protected slot

References applyAllColorBox, applyAllStyleBox, applyAllWidthBox, d_pen_index, d_pen_list, d_spectrogram, enableButtons(), penColorBox, penDialog, penStyleBox, penWidthBox, ColorButton::setColor(), PenStyleBox::setStyle(), DoubleSpinBox::setValue(), and updatePen().

Referenced by ContourLinesEditor(), and eventFilter().

void ContourLinesEditor::spinBoxActivated | ( | DoubleSpinBox * | sb | ) |

protected slot

References enableButtons(), and table.

Referenced by insertLevel(), and updateContents().

void ContourLinesEditor::updateContents | ( |  | ) |

Updates cell items when spectrogram contour lines changed.

References Spectrogram::contourPen(), d_locale, d_pen_list, d_precision, d_spectrogram, Spectrogram::range(), DoubleSpinBox::setDecimals(), DoubleSpinBox::setRange(), DoubleSpinBox::setValue(), spinBoxActivated(), and table.

Referenced by PlotDialog::setEquidistantLevels(), and setSpectrogram().

void ContourLinesEditor::updateContourLevels | ( |  | ) |

Updates levels in the target spectrogram and replots it.

References d_spectrogram, Spectrogram::setContourLevels(), and table.

Referenced by PlotDialog::acceptParams().

void ContourLinesEditor::updateContourPens | ( |  | ) |

References d_pen_list, d_spectrogram, Spectrogram::setContourPenList(), and table.

Referenced by PlotDialog::acceptParams().

void ContourLinesEditor::updatePen | ( |  | ) |

protected slot

References applyAllColorBox, applyAllStyleBox, applyAllWidthBox, ColorButton::color(), d_pen_index, d_pen_list, penColorBox, penDialog, penStyleBox, penWidthBox, PenStyleBox::style(), updatePenColumn(), and DoubleSpinBox::value().

Referenced by showPenDialog().

void ContourLinesEditor::updatePenColumn | ( |  | ) |

private

References d_pen_list, and table.

Referenced by updatePen().

## Member Data Documentation

QCheckBox* ContourLinesEditor::applyAllColorBox

private

Referenced by showPenDialog(), and updatePen().

QCheckBox * ContourLinesEditor::applyAllStyleBox

private

Referenced by showPenDialog(), and updatePen().

QCheckBox * ContourLinesEditor::applyAllWidthBox

private

Referenced by showPenDialog(), and updatePen().

QLocale ContourLinesEditor::d_locale

private

Locale settings used to display level values.

Referenced by insertLevel(), and updateContents().

int ContourLinesEditor::d_pen_index

private

Referenced by showPenDialog(), and updatePen().

QList<QPen> ContourLinesEditor::d_pen_list

private

Referenced by deleteLevel(), insertLevel(), showPenDialog(), updateContents(), updateContourPens(), updatePen(), and updatePenColumn().

int ContourLinesEditor::d_precision

private

Precision used to display level values.

Referenced by insertLevel(), and updateContents().

Spectrogram* ContourLinesEditor::d_spectrogram

private

Referenced by insertLevel(), setSpectrogram(), showPenDialog(), updateContents(), updateContourLevels(), and updateContourPens().

QPushButton * ContourLinesEditor::deleteBtn

private

Referenced by ContourLinesEditor(), and enableButtons().

QPushButton* ContourLinesEditor::insertBtn

private

Referenced by ContourLinesEditor(), and enableButtons().

ColorButton* ContourLinesEditor::penColorBox

private

Referenced by showPenDialog(), and updatePen().

QDialog* ContourLinesEditor::penDialog

private

Referenced by ContourLinesEditor(), showPenDialog(), updatePen(), and ~ContourLinesEditor().

PenStyleBox* ContourLinesEditor::penStyleBox

private

Referenced by showPenDialog(), and updatePen().

DoubleSpinBox* ContourLinesEditor::penWidthBox

private

Referenced by showPenDialog(), and updatePen().

QTableWidget* ContourLinesEditor::table

private

Table displaying the values ranges in the first column and their corresponding pens in the second column.

Referenced by ContourLinesEditor(), deleteLevel(), eventFilter(), insertLevel(), showPenColumn(), spinBoxActivated(), updateContents(), updateContourLevels(), updateContourPens(), and updatePenColumn().

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

- qtiplot/src/plot2D/dialogs/ContourLinesEditor.h
- qtiplot/src/plot2D/dialogs/ContourLinesEditor.cpp