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