Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgSettingsCurveList.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef DLG_SETTINGS_CURVE_LIST_H
8#define DLG_SETTINGS_CURVE_LIST_H
9
11#include <QItemSelection>
12#include <QModelIndex>
13#include <QString>
14
15class ButtonWhatsThis;
16class CurveNameList;
17class QGridLayout;
18class QListView;
19class QPushButton;
20class QStandardItemModel;
21class QTableView;
22class QTextStream;
23
26{
27 Q_OBJECT;
28
29public:
32 virtual ~DlgSettingsCurveList();
33
34 virtual void createOptionalSaveDefault (QHBoxLayout *layout);
35 virtual QWidget *createSubPanel ();
37 virtual void setSmallDialogs (bool smallDialogs);
38
39public slots:
41 void slotRowsAboutToBeRemoved (const QModelIndex &parent, int rowFirst, int rowLast);
42 void slotWhatsThis();
43
44private slots:
45 void slotDataChanged (const QModelIndex &topLeft,
46 const QModelIndex &bottomRight,
47 const QVector<int> &roles);
48 void slotNew ();
49 void slotRemove ();
50 void slotResetDefault();
51 void slotSaveDefault();
52
53protected:
54 virtual void handleOk ();
55
56private:
57
58 void appendCurveName (const QString &curveNameNew,
59 const QString &curveNameOriginal,
60 int numPoints);
61 void createButtons (QGridLayout *layout, int &row);
62 void createListCurves (QGridLayout *layout, int &row);
63 bool endsWithNumber (const QString &str) const;
64 void insertCurveName (int row,
65 const QString &curveNameNew,
66 const QString &curveNameOriginal,
67 int numPoints);
68 int newRowFromSelection () const;
69 QString nextCurveName () const; // Pick good curve name to go at currentRow()
70 int numberAtEnd (const QString &str) const;
71 unsigned int numPointsForSelectedCurves () const;
72 void printStream (QTextStream &str) const; // Debugging method
73 void removeSelectedCurves();
74 void selectCurveName (const QString &curveWanted);
75 void updateControls ();
76
77 ButtonWhatsThis *m_btnWhatsThis;
78
79 CurveNameList *m_curveNameList; // Model for m_listCurves
80
81 QListView *m_listCurves; // Use QListView instead of QListWidget so validators can be used
82
83 QPushButton *m_btnAdd;
84 QPushButton *m_btnRemove;
85 QPushButton *m_btnRename;
86
87 QPushButton *m_btnResetDefault;
88 QPushButton *m_btnSaveDefault;
89
90};
91
92#endif // DLG_SETTINGS_CURVE_LIST_H
Unobtrusive button to trigger QWhatsThis since some operating systems (Linux Mint) do not show WhatsT...
Command queue stack.
Definition CmdMediator.h:24
Model for DlgSettingsCurveList and CmdSettingsCurveList.
DlgSettingsAbstractBase(const QString &title, const QString &dialogName, MainWindow &mainWindow)
Single constructor.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
MainWindow & mainWindow()
Get method for MainWindow.
DlgSettingsCurveList(MainWindow &mainWindow)
Single constructor.
void slotRowsAboutToBeRemoved(const QModelIndex &parent, int rowFirst, int rowLast)
Cleanup after rows have been removed in the model. We remove the corresponding rows in the QListView.
virtual void handleOk()
Process slotOk.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:95