From 608c7defa5166b76b6fca3038701e4b1f82a7d10 Mon Sep 17 00:00:00 2001 From: laserpants Date: Sun, 29 May 2016 11:05:08 +0300 Subject: [PATCH] implement Toggle class from scratch --- components/toggle.cpp | 17 +++++++++++++++++ components/toggle.h | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/components/toggle.cpp b/components/toggle.cpp index d3c09ac..6576928 100644 --- a/components/toggle.cpp +++ b/components/toggle.cpp @@ -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 //#include //#include diff --git a/components/toggle.h b/components/toggle.h index 17e40a7..03b5542 100644 --- a/components/toggle.h +++ b/components/toggle.h @@ -1,6 +1,22 @@ #ifndef TOGGLE_H #define TOGGLE_H +#include + +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