MainWindow Class Reference

#include <mainwindow.h>

Inheritance diagram for MainWindow:

QMainWindow

List of all members.


Detailed Description

Definition at line 33 of file mainwindow.h.


Public Member Functions

 MainWindow ()

Protected Member Functions

void closeEvent (QCloseEvent *event)

Private Slots

void newFile ()
void open ()
bool save ()
bool saveAs ()
void about ()
void documentWasModified ()

Private Member Functions

void createActions ()
void createMenus ()
void createToolBars ()
void createStatusBar ()
void readSettings ()
void writeSettings ()
bool maybeSave ()
void loadFile (const QString &fileName)
bool saveFile (const QString &fileName)
void setCurrentFile (const QString &fileName)
QString strippedName (const QString &fullFileName)

Private Attributes

QTextEdittextEdit
QString curFile
QMenufileMenu
QMenueditMenu
QMenuhelpMenu
QToolBarfileToolBar
QToolBareditToolBar
QActionnewAct
QActionopenAct
QActionsaveAct
QActionsaveAsAct
QActionexitAct
QActioncutAct
QActioncopyAct
QActionpasteAct
QActionaboutAct
QActionaboutQtAct

Constructor & Destructor Documentation

MainWindow::MainWindow (  ) 

Definition at line 28 of file mainwindow.cpp.

References createActions(), createMenus(), createStatusBar(), createToolBars(), QTextEdit::document(), documentWasModified(), readSettings(), QMainWindow::setCentralWidget(), setCurrentFile(), and textEdit.

Here is the call graph for this function:


Member Function Documentation

void MainWindow::closeEvent ( QCloseEvent event  )  [protected]

Definition at line 46 of file mainwindow.cpp.

References maybeSave(), and writeSettings().

Here is the call graph for this function:

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

Definition at line 56 of file mainwindow.cpp.

References QTextEdit::clear(), maybeSave(), setCurrentFile(), and textEdit.

Referenced by createActions().

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

Definition at line 64 of file mainwindow.cpp.

References QFileDialog::getOpenFileName(), QString::isEmpty(), loadFile(), and maybeSave().

Referenced by createActions().

bool MainWindow::save (  )  [private, slot]

Definition at line 73 of file mainwindow.cpp.

References curFile, QString::isEmpty(), saveAs(), and saveFile().

Referenced by createActions(), and maybeSave().

bool MainWindow::saveAs (  )  [private, slot]

Definition at line 82 of file mainwindow.cpp.

References QFileDialog::getSaveFileName(), QString::isEmpty(), and saveFile().

Referenced by createActions(), and save().

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

Definition at line 91 of file mainwindow.cpp.

References QMessageBox::about().

Referenced by createActions().

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

Definition at line 99 of file mainwindow.cpp.

References QTextEdit::document(), and textEdit.

Referenced by MainWindow().

void MainWindow::createActions (  )  [private]

Definition at line 104 of file mainwindow.cpp.

References about(), aboutAct, aboutQtAct, copyAct, cutAct, exitAct, newAct, newFile(), open(), openAct, pasteAct, save(), saveAct, saveAs(), saveAsAct, and textEdit.

Referenced by MainWindow().

void MainWindow::createMenus (  )  [private]

Definition at line 164 of file mainwindow.cpp.

References aboutAct, aboutQtAct, QMenu::addAction(), QMenu::addSeparator(), copyAct, cutAct, editMenu, exitAct, fileMenu, helpMenu, QMainWindow::menuBar(), newAct, openAct, pasteAct, saveAct, and saveAsAct.

Referenced by MainWindow().

Here is the call graph for this function:

void MainWindow::createToolBars (  )  [private]

Definition at line 186 of file mainwindow.cpp.

References QToolBar::addAction(), QMainWindow::addToolBar(), copyAct, cutAct, editToolBar, fileToolBar, newAct, openAct, pasteAct, and saveAct.

Referenced by MainWindow().

Here is the call graph for this function:

void MainWindow::createStatusBar (  )  [private]

Definition at line 199 of file mainwindow.cpp.

References QMainWindow::statusBar().

Referenced by MainWindow().

Here is the call graph for this function:

void MainWindow::readSettings (  )  [private]

Definition at line 204 of file mainwindow.cpp.

References QSettings::value().

Referenced by MainWindow().

Here is the call graph for this function:

void MainWindow::writeSettings (  )  [private]

