SpectraPac 2.0(r200)
Evaluates PAC Measurements
|
00001 /* --------------------------------------------------------------------------- 00002 ** This software is in the public domain, furnished "as is", without technical 00003 ** support, and with no warranty, express or implied, as to its usefulness for 00004 ** any purpose. 00005 ** 00006 ** orientationbutton.h 00007 ** This is an extended version of Qt's QPushButton. In addition to 00008 ** QPushButton's functionality, this button's orientation can be changed 00009 ** to vertical and the button can also be mirrored. 00010 ** 00011 ** Author: J-P Nurmi 00012 ** Date: 23th September 2006 00013 ** -------------------------------------------------------------------------*/ 00014 #ifndef ORIENTATIONBUTTON_H 00015 #define ORIENTATIONBUTTON_H 00016 00017 #include <QPushButton> 00018 #include <QStyleOptionButton> 00019 00020 class OrientationButton : public QPushButton 00021 { 00022 public: 00023 OrientationButton(QWidget* parent = 0); 00024 OrientationButton(const QString& text, QWidget* parent = 0); 00025 OrientationButton(const QIcon& icon, const QString& text, QWidget* parent = 0); 00026 ~OrientationButton(); 00027 00028 Qt::Orientation orientation() const; 00029 void setOrientation(Qt::Orientation orientation); 00030 00031 bool mirrored() const; 00032 void setMirrored(bool mirrored); 00033 00034 QSize sizeHint() const; 00035 QSize minimumSizeHint() const; 00036 00037 protected: 00038 void paintEvent(QPaintEvent* event); 00039 00040 private: 00041 QStyleOptionButton getStyleOption() const; 00042 void init(); 00043 00044 Qt::Orientation orientation_; 00045 bool mirrored_; 00046 }; 00047 00048 #endif // ORIENTATIONBUTTON_H