CMS 3D CMS Logo

IgQWorkspaceSite.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "Iguana/Studio/interface/IgQWorkspaceSite.h"
00004 #include "Iguana/Studio/interface/IgQtWorkspace.h"
00005 #include "Iguana/Framework/interface/IgDocumentDataRoot.h"
00006 
00007 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00008 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00009 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00010 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00011 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00012 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00013 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00014 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00015 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00016 
00017 IgQWorkspaceSite::IgQWorkspaceSite (IgState *, IgSite *parent)
00018     : m_widget (new IgQtWorkspace (hostFrom (parent))),
00019       m_currentName (IgDocumentDataRoot::getCurrentRoot())
00020 {    
00021     IgQtSite::host (parent, m_widget);
00022 }
00023 
00024 const char *
00025 IgQWorkspaceSite::catalogLabel (void)
00026 { 
00027     return "QWorkspace"; 
00028 }
00029 
00030 void
00031 IgQWorkspaceSite::tile (void)
00032 {
00033     m_widget->tile ();
00034 }
00035 
00036 void
00037 IgQWorkspaceSite::cascade (void)
00038 {
00039     m_widget->cascade ();
00040 }
00041 
00042 QWidget *
00043 IgQWorkspaceSite::self (void)
00044 {
00045     return m_widget;
00046 }
00047 
00048 QWidget *
00049 IgQWorkspaceSite::host (void)
00050 {
00051     return m_widget;
00052 }
00053 
00054 void
00055 IgQWorkspaceSite::host (QWidget *child)
00056 {
00057     // FIXME: add requester on closing window.
00058     // connect (child, SIGNAL (close ()), this, SLOT (closeWindow ()))
00059     
00060     // FIXME: this is hackish... We should make sure that the this
00061     // is already shown when this is called so that its size cannot be
00062     // 0.
00063     QSize defaultSize (300, 300);
00064     child->resize (defaultSize.expandedTo (m_widget->size () / 2));
00065     child->parentWidget ()->setCaption (m_currentName);
00066 
00067     m_currentName = IgDocumentDataRoot::getCurrentRoot();    
00068 }
00069 
00070 IgQtSite *
00071 IgQWorkspaceSite::hostWithName (const std::string &name)
00072 {
00073     m_currentName = name;    
00074     return this;    
00075 }

Generated on Tue Jun 9 17:38:50 2009 for CMSSW by  doxygen 1.5.4