#include <Iguana/Studio/interface/IgQWidgetStackSite.h>
Public Slots | |
void | switchToWidget (int id) |
Public Member Functions | |
IgSite * | hostWithName (const std::string &name) |
IgQWidgetStackSite (IgState *state, IgSite *parent) | |
Static Public Member Functions | |
static const char * | catalogLabel (void) |
Protected Member Functions | |
virtual void | cascade (void) |
virtual void | host (QWidget *child) |
virtual QWidget * | host (void) |
virtual QWidget * | self (void) |
virtual void | tile (void) |
Private Attributes | |
QVBox * | m_box |
QComboBox * | m_combo |
std::map< int, int > | m_comboIndexToWidgetID |
std::string | m_currentName |
QLayout * | m_layout |
IgSite * | m_parent |
QWidgetStack * | m_widget |
Definition at line 25 of file IgQWidgetStackSite.h.
Definition at line 23 of file IgQWidgetStackSite.cc.
References HLT_VtxMuL3::connect, IgQtSite::host(), IgQtSite::hostFrom(), m_box, m_combo, m_parent, and switchToWidget().
00024 :m_box (new QVBox (hostFrom (parent))), 00025 m_combo (new QComboBox (m_box)), 00026 m_widget (new QWidgetStack (m_box)), 00027 m_layout (new QGridLayout (m_widget)), 00028 m_currentName (IgDocumentDataRoot::getCurrentRoot()), 00029 m_parent(parent) 00030 { 00031 QObject::connect (m_combo, 00032 SIGNAL (activated (int)), 00033 this, 00034 SLOT (switchToWidget (int))); 00035 IgQtSite::host (parent, m_box); 00036 hostFrom (m_parent)->hide(); 00037 }
const char * IgQWidgetStackSite::catalogLabel | ( | void | ) | [static] |
void IgQWidgetStackSite::host | ( | QWidget * | child | ) | [protected, virtual] |
Implements IgQtSite.
Definition at line 64 of file IgQWidgetStackSite.cc.
References IgDocumentDataRoot::getCurrentRoot(), IgQtSite::hostFrom(), m_combo, m_comboIndexToWidgetID, m_currentName, m_layout, m_parent, and m_widget.
00065 { 00066 QWidget *previousWidget = m_widget->visibleWidget (); 00067 if (previousWidget) 00068 { 00069 m_layout->remove (previousWidget); 00070 } 00071 00072 int currentWidget = m_widget->addWidget (child); 00073 m_layout->add (child); 00074 m_widget->raiseWidget (currentWidget); 00075 m_combo->insertItem (m_currentName); 00076 m_combo->setCurrentItem (m_combo->count () - 1); 00077 00078 m_currentName = IgDocumentDataRoot::getCurrentRoot(); 00079 m_comboIndexToWidgetID[m_combo->count () - 1] = currentWidget; 00080 hostFrom (m_parent)->show(); 00081 }
QWidget * IgQWidgetStackSite::host | ( | void | ) | [protected, virtual] |
Implements IgQtSite.
Definition at line 50 of file IgQWidgetStackSite.cc.
References m_widget.
00051 { 00052 return m_widget; 00053 }
IgSite * IgQWidgetStackSite::hostWithName | ( | const std::string & | name | ) |
Definition at line 57 of file IgQWidgetStackSite.cc.
References m_currentName.
Referenced by IgIVView::IgIVView().
00058 { 00059 m_currentName = name; 00060 return this; 00061 }
QWidget * IgQWidgetStackSite::self | ( | void | ) | [protected, virtual] |
Implements IgQtSite.
Definition at line 44 of file IgQWidgetStackSite.cc.
References m_widget.
00045 { 00046 return m_widget; 00047 }
Definition at line 84 of file IgQWidgetStackSite.cc.
References IgDocumentDataRoot::currentRoot(), IgDocumentDataRoot::getCurrentRoot(), m_combo, m_comboIndexToWidgetID, m_currentName, m_layout, and m_widget.
Referenced by IgQWidgetStackSite().
00085 { 00086 QWidget *previousWidget = m_widget->visibleWidget (); 00087 if (previousWidget) 00088 { 00089 m_layout->remove (previousWidget); 00090 } 00091 m_layout->add (m_widget->widget (m_comboIndexToWidgetID[id])); 00092 m_widget->raiseWidget (m_comboIndexToWidgetID[id]); 00093 IgDocumentDataRoot::currentRoot(m_combo->text(id)); 00094 m_currentName = IgDocumentDataRoot::getCurrentRoot (); 00095 }
QVBox* IgQWidgetStackSite::m_box [private] |
QComboBox* IgQWidgetStackSite::m_combo [private] |
Definition at line 43 of file IgQWidgetStackSite.h.
Referenced by host(), IgQWidgetStackSite(), and switchToWidget().
std::map<int, int> IgQWidgetStackSite::m_comboIndexToWidgetID [private] |
std::string IgQWidgetStackSite::m_currentName [private] |
Reimplemented from IgQtSiteStack.
Definition at line 47 of file IgQWidgetStackSite.h.
Referenced by host(), hostWithName(), and switchToWidget().
QLayout* IgQWidgetStackSite::m_layout [private] |
IgSite* IgQWidgetStackSite::m_parent [private] |
QWidgetStack* IgQWidgetStackSite::m_widget [private] |
Definition at line 44 of file IgQWidgetStackSite.h.
Referenced by host(), self(), and switchToWidget().