Olive
ui
colorbutton.h
1
#ifndef COLORBUTTON_H
2
#define COLORBUTTON_H
3
4
#include <QPushButton>
5
#include <QColor>
6
#include <QUndoCommand>
7
8
class
ColorButton
:
public
QPushButton {
9
Q_OBJECT
10
public
:
11
ColorButton
(QWidget* parent = 0);
12
QColor get_color();
13
void
set_color(QColor c);
14
const
QColor& getPreviousValue();
15
private
:
16
QColor color;
17
QColor previousColor;
18
void
set_button_color();
19
signals:
20
void
color_changed();
21
private
slots:
22
void
open_dialog();
23
};
24
25
class
ColorCommand
:
public
QUndoCommand {
26
public
:
27
ColorCommand
(
ColorButton
* s, QColor o, QColor n);
28
void
undo();
29
void
redo();
30
private
:
31
ColorButton
* sender;
32
QColor old_color;
33
QColor new_color;
34
};
35
36
#endif // COLORBUTTON_H
ColorCommand
Definition:
colorbutton.h:25
ColorButton
Definition:
colorbutton.h:8
Generated by
1.8.15