Isis 3 Programmer Reference
Tab.cpp
1#include "Tab.h"
2
3//#include <iostream>
4
5#include <QWidget>
6#include <QStylePainter>
7
8#include "IException.h"
9#include "IString.h"
10
11
12namespace Isis
13{
14
16 Tab::Tab(QWidget * associatedWidget, QWidget * parent) : QAction(parent)
17 {
18 this->associatedWidget = associatedWidget;
19
20 position = 0;
21 radioGroup = 0;
22 selectedStatus = false;
23
24 setCheckable(true);
25
26 connect(this, SIGNAL(triggered()), this, SLOT(handleTriggered()));
27 }
28
29
32 {
33 associatedWidget = NULL;
34 }
35
36
38 void Tab::setPosition(const int & newPosition)
39 {
40 position = newPosition;
41 }
42
43
45 const int & Tab::getPosition() const
46 {
47 return position;
48 }
49
50
57 void Tab::setRadioGroup(const int & newRadioGroup)
58 {
59 radioGroup = newRadioGroup;
60 }
61
62
69 const int & Tab::getRadioGroup() const
70 {
71 return radioGroup;
72 }
73
74
82 void Tab::setSelected(bool newStatus)
83 {
84 if (associatedWidget == NULL)
85 {
86 QString msg = "Tab::setSelected called but can't show or hide the "
87 "associatedWidget because it is NULL!";
89 _FILEINFO_);
90 }
91 setChecked(newStatus);
92 newStatus ? associatedWidget->show() : associatedWidget->hide();
93 selectedStatus = newStatus;
94 }
95
96
105 {
106 return selectedStatus;
107 }
108
109
117 {
118 emit clicked(position);
119 }
120
121}
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
void handleTriggered()
This SLOT is executed when the Tab is clicked, and emits its own clicked SIGNAL (which contains its i...
Definition Tab.cpp:116
bool isSelected()
A selected Tab will look visually pressed and have its associatedWidget visible.
Definition Tab.cpp:104
const int & getRadioGroup() const
Tabs which share a radio group have the property that only only one Tab in the group can be selected ...
Definition Tab.cpp:69
const int & getPosition() const
get the position of the Tab within a TabBar
Definition Tab.cpp:45
void setSelected(bool newStatus)
A selected Tab will look visually pressed and have its associatedWidget visible.
Definition Tab.cpp:82
void setRadioGroup(const int &newRadioGroup)
Tabs which share a radio group have the property that only only one Tab in the group can be selected ...
Definition Tab.cpp:57
void setPosition(const int &newPosition)
set the position of the Tab within a TabBar
Definition Tab.cpp:38
Tab(QWidget *associatedWidget, QWidget *parent=0)
constructs a Tab
Definition Tab.cpp:16
virtual ~Tab()
destructs a Tab
Definition Tab.cpp:31
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16