-
Notifications
You must be signed in to change notification settings - Fork 1
/
QColorMatrixStackView.h
58 lines (50 loc) · 1.55 KB
/
QColorMatrixStackView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef Q_COLOR_MATRIX_STACK_VIEW_H
#define Q_COLOR_MATRIX_STACK_VIEW_H
#include <vector>
#include <QAction>
#include <QBoxLayout>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QTabBar>
#include <QToolBar>
#include "QColorMatrixView.h"
class QColorMatrixStackView: public QWidget {
Q_OBJECT
private:
QString _qAppDir;
std::vector<ColorMatrix> _mats;
ColorMatrix _matProd;
int _iTabNew;
QGridLayout _qGrid;
QTabBar _qTabBar;
QToolBar _qToolBar;
QHBoxLayout _qHBox;
QAction _qCmdLeft, _qCmdRight;
QLabel _qLblName;
QLineEdit _qEditName;
QAction _qCmdDelete;
QColorMatrixView _qEditColMat;
signals:
void editingFinished();
public:
QColorMatrixStackView(QWidget *pQParent = nullptr);
virtual ~QColorMatrixStackView() = default;
QColorMatrixStackView(const QColorMatrixStackView&) = delete;
QColorMatrixStackView& operator=(const QColorMatrixStackView&) = delete;
const std::vector<ColorMatrix>& allValues() const { return _mats; }
const ColorMatrix& values() const { return _matProd; }
void setValues(const ColorMatrix &values);
void setValues(const ColorMatrix &values, const QString &text);
void pushLeft();
void pushRight();
void deleteValues();
private:
void updateEnable();
void onTabBarChanged(int i);
void onTabBarClicked(int i);
void onTabMoved(int iOld, int iNew);
void onMatEditFinished();
void onNameEditFinished();
};
#endif // Q_COLOR_MATRIX_STACK_VIEW_H