![]() |
Computer Assited Medical Intervention Tool Kit
version 4.0
|
This Class is the base class for your application. More...
#include <MainWindow.h>
Inherits QMainWindow.
Inherited by ImpMainWindow.
Public Slots | |
Refresh and show | |
virtual void | refresh () |
void | show () |
inherited from QWidget, just to refresh all viewers More... | |
Public Member Functions | |
general | |
MainWindow (QString title) | |
Constructor, the window title can be changed here, it is inconsistent to use setWindowTitle(). More... | |
virtual | ~MainWindow () |
destructor More... | |
virtual void | aboutToShow () |
this method is automatically called by Application before the first time show() is called. More... | |
subtitle, status bar message, progress bar state and console | |
void | setWindowSubtitle (QString) |
The subtitle is situated at the end of the title, on the title bar, is helps for example showing which file is currently selected. More... | |
QProgressBar * | getProgressBar () |
similar as statusBar() from QMainWindow but for the progress bar More... | |
void | showStatusBar (bool) |
show the status bar (by default it is hidden) More... | |
virtual void | redirectToConsole (bool) |
use or not the application console (redirect or not standard out/err streams) More... | |
void | showConsole (bool) |
get the console window More... | |
Viewers | |
virtual void | showViewer (Viewer *, bool) |
set the visibility for the given viewer (if it is in a dock) More... | |
virtual void | addDockViewer (Qt::DockWidgetArea, Viewer *) |
add a Viewer to the application as a docking widget and specify where it has to be docked Note that MainWindow takes ownership of the Viewer pointer and deletes it at the appropriate time. More... | |
void | refreshViewers () |
Method uses to refresh all the viewer of the Main Window. More... | |
virtual void | setCentralViewer (Viewer *) |
set the central Viewer of the application. More... | |
virtual const Viewer & | getCentralViewer () const |
the actual central viewer. More... | |
Protected Member Functions | |
virtual void | closeEvent (QCloseEvent *) |
overriden from QMainWindow, just connect to slotFileQuit More... | |
void | dragEnterEvent (QDragEnterEvent *event) |
called when a drag event started on the main window, accept drag only if file is MIME type text/uri-list More... | |
void | dragLeaveEvent (QDragLeaveEvent *event) |
called when the mouse leaves the widgets area during a drag/drop operation More... | |
void | dragMoveEvent (QDragMoveEvent *event) |
called when the mouse moves inside the widgets area during a drag/drop operation More... | |
void | dropEvent (QDropEvent *event) |
just call open with the dragged uri More... | |
bool | removeViewer (Viewer *viewer) |
Remove the given viewer from the list of viewer. More... | |
Protected Attributes | |
Viewer * | centralViewer |
The actual central Viewer. More... | |
Private Attributes | |
ConsoleStream | cerr |
the error stream for the application console More... | |
QDialog * | consoleWindow |
console to display all messages More... | |
QTextEdit * | consoleWindowTextEdit |
the QTextEdit part of the console dialog More... | |
ConsoleStream | cout |
the output stream for the application console More... | |
QString | mainTitle |
the main part of the title More... | |
QProgressBar * | myProgressBar |
the progress bar (access through setProgress() method) More... | |
Viewer and other things | |
QList< Viewer * > | viewers |
QMap< Viewer *, QDockWidget * > | dockWidgetMap |
the map that gives the corresponding QDockWidget for a given Viewer More... | |
virtual void | initSettings () |
init MainWindow specific settings (e.g. size, position) More... | |
This Class is the base class for your application.
It sets up the main window and providing a menubar, toolbar and statusbar (all hidden). It is the default main window for a application.
Create a class that inherits from MainWindow to get all the goodies of Core and add your own customization/UI. See applications for examples.
MainWindow::MainWindow | ( | QString | title | ) |
Constructor, the window title can be changed here, it is inconsistent to use setWindowTitle().
If you like to dynamically add some information to the window title, please use setWindowSubtitle() instead.
title | main window title |
References centralViewer, consoleWindow, consoleWindowTextEdit, mainTitle, myProgressBar, and showStatusBar().
|
virtual |
destructor
References consoleWindow, and viewers.
|
virtual |
this method is automatically called by Application before the first time show() is called.
This method calls initSettings().
Reimplemented in ImpMainWindow.
References initSettings().
Referenced by camitk::Application::exec().
|
virtual |
add a Viewer to the application as a docking widget and specify where it has to be docked Note that MainWindow takes ownership of the Viewer pointer and deletes it at the appropriate time.
This method calls addViewer(...).
Reimplemented in ImpMainWindow.
References dockWidgetMap, and camitk::Viewer::getWidget().
|
protectedvirtual |
overriden from QMainWindow, just connect to slotFileQuit
References camitk::Application::getAction(), camitk::Application::getName(), camitk::Application::getSettings(), and camitk::Action::SUCCESS.
|
protected |
called when a drag event started on the main window, accept drag only if file is MIME type text/uri-list
|
protected |
called when the mouse leaves the widgets area during a drag/drop operation
|
protected |
called when the mouse moves inside the widgets area during a drag/drop operation
|
protected |
just call open with the dragged uri
References camitk::Application::open().
|
virtual |
QProgressBar * MainWindow::getProgressBar | ( | ) |
similar as statusBar() from QMainWindow but for the progress bar
References myProgressBar.
Referenced by ImpMainWindow::openDirectory(), camitk::Application::resetProgressBar(), camitk::Application::setProgressBarValue(), and camitk::Application::vtkProgressFunction().
|
protectedvirtual |
init MainWindow specific settings (e.g. size, position)
Reimplemented in ImpMainWindow.
References camitk::Application::getName(), and camitk::Application::getSettings().
Referenced by aboutToShow().
|
virtual |
use or not the application console (redirect or not standard out/err streams)
Reimplemented in ImpMainWindow.
References cerr, consoleWindowTextEdit, cout, camitk::ConsoleStream::free(), camitk::ConsoleStream::init(), and camitk::Core::version.
Referenced by main(), and camitk::Application::setMainWindow().
|
virtualslot |
this slot is connected to all the viewers selectionChanged() signal, this will call the refresh method of all viewers
References camitk::Viewer::refresh(), and viewers.
Referenced by camitk::Application::refresh(), removeViewer(), setWindowSubtitle(), and show().
void MainWindow::refreshViewers | ( | ) |
Method uses to refresh all the viewer of the Main Window.
References camitk::Viewer::refresh(), and viewers.
|
protected |
Remove the given viewer from the list of viewer.
viewer | The viewer to remove. |
References camitk::Application::getAllComponents(), refresh(), camitk::Component::setVisibility(), and viewers.
Referenced by setCentralViewer().
|
virtual |
set the central Viewer of the application.
Note that MainWindow takes ownership of the Viewer pointer and deletes it at the appropriate time. This method calls addViewer(...).
Reimplemented in ImpMainWindow.
References centralViewer, camitk::Viewer::getWidget(), and removeViewer().
void MainWindow::setWindowSubtitle | ( | QString | subtitle | ) |
The subtitle is situated at the end of the title, on the title bar, is helps for example showing which file is currently selected.
It appears between brackets "[ ... ]"
References camitk::Viewer::getToolBar(), mainTitle, refresh(), and viewers.
Referenced by ImpMainWindow::updateActionStates().
|
slot |
inherited from QWidget, just to refresh all viewers
References refresh().
Referenced by camitk::Application::exec().
void MainWindow::showConsole | ( | bool | show | ) |
get the console window
References consoleWindow.
void MainWindow::showStatusBar | ( | bool | b | ) |
show the status bar (by default it is hidden)
Referenced by MainWindow().
|
virtual |
set the visibility for the given viewer (if it is in a dock)
References dockWidgetMap, and viewers.
Referenced by ImpMainWindow::ImpMainWindow().
|
protected |
The actual central Viewer.
Referenced by getCentralViewer(), MainWindow(), and setCentralViewer().
|
private |
the error stream for the application console
Referenced by redirectToConsole().
|
private |
console to display all messages
Referenced by MainWindow(), showConsole(), and ~MainWindow().
|
private |
the QTextEdit part of the console dialog
Referenced by MainWindow(), and redirectToConsole().
|
private |
the output stream for the application console
Referenced by redirectToConsole().
|
protected |
the map that gives the corresponding QDockWidget for a given Viewer
Referenced by addDockViewer(), ImpMainWindow::ImpMainWindow(), ImpMainWindow::resetWindows(), showViewer(), and ImpMainWindow::updateViewMenu().
|
private |
the main part of the title
Referenced by MainWindow(), and setWindowSubtitle().
|
private |
the progress bar (access through setProgress() method)
Referenced by getProgressBar(), and MainWindow().
|
protected |
the set of viewers
Referenced by ImpMainWindow::editSettings(), refresh(), refreshViewers(), removeViewer(), setWindowSubtitle(), showViewer(), ImpMainWindow::updateViewMenu(), and ~MainWindow().