changes in arhitecture, some improvments, much optimising and simplify,
many bagfixes and new graphics engine
This commit is contained in:
51
touchbuttframe.h
Normal file
51
touchbuttframe.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef TOUCHBUTTFRAME_H
|
||||
#define TOUCHBUTTFRAME_H
|
||||
|
||||
#include <QtGui/QFrame>
|
||||
#include <QHBoxLayout>
|
||||
#include <QDebug>
|
||||
#include "touch_butt.h"
|
||||
|
||||
|
||||
class TouchButtFrame : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QColor ColorYes READ colorYes WRITE setColorYes)
|
||||
Q_PROPERTY(QColor ColorNo READ colorNo WRITE setColorNo)
|
||||
Q_PROPERTY(QColor ColorDefault READ colorDefault WRITE setColorDefault)
|
||||
Q_PROPERTY(QColor ColorPush READ colorPush WRITE setColorPush)
|
||||
public:
|
||||
enum Orientation {
|
||||
Horizontal = 0,
|
||||
Vertical = 1
|
||||
};
|
||||
TouchButtFrame(QWidget * parent = 0,
|
||||
QColor red = Qt::red, QColor green = Qt::green, QColor white = Qt::white, QColor push = Qt::darkYellow,
|
||||
Orientation orientation = Vertical);
|
||||
void addButton(QString caption);
|
||||
int buttCount();
|
||||
QColor colorYes() const {return colg;}
|
||||
QColor colorNo() const {return colr;}
|
||||
QColor colorDefault() const {return colw;}
|
||||
QColor colorPush() const {return colp;}
|
||||
void setColorYes(QColor ColorYes) {colg = ColorYes; resetColors();}
|
||||
void setColorNo(QColor ColorNo) {colr = ColorNo; resetColors();}
|
||||
void setColorDefault(QColor ColorDefault) {colw = ColorDefault; resetColors();}
|
||||
void setColorPush(QColor ColorPush) {colp = ColorPush; resetColors();}
|
||||
touch_butt * Button(int index);
|
||||
public slots:
|
||||
void set_green(int index) {Button(index)->setGreen();}
|
||||
private slots:
|
||||
void butt_click(int index);
|
||||
void butt_toggle(int index, bool checked);
|
||||
private:
|
||||
QColor colr,colg,colw,colp;
|
||||
QLayout * lay;
|
||||
int count;
|
||||
void resetColors();
|
||||
signals:
|
||||
void click(int index);
|
||||
void toggle(int index, bool checked);
|
||||
};
|
||||
|
||||
#endif // TOUCHBUTTFRAME_H
|
||||
Reference in New Issue
Block a user