ContourLinesEditor.h
Go to the documentation of this file.
/***************************************************************************
File : ContourLinesEditor.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2009 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : A Contour Lines Editor Widget
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef CONTOURLINESEDITOR_H
#define CONTOURLINESEDITOR_H
#include <QWidget>
#include <QLocale>
class QPushButton;
class QTableWidget;
class QCheckBox;
class DoubleSpinBox;
class Spectrogram;
class ColorButton;
class PenStyleBox;
class ContourLinesEditor: public QWidget
{
Q_OBJECT
public:
ContourLinesEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0);
~ContourLinesEditor();
void setSpectrogram(Spectrogram *sp);
void updateContourLevels();
void updateContourPens();
void updateContents();
void showPenColumn(bool on = true);
protected slots:
void enableButtons(int row);
void showPenDialog(int row, int col);
void insertLevel();
void deleteLevel();
void spinBoxActivated(DoubleSpinBox *);
void updatePen();
bool eventFilter(QObject *object, QEvent *e);
private:
void updatePenColumn();
QTableWidget *table;
QPushButton *insertBtn, *deleteBtn;
Spectrogram *d_spectrogram;
QLocale d_locale;
int d_precision;
QDialog *penDialog;
ColorButton *penColorBox;
PenStyleBox *penStyleBox;
DoubleSpinBox *penWidthBox;
QCheckBox *applyAllColorBox, *applyAllWidthBox, *applyAllStyleBox;
int d_pen_index;
QList<QPen> d_pen_list;
};
#endif
ContourLinesEditor::ContourLinesEditor
ContourLinesEditor(const QLocale &locale=QLocale::system(), int precision=6, QWidget *parent=0)
Constructor.
Definition: ContourLinesEditor.cpp:46
ContourLinesEditor::deleteBtn
QPushButton * deleteBtn
Definition: ContourLinesEditor.h:84
ContourLinesEditor::deleteLevel
void deleteLevel()
Definition: ContourLinesEditor.cpp:220
ContourLinesEditor
A complex widget allowing to customize contour line plots.
Definition: ContourLinesEditor.h:49
ContourLinesEditor::applyAllWidthBox
QCheckBox * applyAllWidthBox
Definition: ContourLinesEditor.h:96
ContourLinesEditor::updatePen
void updatePen()
Definition: ContourLinesEditor.cpp:316
ContourLinesEditor::penColorBox
ColorButton * penColorBox
Definition: ContourLinesEditor.h:93
ContourLinesEditor::insertLevel
void insertLevel()
Definition: ContourLinesEditor.cpp:166
ContourLinesEditor::spinBoxActivated
void spinBoxActivated(DoubleSpinBox *)
Definition: ContourLinesEditor.cpp:384
ContourLinesEditor::setSpectrogram
void setSpectrogram(Spectrogram *sp)
Use this function to initialize the values.
Definition: ContourLinesEditor.cpp:112
ColorButton
A customized QtColorPicker used for color selection.
Definition: ColorButton.h:39
ContourLinesEditor::showPenColumn
void showPenColumn(bool on=true)
Definition: ContourLinesEditor.cpp:400
ContourLinesEditor::eventFilter
bool eventFilter(QObject *object, QEvent *e)
Definition: ContourLinesEditor.cpp:350
ContourLinesEditor::updatePenColumn
void updatePenColumn()
Definition: ContourLinesEditor.cpp:294
ContourLinesEditor::penStyleBox
PenStyleBox * penStyleBox
Definition: ContourLinesEditor.h:94
Spectrogram
Definition: Spectrogram.h:46
ContourLinesEditor::enableButtons
void enableButtons(int row)
Definition: ContourLinesEditor.cpp:375
DoubleSpinBox
A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.
Definition: DoubleSpinBox.h:39
ContourLinesEditor::d_pen_list
QList< QPen > d_pen_list
Definition: ContourLinesEditor.h:99
ContourLinesEditor::~ContourLinesEditor
~ContourLinesEditor()
Definition: ContourLinesEditor.cpp:408
ContourLinesEditor::applyAllStyleBox
QCheckBox * applyAllStyleBox
Definition: ContourLinesEditor.h:96
ContourLinesEditor::insertBtn
QPushButton * insertBtn
Definition: ContourLinesEditor.h:84
ContourLinesEditor::updateContourPens
void updateContourPens()
Definition: ContourLinesEditor.cpp:103
ContourLinesEditor::d_spectrogram
Spectrogram * d_spectrogram
Definition: ContourLinesEditor.h:85
ContourLinesEditor::showPenDialog
void showPenDialog(int row, int col)
Definition: ContourLinesEditor.cpp:229
ContourLinesEditor::updateContents
void updateContents()
Updates cell items when spectrogram contour lines changed.
Definition: ContourLinesEditor.cpp:121
ContourLinesEditor::table
QTableWidget * table
Table displaying the values ranges in the first column and their corresponding pens in the second col...
Definition: ContourLinesEditor.h:83
ContourLinesEditor::d_precision
int d_precision
Precision used to display level values.
Definition: ContourLinesEditor.h:90
ContourLinesEditor::updateContourLevels
void updateContourLevels()
Updates levels in the target spectrogram and replots it.
Definition: ContourLinesEditor.cpp:90
ContourLinesEditor::penDialog
QDialog * penDialog
Definition: ContourLinesEditor.h:92
ContourLinesEditor::penWidthBox
DoubleSpinBox * penWidthBox
Definition: ContourLinesEditor.h:95
ContourLinesEditor::applyAllColorBox
QCheckBox * applyAllColorBox
Definition: ContourLinesEditor.h:96
ContourLinesEditor::d_pen_index
int d_pen_index
Definition: ContourLinesEditor.h:98
ContourLinesEditor::d_locale
QLocale d_locale
Locale settings used to display level values.
Definition: ContourLinesEditor.h:88
PenStyleBox
A modified QComboBox allowing to choose a Qt::PenStyle.
Definition: PenStyleBox.h:38