#include <MdiSubWindow.h>
These are the main objects of every Qtiplot project. All content (apart from the directory structure) is managed by subclasses of MdiSubWindow.
Public Types | |
enum | CaptionPolicy { Name = 0, Label = 1, Both = 2 } |
Possible window captions. More... | |
enum | Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 } |
Public Slots | |
void | notifyChanges () |
Notifies the main application that the window has been modified. | |
virtual void | print () |
Signals | |
void | closedWindow (MdiSubWindow *) |
Emitted when the window was closed. | |
void | hiddenWindow (MdiSubWindow *) |
Emitted when the window was hidden. | |
void | modifiedWindow (MdiSubWindow *) |
void | resizedWindow (MdiSubWindow *) |
void | showContextMenu () |
Show the context menu. | |
void | statusChanged (MdiSubWindow *) |
Emitted when the window status changed. | |
Public Member Functions | |
ApplicationWindow * | applicationWindow () |
Returns a pointer to the parent application. | |
void | askOnCloseEvent (bool ask) |
Toggle the "ask on close" flag. | |
QString | aspect () |
Return the window status as a string. | |
QString | birthDate () |
Return the creation date. | |
CaptionPolicy | captionPolicy () |
Return the caption policy. | |
void | closeEvent (QCloseEvent *) |
Close event handler. | |
bool | eventFilter (QObject *object, QEvent *e) |
Filters other object's events (customizes title bar's context menu). | |
virtual void | exportPDF (const QString &) |
Folder * | folder () |
Returns the pointer to the parent folder of the window. | |
MdiSubWindow (const QString &label=QString(), ApplicationWindow *app=0, const QString &name=QString(), Qt::WFlags f=0) | |
Constructor. | |
QSize | minRestoreSize () |
Returns the size the window had before a change state event to minimized. | |
QString | name () |
Return the window name. | |
void | resizeEvent (QResizeEvent *) |
virtual void | restore (const QStringList &) |
Not implemented yet. | |
virtual void | save (const QString &, const QString &, bool=false) |
void | setBirthDate (const QString &s) |
Set the creation date. | |
void | setCaptionPolicy (CaptionPolicy policy) |
Set the caption policy. | |
void | setFolder (Folder *f) |
Initializes the pointer to the parent folder of the window. | |
virtual void | setHidden () |
Notifies that a window was hidden by a direct user action. | |
void | setMaximized () |
void | setMinimized () |
void | setName (const QString &s) |
Set the window name. | |
void | setNormal () |
void | setStatus (Status s) |
Set the window status flag (hidden, normal, minimized or maximized). | |
void | setWindowLabel (const QString &s) |
Set the window label. | |
virtual QString | sizeToString () |
Size of the widget as a string. | |
Status | status () |
Return the window status flag (hidden, normal, minimized or maximized). | |
QString | windowLabel () |
Return the window label. | |
Static Public Member Functions | |
static QString | parseAsciiFile (const QString &fname, const QString &commentString, int endLine, int ignoreFirstLines, int maxRows, int &rows) |
Static function used as a workaround for ASCII files having end line char != ' '. | |
Protected Member Functions | |
virtual void | changeEvent (QEvent *event) |
Catches status changes. | |
Private Member Functions | |
void | updateCaption () |
Set caption according to current CaptionPolicy, name and label. | |
Static Private Member Functions | |
static QString | parseMacAsciiFile (const QString &fname, const QString &commentString, int ignoreFirstLines, int maxRows, int &rows) |
Used to parse ASCII files with carriage return ('') endline. | |
Private Attributes | |
ApplicationWindow * | d_app |
Pointer to the application window. | |
QString | d_birthdate |
The creation date. | |
CaptionPolicy | d_caption_policy |
The caption policy. | |
bool | d_confirm_close |
Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event. | |
Folder * | d_folder |
Pointer to the parent folder of the window. | |
QString | d_label |
The window label. | |
QSize | d_min_restore_size |
Stores the size the window had before a change state event to minimized. | |
Status | d_status |
The window status. |
enum MdiSubWindow::Status |
MdiSubWindow::MdiSubWindow | ( | const QString & | label = QString() , |
|
ApplicationWindow * | app = 0 , |
|||
const QString & | name = QString() , |
|||
Qt::WFlags | f = 0 | |||
) |
Constructor.
label | window label | |
parent | parent widget | |
name | window name | |
f | window flags |
References Folder::addWindow(), and d_folder.
ApplicationWindow* MdiSubWindow::applicationWindow | ( | ) | [inline] |
Returns a pointer to the parent application.
References d_app.
Referenced by AddWidgetTool::addEquation(), AddWidgetTool::addText(), Table::copySelection(), Matrix::copySelection(), Matrix::determinant(), Graph::enableTextEditor(), CanvasPicker::eventFilter(), AddWidgetTool::eventFilter(), Table::exportASCII(), Matrix::exportASCII(), Matrix::ignoreUndo(), Table::importASCII(), Table::init(), Matrix::initGlobals(), Matrix::initWorkspace(), Matrix::invert(), DataPickerTool::keyEventFilter(), Graph::newLegend(), Table::pasteSelection(), Matrix::pasteSelection(), Table::print(), MultiLayer::print(), Matrix::print(), MultiLayer::resizeLayers(), LegendWidget::showTextEditor(), Table::sortColumnsDialog(), Table::sortTableDialog(), AxesDialog::updateGrid(), and AddWidgetTool::~AddWidgetTool().
void MdiSubWindow::askOnCloseEvent | ( | bool | ask | ) | [inline] |
Toggle the "ask on close" flag.
References d_confirm_close.
Referenced by ApplicationWindow::connectMultilayerPlot(), ApplicationWindow::connectSurfacePlot(), ApplicationWindow::connectTable(), ApplicationWindow::deleteFitTables(), ApplicationWindow::deleteFolder(), ApplicationWindow::initMatrix(), ApplicationWindow::newNote(), and ApplicationWindow::updateConfirmOptions().
QString MdiSubWindow::aspect | ( | ) |
Return the window status as a string.
References d_status, Hidden, Maximized, Minimized, and Normal.
Referenced by ApplicationWindow::addListViewItem(), MultiLayer::print(), and ApplicationWindow::updateWindowStatus().
QString MdiSubWindow::birthDate | ( | ) | [inline] |
Return the creation date.
References d_birthdate.
Referenced by ApplicationWindow::addListViewItem(), TableStatistics::save(), Table::save(), Graph3D::save(), MultiLayer::save(), Note::save(), Matrix::save(), and ApplicationWindow::windowProperties().
CaptionPolicy MdiSubWindow::captionPolicy | ( | ) | [inline] |
Return the caption policy.
References d_caption_policy.
Referenced by RenameWindowDialog::accept(), ApplicationWindow::clone(), ApplicationWindow::matrixToTable(), TableStatistics::save(), Table::save(), Graph3D::save(), MultiLayer::save(), Note::save(), Matrix::save(), RenameWindowDialog::setWidget(), ApplicationWindow::setWindowName(), and ApplicationWindow::tableToMatrix().
void MdiSubWindow::changeEvent | ( | QEvent * | event | ) | [protected, virtual] |
Catches status changes.
References d_min_restore_size, d_status, Maximized, Minimized, Normal, and statusChanged().
void MdiSubWindow::closedWindow | ( | MdiSubWindow * | ) | [signal] |
void MdiSubWindow::closeEvent | ( | QCloseEvent * | e | ) |
Close event handler.
Ask the user "delete, hide, or cancel?" if the "ask on close" flag is set.
References closedWindow(), d_confirm_close, and hiddenWindow().
bool MdiSubWindow::eventFilter | ( | QObject * | object, | |
QEvent * | e | |||
) |
Filters other object's events (customizes title bar's context menu).
Reimplemented in MultiLayer, Graph3D, and Table.
References ApplicationWindow::customWindowTitleBarMenu(), d_app, and showContextMenu().
Referenced by Table::eventFilter(), Graph3D::eventFilter(), and MultiLayer::eventFilter().
virtual void MdiSubWindow::exportPDF | ( | const QString & | ) | [inline, virtual] |
Reimplemented in Matrix, Note, MultiLayer, Graph3D, and Table.
Referenced by ApplicationWindow::exportPDF().
Folder* MdiSubWindow::folder | ( | ) | [inline] |
Returns the pointer to the parent folder of the window.
References d_folder.
Referenced by ApplicationWindow::closeWindow(), ApplicationWindow::restoreWindowGeometry(), muParserScript::tablecol(), and ApplicationWindow::windowGeometryInfo().
void MdiSubWindow::hiddenWindow | ( | MdiSubWindow * | ) | [signal] |
QSize MdiSubWindow::minRestoreSize | ( | ) | [inline] |
Returns the size the window had before a change state event to minimized.
References d_min_restore_size.
Referenced by ApplicationWindow::windowGeometryInfo().
void MdiSubWindow::modifiedWindow | ( | MdiSubWindow * | ) | [signal] |
Referenced by Table::addCol(), Table::calculate(), Matrix::calculate(), Table::cellEdited(), Table::clear(), Table::clearCell(), Table::clearSelection(), Matrix::clearSelection(), Table::colWidthModified(), Matrix::deleteSelectedColumns(), Matrix::deleteSelectedRows(), Table::eventFilter(), Matrix::fft(), Matrix::importASCII(), Matrix::importImage(), Table::insertCols(), Matrix::insertColumn(), Table::insertRow(), Matrix::insertRow(), Note::modifiedNote(), Table::muParserCalculate(), Matrix::muParserCalculate(), Table::normalize(), Table::normalizeSelection(), Table::notifyChanges(), notifyChanges(), Table::pasteSelection(), Matrix::pasteSelection(), Table::removeCol(), MultiLayer::removeLayer(), Table::resizeCols(), Table::resizeRows(), Table::setAscValues(), Table::setColName(), Matrix::setColorMap(), Matrix::setColumnsWidth(), Table::setColumnWidth(), Matrix::setCoordinates(), Matrix::setDimensions(), Matrix::setGrayScale(), Matrix::setHeaderViewType(), Matrix::setNumericFormat(), MultiLayer::setNumLayers(), Table::setPlotDesignation(), Matrix::setRainbowColorMap(), Table::setRandomValues(), Matrix::setViewType(), Table::sortColumn(), and Table::sortColumns().
QString MdiSubWindow::name | ( | ) | [inline] |
Return the window name.
Referenced by RenameWindowDialog::accept(), Table::clearSelection(), Table::importASCII(), Note::init(), Table::pasteSelection(), Table::removeCol(), Table::resizeCols(), Graph3D::save(), Note::save(), Matrix::save(), Table::selectedColumns(), Table::selectedYColumns(), Table::setAscValues(), PlotDialog::setMultiLayer(), Table::setRandomValues(), Graph3D::setScales(), muParserScript::tablecol(), Graph3D::updateData(), and Table::YColumns().
void MdiSubWindow::notifyChanges | ( | ) | [inline, slot] |
Notifies the main application that the window has been modified.
Reimplemented in Table.
References modifiedWindow().
Referenced by EnrichmentDialog::apply(), MultiLayer::connectLayer(), MatrixEditCellCommand::redo(), EnrichmentDialog::saveImagesInternally(), EnrichmentDialog::setBestSize(), EnrichmentDialog::setCoordinates(), MatrixModel::setData(), MatrixEditCellCommand::undo(), and EnrichmentDialog::updateForm().
QString MdiSubWindow::parseAsciiFile | ( | const QString & | fname, | |
const QString & | commentString, | |||
int | endLine, | |||
int | ignoreFirstLines, | |||
int | maxRows, | |||
int & | rows | |||
) | [static] |
Static function used as a workaround for ASCII files having end line char != '
'.
References ApplicationWindow::CR, and parseMacAsciiFile().
Referenced by Table::importASCII(), MatrixModel::importASCII(), and PreviewTable::importASCII().
QString MdiSubWindow::parseMacAsciiFile | ( | const QString & | fname, | |
const QString & | commentString, | |||
int | ignoreFirstLines, | |||
int | maxRows, | |||
int & | rows | |||
) | [static, private] |
virtual void MdiSubWindow::print | ( | ) | [inline, virtual, slot] |
Reimplemented in Matrix, Note, MultiLayer, Graph3D, and Table.
Referenced by ApplicationWindow::print().
void MdiSubWindow::resizedWindow | ( | MdiSubWindow * | ) | [signal] |
Referenced by Graph3D::resizeEvent(), and resizeEvent().
void MdiSubWindow::resizeEvent | ( | QResizeEvent * | e | ) |
virtual void MdiSubWindow::restore | ( | const QStringList & | ) | [inline, virtual] |
Not implemented yet.
Reimplemented in Matrix, Note, and Table.
Referenced by ApplicationWindow::openTemplate().
virtual void MdiSubWindow::save | ( | const QString & | , | |
const QString & | , | |||
bool | = false | |||
) | [inline, virtual] |
Reimplemented in Matrix, Note, MultiLayer, Graph3D, Table, and TableStatistics.
Referenced by ApplicationWindow::saveAsTemplate(), and ApplicationWindow::saveFolder().
void MdiSubWindow::setBirthDate | ( | const QString & | s | ) | [inline] |
Set the creation date.
References d_birthdate.
Referenced by ApplicationWindow::appendProject(), ImportOPJ::importGraphs(), ImportOPJ::importNotes(), ImportOPJ::importTables(), ApplicationWindow::openMatrix(), ApplicationWindow::openNote(), ApplicationWindow::openProject(), ApplicationWindow::openSurfacePlot(), ApplicationWindow::openTable(), and ApplicationWindow::openTableStatistics().
void MdiSubWindow::setCaptionPolicy | ( | CaptionPolicy | policy | ) | [inline] |
Set the caption policy.
References d_caption_policy, and updateCaption().
Referenced by RenameWindowDialog::accept(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), ApplicationWindow::importASCII(), ImportOPJ::importGraphs(), ApplicationWindow::importImage(), ImportOPJ::importTables(), ApplicationWindow::loadImage(), ApplicationWindow::matrixToTable(), ApplicationWindow::openMatrix(), ApplicationWindow::openNote(), ApplicationWindow::openProject(), ApplicationWindow::openSurfacePlot(), ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), ApplicationWindow::plotFile(), ApplicationWindow::setWindowName(), TableStatistics::TableStatistics(), and ApplicationWindow::tableToMatrix().
void MdiSubWindow::setFolder | ( | Folder * | f | ) | [inline] |
Initializes the pointer to the parent folder of the window.
References d_folder.
Referenced by Folder::addWindow().
void MdiSubWindow::setHidden | ( | ) | [virtual] |
Notifies that a window was hidden by a direct user action.
References d_status, Hidden, and statusChanged().
Referenced by ApplicationWindow::hideWindow().
void MdiSubWindow::setMaximized | ( | ) |
References d_status, Maximized, and statusChanged().
Referenced by ApplicationWindow::maximizeWindow().
void MdiSubWindow::setMinimized | ( | ) |
References d_status, Minimized, and statusChanged().
Referenced by ApplicationWindow::minimizeWindow().
void MdiSubWindow::setName | ( | const QString & | s | ) | [inline] |
Set the window name.
Reimplemented in Note.
References updateCaption().
Referenced by ApplicationWindow::dataPlot3D(), ApplicationWindow::initMatrix(), ApplicationWindow::initMultilayerPlot(), ApplicationWindow::initTable(), ApplicationWindow::newPlot3D(), ApplicationWindow::openMatrixPlot3D(), ApplicationWindow::openPlotXYZ(), ApplicationWindow::plot3DMatrix(), ApplicationWindow::plotParametricSurface(), ApplicationWindow::plotSurface(), ApplicationWindow::plotXYZ(), Note::setName(), ApplicationWindow::setWindowName(), and TableStatistics::TableStatistics().
void MdiSubWindow::setNormal | ( | ) |
References d_status, Normal, and statusChanged().
Referenced by ApplicationWindow::activateWindow(), ApplicationWindow::maximizeWindow(), and ApplicationWindow::windowActivated().
void MdiSubWindow::setStatus | ( | Status | s | ) |
Set the window status flag (hidden, normal, minimized or maximized).
References d_status, and statusChanged().
Referenced by ApplicationWindow::changeFolder(), ApplicationWindow::restoreWindowGeometry(), and ApplicationWindow::updateWindowStatus().
void MdiSubWindow::setWindowLabel | ( | const QString & | s | ) | [inline] |
Set the window label.
References d_label, and updateCaption().
Referenced by RenameWindowDialog::accept(), ApplicationWindow::appendProject(), ApplicationWindow::clone(), FFTDialog::fftMatrix(), ApplicationWindow::fitLinear(), ApplicationWindow::importASCII(), ImportOPJ::importGraphs(), Matrix::importImage(), ApplicationWindow::importImage(), ImportOPJ::importNotes(), ImportOPJ::importTables(), ApplicationWindow::loadImage(), ApplicationWindow::matrixToTable(), ApplicationWindow::openMatrix(), ApplicationWindow::openNote(), ApplicationWindow::openProject(), ApplicationWindow::openSurfacePlot(), ApplicationWindow::openTable(), ApplicationWindow::openTableStatistics(), TableStatistics::TableStatistics(), and ApplicationWindow::tableToMatrix().
void MdiSubWindow::showContextMenu | ( | ) | [signal] |
Show the context menu.
Referenced by MultiLayer::connectLayer(), Table::eventFilter(), eventFilter(), and MultiLayer::keyPressEvent().
QString MdiSubWindow::sizeToString | ( | ) | [virtual] |
Size of the widget as a string.
Reimplemented in Matrix, MultiLayer, and Table.
Referenced by ApplicationWindow::addListViewItem(), ApplicationWindow::clone(), ApplicationWindow::modifiedProject(), and ApplicationWindow::windowProperties().
Status MdiSubWindow::status | ( | ) | [inline] |
Return the window status flag (hidden, normal, minimized or maximized).
References d_status.
Referenced by ApplicationWindow::changeFolder(), ApplicationWindow::clone(), ApplicationWindow::maximizeWindow(), ApplicationWindow::showAllFolderWindows(), ApplicationWindow::updateWindowStatus(), ApplicationWindow::windowActivated(), and ApplicationWindow::windowGeometryInfo().
void MdiSubWindow::statusChanged | ( | MdiSubWindow * | ) | [signal] |
Emitted when the window status changed.
Referenced by changeEvent(), setHidden(), setMaximized(), setMinimized(), setNormal(), and setStatus().
void MdiSubWindow::updateCaption | ( | ) | [private] |
Set caption according to current CaptionPolicy, name and label.
References Both, d_app, d_caption_policy, d_label, Label, Name, and ApplicationWindow::setListViewLabel().
Referenced by setCaptionPolicy(), setName(), and setWindowLabel().
QString MdiSubWindow::windowLabel | ( | ) | [inline] |
Return the window label.
References d_label.
Referenced by RenameWindowDialog::accept(), ApplicationWindow::addListViewItem(), ApplicationWindow::clone(), Folder::findWindow(), ApplicationWindow::matrixToTable(), TableStatistics::save(), Table::save(), Graph3D::save(), MultiLayer::save(), Note::save(), Matrix::save(), RenameWindowDialog::setWidget(), and ApplicationWindow::tableToMatrix().
ApplicationWindow* MdiSubWindow::d_app [private] |
Pointer to the application window.
Referenced by applicationWindow(), eventFilter(), and updateCaption().
QString MdiSubWindow::d_birthdate [private] |
CaptionPolicy MdiSubWindow::d_caption_policy [private] |
The caption policy.
Referenced by captionPolicy(), setCaptionPolicy(), and updateCaption().
bool MdiSubWindow::d_confirm_close [private] |
Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
Referenced by askOnCloseEvent(), and closeEvent().
Folder* MdiSubWindow::d_folder [private] |
Pointer to the parent folder of the window.
Referenced by folder(), MdiSubWindow(), and setFolder().
QString MdiSubWindow::d_label [private] |
The window label.
Referenced by setWindowLabel(), updateCaption(), and windowLabel().
QSize MdiSubWindow::d_min_restore_size [private] |
Stores the size the window had before a change state event to minimized.
Referenced by changeEvent(), and minRestoreSize().
Status MdiSubWindow::d_status [private] |
The window status.
Referenced by aspect(), changeEvent(), setHidden(), setMaximized(), setMinimized(), setNormal(), setStatus(), and status().