My Project  0.0.16
QUCS Mapping
 All Classes Namespaces 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.h>
24 #include "vtabglobal.h"
25 
31 class VTab : public QPushButton,public VTabInterface
32 {
33  Q_OBJECT
34 
35 public:
36  VTab(VTabPosition pos = TabLeft,int p_id = -1,QWidget *parent=0l,const char* name=0l);
37  VTabPosition position() const { return m_position; }
38  int id() const;
39 
40  virtual QSize sizeHint() const;
41  virtual void setText(const QString &s);
42 
43  virtual ~VTab();
44 
45 public slots:
46  void setID(int p_id);
47  void setPosition(VTabPosition p_pos);
48 
49 signals:
50  void toggled(int p_id,bool p_state);// internal signal
51 
52 private:
53  VTabPosition m_position;
54  int m_id;
55 
56  virtual void drawButton(QPainter *p);
57  void init();
58 
59 private slots:
60  void slotToggled(bool b);
61 };
62 
63 /*inline VTabPosition VTab::position() const
64 {
65  return m_position;
66 }*/
67 
68 inline int VTab::id() const
69 {
70  return m_id;
71 }
72 
73 #endif