Image Component Library (ICL)
TabHandle.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLQt/src/ICLQt/TabHandle.h **
10 ** Module : ICLQt **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLQt/GUIHandle.h>
35 #include <ICLQt/ContainerHandle.h>
36 #include <QTabWidget>
37 #include <QLayout>
38 
39 namespace icl{
40  namespace qt{
41 
43  class TabHandle : public GUIHandle<QTabWidget>, public ContainerHandle{
44  public:
46  TabHandle(): GUIHandle<QTabWidget>(){}
47 
49  TabHandle(QTabWidget *w, GUIWidget *guiw):GUIHandle<QTabWidget>(w,guiw){}
50 
52  virtual void add(QWidget *comp, const QString &tabName){
53  (**this)->addTab(comp,tabName);
54  }
55 
57  virtual void insert(int idx, QWidget *comp, const QString &tabName){
58  (**this)->insertTab(idx,comp,tabName);
59  }
60 
62  inline int current() {
63  return (**this)->currentIndex();
64  }
65 
67  inline int num() {
68  return (**this)->count();
69  }
70  };
71  } // namespace qt
72 }
73 
A Handle for TabWidget container GUI components.
Definition: TabHandle.h:43
undocument this line if you encounter any issues!
Definition: Any.h:37
virtual void add(QWidget *comp, const QString &tabName)
adds an external compnent to the tab widget
Definition: TabHandle.h:52
Abstract base class for Handle classes.
Definition: GUIHandle.h:40
TabHandle(QTabWidget *w, GUIWidget *guiw)
create a difined handle
Definition: TabHandle.h:49
int current()
returns the currently selected index
Definition: TabHandle.h:62
TabHandle()
create an empty handle
Definition: TabHandle.h:46
Abstract class for GUI components.
Definition: GUIWidget.h:52
int num()
returns the number of tabs of this tab-widget
Definition: TabHandle.h:67
virtual void insert(int idx, QWidget *comp, const QString &tabName)
inserts a widget at givel location
Definition: TabHandle.h:57
Base class for Container like GUI handles as Box- or Tab widgets.
Definition: ContainerHandle.h:40