MainWindow Class Reference

MainWindow is the main GUI window. More...

#include <MainWindow.h>

Collaboration diagram for MainWindow:

Collaboration graph
List of all members.

Public Types

enum  { MaxRecentFiles = 4 }
enum  ESlvAction { FirstSolve, PrevSolve, NextSolve, LastSolve }

Public Slots

void setCurrentFile (QString fileName)
void setTitleUntitled ()
void switchToModel_NoLast ()
void switchToBuild_NoLast ()
void switchToPics_NoLast ()
void switchToBuildOrPics_NoLast ()
void setView (QAction *act)
void changedActionsAct (QAction *act)
void updateSolveBrowseEnable ()
 the soultion browser (next, previous, free selection from a combobox) is controlled by the actions in this method.
void updateFileEnables ()
void slvProgUpdate (int hint, int data)
void doModalOptionsDlg ()
void setTitleChanged (bool state)
void setActSlvIndex (int n)
void setDocSlvIndex ()
void doModalAboutDlg ()
 Show the about dialog box.
void setStatusTextBuild (int t, BuildGLWidget::EActStatus remove)


void openFile (QString filename)
void initializeComplete ()
void picsLoadComplete ()

Public Member Functions

 MainWindow ()
virtual QSize minimumSizeHint () const
virtual QSize sizeHint () const
bool initialize ()
void loadStartupFile (QString filename)
bool wasClosed ()

Public Attributes

QAction * m_newShapeAct
QAction * m_resetSolAct
QAction * m_openAct
QAction * m_saveAct
QAction * m_exitAct
QAction * m_goAct
QAction * m_recentFilesActs [MaxRecentFiles+1]
QAction * m_statusBarTriggered
QActionGroup * m_viewActs
QAction * m_picsViewAct
QAction * m_resetViewAct
QAction * m_continueModeAct
QActionGroup * m_viewFrustrumActs
QActionGroup * m_axisActs
QActionGroup * m_actionsActs
QActionGroup * m_spaceActs
QAction * m_showSlvDlgAct
QAction * m_showGrpColorAct
QAction * m_showAsmDlgAct
QAction * m_editOptionsAct
QAction * m_aboutAct
QAction * m_aboutQtAct
QAction * m_selectYellowAct
QAction * m_selectBlueAct
QAction * m_showAllBlueAct
QActionGroup * m_slvBrowse
QAction * m_slvFirstAct
QAction * m_slvPrevAct
QAction * m_slvNextAct
QAction * m_slvLastAct
QAction * m_slvNumAct

Protected Member Functions

virtual void closeEvent (QCloseEvent *e)
virtual void keyPressEvent (QKeyEvent *event)
virtual void keyReleaseEvent (QKeyEvent *event)
virtual void dragEnterEvent (QDragEnterEvent *event)
virtual void dropEvent (QDropEvent *event)

Private Types

enum  EView { ModelView = 0, BuildView = 1, PicsView = 2 }

Private Slots

void openRecentFile ()
void setView (int tab)

Private Member Functions

void createActions ()
void createMenus ()
void spawnMenuBar ()
 create the filler place for the menu bar to be filled later
void createToolBars ()
void createStatusBar ()
void reConnect3DActions (GLWidget *target)
 when a 3D view is switched, some actions need to be reconnected to the currently active view.
void connectActions ()
void switchTo_NoLast (EView view)
void readRecentFileActions (const QString &list, QAction *acts[])
void updateRecentActions (QAction *acts[], const QStringList &files)
void setCurrentFile (const QString &fileName, const QString &list, QAction *acts[])
void showTitle ()
void readRecentFileActions (const QString &list)
void EnableBuildActs (bool en)
void Enable3DActions (bool en)
void saveSizeToReg ()
void resizeFromReg ()
void SwitchView (int nSwitchTo, bool bToLast)

Private Attributes

QStackedWidget * m_stack
QDockWidget * m_dock
QTabWidget * m_docktab
 points to either m_modelGlWidget or m_buildGlWidget
bool m_wasClosed
 used to detect if the window was closed before it got to exec(). (closed in the inialization)
QString m_filename
bool m_bChanged
int m_lastViewIndex
QMenu * m_fileMenu
QMenu * m_recentFilesMenu
QMenu * m_viewMenu
QMenu * m_toobarsPopMenu
QMenu * m_actionsMenu
QMenu * m_buildMenu
QMenu * m_actionMenu
QMenu * m_helpMenu
QToolBar * m_3DviewToolbar
QToolBar * m_viewsToolbar
QToolBar * m_buildToolbar
QToolBar * m_solvesToolbar

Detailed Description

MainWindow is the main GUI window.

All other GUI elemets are spawned from it. Physically, MainWindow is the widget that surrounds the whole application and which contains the OpenGL view and the side bar. MainWindow creates all of the menus, actions, toolbars (which are not visible by default), status bar, side bars and OpenGL views. It is also responsible for connecting their signals and slots. Infact, all GUI-related signals and slots are connected by MainWindow in connectActions(). MainWindow is also responsible for creating any dialog boxes when they are needed with the exception of the Open/Save file dialogues which are created by CubeDoc. It also centeralizes the required pre-run initalization in initialize() although much of the work there is unrealted directly to the GUI. There is only a single instance of this class thoughout the lifetime of the application. It is created in the main() function of the application. This instance holds the CubeDoc instance and all instances of all widgets created in the application.

Member Enumeration Documentation