Definition at line 213 of file mainwindow.cpp.

References QSettings::setValue().

Referenced by closeEvent().

Here is the call graph for this function:

bool MainWindow::maybeSave (  )  [private]

Definition at line 220 of file mainwindow.cpp.

References QTextEdit::document(), save(), textEdit, and QMessageBox::warning().

Referenced by closeEvent(), newFile(), and open().

Here is the call graph for this function:

void MainWindow::loadFile ( const QString fileName  )  [private]

Definition at line 236 of file mainwindow.cpp.

References QFile::open(), QTextStream::readAll(), QApplication::restoreOverrideCursor(), setCurrentFile(), QApplication::setOverrideCursor(), QMainWindow::statusBar(), textEdit, and QMessageBox::warning().

Referenced by open().

Here is the call graph for this function:

bool MainWindow::saveFile ( const QString fileName  )  [private]

Definition at line 256 of file mainwindow.cpp.

References QFile::open(), QApplication::restoreOverrideCursor(), setCurrentFile(), QApplication::setOverrideCursor(), QMainWindow::statusBar(), textEdit, and QMessageBox::warning().

Referenced by save(), and saveAs().

Here is the call graph for this function:

void MainWindow::setCurrentFile ( const QString fileName  )  [private]

Definition at line 277 of file mainwindow.cpp.

References curFile, QTextEdit::document(), QString::isEmpty(), strippedName(), and textEdit.

Referenced by loadFile(), MainWindow(), newFile(), and saveFile().

Here is the call graph for this function:

QString MainWindow::strippedName ( const QString fullFileName  )  [private]

Definition at line 292 of file mainwindow.cpp.

Referenced by setCurrentFile().


Member Data Documentation

QTextEdit* MainWindow::textEdit [private]

Definition at line 64 of file mainwindow.h.

Referenced by createActions(), documentWasModified(), loadFile(), MainWindow(), maybeSave(), newFile(), saveFile(), and setCurrentFile().

QString MainWindow::curFile [private]

Definition at line 65 of file mainwindow.h.

Referenced by save(), and setCurrentFile().

QMenu* MainWindow::fileMenu [private]

Definition at line 67 of file mainwindow.h.

Referenced by createMenus().

QMenu* MainWindow::editMenu [private]

Definition at line 68 of file mainwindow.h.

Referenced by createMenus().

QMenu* MainWindow::helpMenu [private]

Definition at line 69 of file mainwindow.h.

Referenced by createMenus().

QToolBar* MainWindow::fileToolBar [private]

Definition at line 70 of file mainwindow.h.

Referenced by createToolBars().

QToolBar* MainWindow::editToolBar [private]

Definition at line 71 of file mainwindow.h.

Referenced by createToolBars().

QAction* MainWindow::newAct [private]

Definition at line 72 of file mainwindow.h.

Referenced by createActions(), createMenus(), and createToolBars().

QAction* MainWindow::openAct [private]

Definition at line 73 of file mainwindow.h.

Referenced by createActions(), createMenus(), and createToolBars().

QAction* MainWindow::saveAct [private]

Definition at line 74 of file mainwindow.h.

Referenced by createActions(), createMenus(), and createToolBars().

QAction* MainWindow::saveAsAct [private]

Definition at line 75 of file mainwindow.h.

Referenced by createActions(), and createMenus().

QAction* MainWindow::exitAct [private]

Definition at line 76 of file mainwindow.h.

Referenced by createActions(), and createMenus().

QAction* MainWindow::cutAct [private]

Definition at line 77 of file mainwindow.h.

Referenced by createActions(), createMenus(), and createToolBars().

QAction* MainWindow::copyAct [private]

Definition at line 78 of file mainwindow.h.

Referenced by createActions(), createMenus(), and createToolBars().

QAction* MainWindow::pasteAct [private]

Definition at line 79 of file mainwindow.h.

Referenced by createActions(), createMenus(), and createToolBars().

QAction* MainWindow::aboutAct [private]

Definition at line 80 of file mainwindow.h.

Referenced by createActions(), and createMenus().

QAction* MainWindow::aboutQtAct [private]

Definition at line 81 of file mainwindow.h.

Referenced by createActions(), and createMenus().


The documentation for this class was generated from the following files:
Generated on Sun Oct 28 22:51:42 2007 for BBoB by  doxygen 1.5.3