implement Toggle class from scratch
This commit is contained in:
parent
0b393ced08
commit
608c7defa5
|
@ -1,5 +1,22 @@
|
|||
#include "toggle.h"
|
||||
|
||||
Toggle::Toggle(QWidget *parent)
|
||||
: QAbstractButton(parent)
|
||||
{
|
||||
}
|
||||
|
||||
Toggle::~Toggle()
|
||||
{
|
||||
}
|
||||
|
||||
void Toggle::setOrientation(Qt::Orientation orientation)
|
||||
{
|
||||
}
|
||||
|
||||
void Toggle::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
}
|
||||
|
||||
//#include <QAbstractButton>
|
||||
//#include <QPropertyAnimation>
|
||||
//#include <QMouseEvent>
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
#ifndef TOGGLE_H
|
||||
#define TOGGLE_H
|
||||
|
||||
#include <QAbstractButton>
|
||||
|
||||
class Toggle : public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Toggle(QWidget *parent = 0);
|
||||
~Toggle();
|
||||
|
||||
void setOrientation(Qt::Orientation orientation) Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // TOGGLE_H
|
||||
|
||||
//#ifndef TOGGLE_H
|
||||
|
|
Loading…
Reference in New Issue