Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtabbutton.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2006 by Gopala Krishna A <krishna.ggk@gmail.com> *
3  * *
4  * This is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2, or (at your option) *
7  * any later version. *
8  * *
9  * This software is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this package; see the file COPYING. If not, write to *
16  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, *
17  * Boston, MA 02110-1301, USA. *
18  ***************************************************************************/
19 
20 #ifndef VERTICALTABBUTTON_H
21 #define VERTICALTABBUTTON_H
22 
23 #include <QPushButton>
24 #include <QStyleOptionButton>
25 #include "vtabglobal.h"
26 
32 class VTab : public QPushButton,public VTabInterface
33 {
34  Q_OBJECT
35 
36 public:
37  VTab(VTabPosition pos = TabLeft,int p_id = -1,QWidget *parent=0l,const char* name=0l);
38  VTabPosition position() const { return m_position; }
39  int id() const;
40 
41  virtual QSize sizeHint() const;
42  virtual void setText(const QString &s);
43 
44  virtual ~VTab();
45 
46 public slots:
47  void setID(int p_id);
48  void setPosition(VTabPosition p_pos);
49 
50 signals:
51  void toggled(int p_id,bool p_state);// internal signal
52 protected:
53  void paintEvent(QPaintEvent* event);
54 
55 private:
56  QStyleOptionButton getStyleOption() const;
58  int m_id;
59 
60  virtual void drawButton(QPainter *p);
61  void init();
62 
63 private slots:
64  void slotToggled(bool b);
65 };
66 
67 /*inline VTabPosition VTab::position() const
68 {
69  return m_position;
70 }*/
71 
72 inline int VTab::id() const
73 {
74  return m_id;
75 }
76 
77 #endif
QStyleOptionButton getStyleOption() const
Definition: vtabbutton.cpp:133
void slotToggled(bool b)
Definition: vtabbutton.cpp:115
virtual QSize sizeHint() const
Definition: vtabbutton.cpp:62
void setID(int p_id)
Definition: vtabbutton.cpp:47
virtual void setText(const QString &s)
Definition: vtabbutton.cpp:106
void paintEvent(QPaintEvent *event)
Definition: vtabbutton.cpp:120
void setPosition(VTabPosition p_pos)
Definition: vtabbutton.cpp:52
int id() const
Definition: vtabbutton.h:72
VTabPosition position() const
Definition: vtabbutton.h:38
virtual ~VTab()
Definition: vtabbutton.cpp:44
VTab(VTabPosition pos=TabLeft, int p_id=-1, QWidget *parent=0l, const char *name=0l)
Definition: vtabbutton.cpp:28
int m_id
Definition: vtabbutton.h:58
VTabPosition m_position
Definition: vtabbutton.h:57
void init()
Definition: vtabbutton.cpp:35
virtual void drawButton(QPainter *p)
Definition: vtabbutton.cpp:79
void toggled(int p_id, bool p_state)