enum MainWindow::EView [private]


anonymous enum



Constructor & Destructor Documentation

MainWindow::MainWindow (  ) 

Member Function Documentation

QSize MainWindow::minimumSizeHint (  )  const [virtual]

QSize MainWindow::sizeHint (  )  const [virtual]

bool MainWindow::initialize (  ) 

void MainWindow::loadStartupFile ( QString  filename  ) 

bool MainWindow::wasClosed (  )  [inline]

void MainWindow::setCurrentFile ( QString  fileName  )  [inline, slot]

void MainWindow::setTitleUntitled (  )  [slot]

void MainWindow::switchToModel_NoLast (  )  [inline, slot]

void MainWindow::switchToBuild_NoLast (  )  [inline, slot]

void MainWindow::switchToPics_NoLast (  )  [inline, slot]

void MainWindow::switchToBuildOrPics_NoLast (  )  [slot]

void MainWindow::setView ( QAction *  act  )  [slot]

void MainWindow::changedActionsAct ( QAction *  act  )  [slot]

void MainWindow::updateSolveBrowseEnable (  )  [slot]

the soultion browser (next, previous, free selection from a combobox) is controlled by the actions in this method.

They need to be changed from here because they are accessed both by ModelHelpDlg and the solutions toolbar

void MainWindow::updateFileEnables (  )  [slot]

void MainWindow::slvProgUpdate ( int  hint,
int  data 
) [slot]

void MainWindow::doModalOptionsDlg (  )  [slot]

void MainWindow::setTitleChanged ( bool  state  )  [slot]

void MainWindow::setActSlvIndex ( int  n  )  [slot]

void MainWindow::setDocSlvIndex (  )  [slot]

void MainWindow::doModalAboutDlg (  )  [slot]

Show the about dialog box.

void MainWindow::setStatusTextBuild ( int  t,
BuildGLWidget::EActStatus  remove 
) [slot]

void MainWindow::openRecentFile (  )  [private, slot]

void MainWindow::setView ( int  tab  )  [private, slot]

void MainWindow::openFile ( QString  filename  )  [signal]

void MainWindow::initializeComplete (  )  [signal]

void MainWindow::picsLoadComplete (  )  [signal]

void MainWindow::createActions (  )  [private]

void MainWindow::createMenus (  )  [private]

void MainWindow::spawnMenuBar (  )  [private]

create the filler place for the menu bar to be filled later

void MainWindow::createToolBars (  )  [private]

void MainWindow::createStatusBar (  )  [private]

void MainWindow::reConnect3DActions ( GLWidget target  )  [private]

when a 3D view is switched, some actions need to be reconnected to the currently active view.

void MainWindow::connectActions (  )  [private]

void MainWindow::switchTo_NoLast ( EView  view  )  [private]

void MainWindow::readRecentFileActions ( const QString &  list,
QAction *  acts[] 
) [private]

void MainWindow::updateRecentActions ( QAction *  acts[],
const QStringList &  files 
) [private]

void MainWindow::setCurrentFile ( const QString &  fileName,
const QString &  list,
QAction *  acts[] 
) [private]

void MainWindow::showTitle (  )  [private]

void MainWindow::readRecentFileActions ( const QString &  list  )  [private]

void MainWindow::EnableBuildActs ( bool  en  )  [private]

void MainWindow::Enable3DActions ( bool  en  )  [private]

void MainWindow::saveSizeToReg (  )  [private]

void MainWindow::resizeFromReg (  )  [private]

void MainWindow::closeEvent ( QCloseEvent *  e  )  [protected, virtual]

void MainWindow::keyPressEvent ( QKeyEvent *  event  )  [protected, virtual]

void MainWindow::keyReleaseEvent ( QKeyEvent *  event  )  [protected, virtual]

void MainWindow::dragEnterEvent ( QDragEnterEvent *  event  )  [protected, virtual]

void MainWindow::dropEvent ( QDropEvent *  event  )  [protected, virtual]

void MainWindow::SwitchView ( int  nSwitchTo,
bool  bToLast 
) [private]

Member Data Documentation

QStackedWidget* MainWindow::m_stack [private]

QDockWidget* MainWindow::m_dock [private]

QTabWidget* MainWindow::m_docktab [private]

points to either m_modelGlWidget or m_buildGlWidget

bool MainWindow::m_wasClosed [private]

used to detect if the window was closed before it got to exec(). (closed in the inialization)

QString MainWindow::m_filename [private]

bool MainWindow::m_bChanged [private]

QMenu* MainWindow::m_fileMenu [private]

QMenu* MainWindow::m_viewMenu [private]

QMenu* MainWindow::m_toobarsPopMenu [private]

QMenu* MainWindow::m_actionsMenu [private]

QMenu* MainWindow::m_buildMenu [private]

QMenu* MainWindow::m_actionMenu [private]

QMenu* MainWindow::m_helpMenu [private]

QToolBar* MainWindow::m_3DviewToolbar [private]

QToolBar* MainWindow::m_viewsToolbar [private]

QToolBar* MainWindow::m_buildToolbar [private]

QToolBar* MainWindow::m_solvesToolbar [private]

QAction* MainWindow::m_recentFilesActs[MaxRecentFiles+1]

QActionGroup* MainWindow::m_viewActs

QActionGroup* MainWindow::m_axisActs

QActionGroup* MainWindow::m_spaceActs

QActionGroup* MainWindow::m_slvBrowse

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