Isis 3 Programmer Reference
Isis::Tab Class Reference

A Tab is a QAction which shows or hides some other QWidget, which we call associatedWidget. More...

#include <Tab.h>

Inheritance diagram for Isis::Tab:
Inheritance graph
Collaboration diagram for Isis::Tab:
Collaboration graph

Signals

void clicked (const int &)
 

Public Member Functions

 Tab (QWidget *associatedWidget, QWidget *parent=0)
 constructs a Tab
 
virtual ~Tab ()
 destructs a Tab
 
void setPosition (const int &newPosition)
 set the position of the Tab within a TabBar
 
const int & getPosition () const
 get the position of the Tab within a TabBar
 
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 at a time.
 
const int & getRadioGroup () const
 Tabs which share a radio group have the property that only only one Tab in the group can be selected at a time.
 
void setSelected (bool newStatus)
 A selected Tab will look visually pressed and have its associatedWidget visible.
 
bool isSelected ()
 A selected Tab will look visually pressed and have its associatedWidget visible.
 

Private Slots

void handleTriggered ()
 This SLOT is executed when the Tab is clicked, and emits its own clicked SIGNAL (which contains its index) to the TabBar.
 

Private Member Functions

 Tab (const Tab &other)
 
const Taboperator= (Tab)
 

Private Attributes

QWidgetassociatedWidget
 
int position
 
int radioGroup
 
int location
 
bool selectedStatus
 

Detailed Description

A Tab is a QAction which shows or hides some other QWidget, which we call associatedWidget.

The Tab does not own this widget, it just stores a pointer so that it can set the widget to be visible or invisible. Tabs are toggleable. If a Tab is down then its associatedWidget is visible If a Tab is up then its associatedWidget is invisible. Tabs are designed to be added to TabBars, which are special QToolBars that can handle the management and storing of Tabs. Tabs have a "radioGroup" to which they belong, which is just an int. Tabs in the same TabBar which have the same radioGroup number have the property such that only one of the Tabs can be selected at a time. Note that the radioGroup value is only used if the TabBar for which the Tab resides has a radioStyle() of true, which is false by default. See TabBar for more details about radioStyle.

Author
2010-05-06 Eric Hyer
History

2010-05-06 Eric Hyer - Original Version

2010-09-23 Eric Hyer - Parent class now QAction, not QToolButton

  • Fixed namespace issue

Definition at line 41 of file Tab.h.

Constructor & Destructor Documentation

◆ Tab()

Isis::Tab::Tab ( QWidget * associatedWidget,
QWidget * parent = 0 )

constructs a Tab

Definition at line 16 of file Tab.cpp.

References handleTriggered().

◆ ~Tab()

Isis::Tab::~Tab ( )
virtual

destructs a Tab

Definition at line 31 of file Tab.cpp.

Member Function Documentation

◆ getPosition()

const int & Isis::Tab::getPosition ( ) const

get the position of the Tab within a TabBar

Definition at line 45 of file Tab.cpp.

◆ getRadioGroup()

const int & Isis::Tab::getRadioGroup ( ) const

Tabs which share a radio group have the property that only only one Tab in the group can be selected at a time.

Returns
The radio group which this Tab belongs to

Definition at line 69 of file Tab.cpp.

◆ handleTriggered

void Isis::Tab::handleTriggered ( )
privateslot

This SLOT is executed when the Tab is clicked, and emits its own clicked SIGNAL (which contains its index) to the TabBar.

The TabBar can then use this index to determine which Tab was clicked (TabBars store their Tabs in a QVector).

Definition at line 116 of file Tab.cpp.

Referenced by Tab().

◆ isSelected()

bool Isis::Tab::isSelected ( )

A selected Tab will look visually pressed and have its associatedWidget visible.

A Tab which is not selected will look like a normal button and its associatedWidget will be hidden.

Returns
True if the Tab is selected, false otherwise

Definition at line 104 of file Tab.cpp.

◆ setPosition()

void Isis::Tab::setPosition ( const int & newPosition)

set the position of the Tab within a TabBar

Definition at line 38 of file Tab.cpp.

◆ setRadioGroup()

void Isis::Tab::setRadioGroup ( const int & newRadioGroup)

Tabs which share a radio group have the property that only only one Tab in the group can be selected at a time.

Parameters
newRadioGroupThe new radio group to which the Tab should belong

Definition at line 57 of file Tab.cpp.

◆ setSelected()

void Isis::Tab::setSelected ( bool newStatus)

A selected Tab will look visually pressed and have its associatedWidget visible.

A Tab which is not selected will look like a normal button and its associatedWidget will be hidden.

Parameters
newStatusTrue if the Tab should be selected, false otherwise

Definition at line 82 of file Tab.cpp.

References Isis::IException::Programmer.

Member Data Documentation

◆ associatedWidget

QWidget* Isis::Tab::associatedWidget
private

Definition at line 70 of file Tab.h.

◆ location

int Isis::Tab::location
private

Definition at line 73 of file Tab.h.

◆ position

int Isis::Tab::position
private

Definition at line 71 of file Tab.h.

◆ radioGroup

int Isis::Tab::radioGroup
private

Definition at line 72 of file Tab.h.

◆ selectedStatus

bool Isis::Tab::selectedStatus
private

Definition at line 74 of file Tab.h.


The documentation for this class was generated from the following files: