SciDAVis  1.D4
Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
MyWidget Class Reference

Base class of all MDI client windows. More...

#include <MyWidget.h>

Inheritance diagram for MyWidget:
Graph3D MatrixView MultiLayer Note TableView Matrix Table TableStatistics

List of all members.

Public Types

enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }

Signals

void closedWindow (MyWidget *)
 Emitted when the window was closed.
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedWindow (QWidget *)
void resizedWindow (QWidget *)
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void statusChanged (MyWidget *)
 Emitted when the window status changed.

Public Member Functions

void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
virtual QString birthDate ()
 Return the creation date.
virtual 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 &)
Folderfolder ()
 Returns the pointer to the parent folder of the window.
 MyWidget (const QString &label=QString(), QWidget *parent=0, const QString name=0, Qt::WFlags f=0)
 Constructor.
virtual QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
virtual void print ()
virtual void restore (const QStringList &)
 Not implemented yet.
virtual QString saveAsTemplate (const QString &)
virtual QString saveToString (const QString &)
virtual void setBirthDate (const QString &s)
 Set the creation date.
virtual 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 ()
virtual 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)
virtual void setWindowLabel (const QString &s)
 Set the window label.
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized)
virtual QString windowLabel ()
 Return the window label.

Protected Slots

void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.

Protected Member Functions

virtual void changeEvent (QEvent *event)
 Catches parent changes (in order to gain access to the title bar)

Protected Attributes

bool askOnClose
 Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
QString birthdate
 The creation date.
CaptionPolicy caption_policy
 The caption policy.
FolderparentFolder
 Pointer to the parent folder of the window.
QWidget * titleBar
 Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.
QString w_label
 The window label.
Status w_status
 The window status.

Detailed Description

Base class of all MDI client windows.

These are the main objects of every SciDAVis project. All content (apart from the directory structure) is managed by subclasses of MyWidget.

Future Plans

Rename to Aspect.

See also:
Folder, ApplicationWindow

Member Enumeration Documentation

Possible window captions.

Enumerator:
Name 

caption determined by the window name

Label 

caption detemined by the window label

Both 

caption = "name - label"

Enumerator:
Hidden 
Normal 
Minimized 
Maximized 

Constructor & Destructor Documentation

MyWidget::MyWidget ( const QString &  label = QString(),
QWidget *  parent = 0,
const QString  name = 0,
Qt::WFlags  f = 0 
)

Constructor.

Parameters:
labelwindow label
parentparent widget
namewindow name
fwindow flags
See also:
setCaptionPolicy(), captionPolicy()

References askOnClose, Both, caption_policy, Normal, titleBar, w_label, and w_status.


Member Function Documentation

void MyWidget::askOnCloseEvent ( bool  ask)
inline
QString MyWidget::aspect ( )
virtual QString MyWidget::birthDate ( )
inlinevirtual
virtual CaptionPolicy MyWidget::captionPolicy ( )
inlinevirtual
void MyWidget::changeEvent ( QEvent *  event)
protectedvirtual

Catches parent changes (in order to gain access to the title bar)

Reimplemented in TableView, MatrixView, and MultiLayer.

References Maximized, Minimized, Normal, statusChanged(), titleBar, and w_status.

void MyWidget::closedWindow ( MyWidget )
signal

Emitted when the window was closed.

Referenced by closeEvent().

void MyWidget::closeEvent ( QCloseEvent *  e)

Close event handler.

Ask the user "delete, hide, or cancel?" if the "ask on close" flag is set.

Reimplemented in Matrix, and Table.

References askOnClose, closedWindow(), and hiddenWindow().

bool MyWidget::eventFilter ( QObject *  object,
QEvent *  e 
)

Filters other object's events (customizes title bar's context menu)

Reimplemented in TableView, MatrixView, Graph3D, MultiLayer, and TableStatistics.

References showTitleBarMenu(), and titleBar.

virtual void MyWidget::exportPDF ( const QString &  )
inlinevirtual

Reimplemented in Graph3D, MultiLayer, Table, Matrix, and Note.

Folder* MyWidget::folder ( )
inline
void MyWidget::hiddenWindow ( MyWidget )
signal

Emitted when the window was hidden.

Referenced by Table::closeEvent(), Matrix::closeEvent(), and closeEvent().

void MyWidget::modifiedWindow ( QWidget *  )
signal
virtual QString MyWidget::name ( )
inlinevirtual
void MyWidget::notifyChanges ( )
inline

Notifies the main application that the window has been modified.

References modifiedWindow().

Referenced by ApplicationWindow::importASCII(), PlotDialog::pickBorderColor(), and PlotDialog::updateBorder().

virtual void MyWidget::print ( )
inlinevirtual

Reimplemented in Graph3D, MultiLayer, Table, Matrix, and Note.

void MyWidget::resizedWindow ( QWidget *  )
signal
virtual void MyWidget::restore ( const QStringList &  )
inlinevirtual

Not implemented yet.

Reimplemented in Table, and Note.

Referenced by ApplicationWindow::openTemplate().

virtual QString MyWidget::saveAsTemplate ( const QString &  )
inlinevirtual

Reimplemented in Table, Graph3D, Matrix, and MultiLayer.

Referenced by ApplicationWindow::saveAsTemplate().

virtual QString MyWidget::saveToString ( const QString &  )
inlinevirtual
virtual void MyWidget::setBirthDate ( const QString &  s)
inlinevirtual
virtual void MyWidget::setCaptionPolicy ( CaptionPolicy  policy)
inlinevirtual
void MyWidget::setFolder ( Folder f)
inline
void MyWidget::setHidden ( )
virtual

Notifies that a window was hidden by a direct user action.

Reimplemented in MultiLayer.

References Hidden, statusChanged(), and w_status.

Referenced by ApplicationWindow::hideWindow().

void MyWidget::setMaximized ( )
void MyWidget::setMinimized ( )
virtual void MyWidget::setName ( const QString &  s)
inlinevirtual
void MyWidget::setNormal ( )
void MyWidget::setStatus ( Status  s)

Set the window status flag (hidden, normal, minimized or maximized)

References statusChanged(), and w_status.

Referenced by ApplicationWindow::changeFolder(), ApplicationWindow::restoreWindowGeometry(), and ApplicationWindow::updateWindowStatus().

virtual void MyWidget::setWindowLabel ( const QString &  s)
inlinevirtual
void MyWidget::showTitleBarMenu ( )
signal

Emitted when the title bar recieves a QContextMenuEvent.

Referenced by MultiLayer::eventFilter(), and eventFilter().

Status MyWidget::status ( )
inline
void MyWidget::statusChanged ( MyWidget )
signal

Emitted when the window status changed.

Referenced by changeEvent(), setHidden(), setMaximized(), setMinimized(), setNormal(), and setStatus().

void MyWidget::updateCaption ( )
protectedslot
virtual QString MyWidget::windowLabel ( )
inlinevirtual

Member Data Documentation

bool MyWidget::askOnClose
protected

Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.

Referenced by askOnCloseEvent(), Table::closeEvent(), Matrix::closeEvent(), closeEvent(), and MyWidget().

QString MyWidget::birthdate
protected
CaptionPolicy MyWidget::caption_policy
protected
Folder* MyWidget::parentFolder
protected

Pointer to the parent folder of the window.

Referenced by folder(), and setFolder().

QWidget* MyWidget::titleBar
protected

Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.

Referenced by changeEvent(), MultiLayer::eventFilter(), eventFilter(), and MyWidget().

QString MyWidget::w_label
protected
Status MyWidget::w_status
protected

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