SciDAVis
1.D4
|
MDI sub window that implements functions common to all aspect views. More...
#include <PartMdiView.h>
Public Types | |
enum | SubWindowStatus { Closed, Hidden, Visible } |
Signals | |
void | statusChanged (PartMdiView *view, PartMdiView::SubWindowStatus from, PartMdiView::SubWindowStatus to) |
Public Member Functions | |
AbstractPart * | part () const |
Returns the part that owns the view. | |
PartMdiView (AbstractPart *part, QWidget *embedded_view) | |
Construct a view owned by the given aspect. | |
SubWindowStatus | status () const |
virtual | ~PartMdiView () |
Protected Member Functions | |
virtual void | closeEvent (QCloseEvent *event) |
When I'm being closed, remove my Aspect from its parent. | |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
Show a context menu for the view and the aspect. | |
virtual void | hideEvent (QHideEvent *event) |
virtual void | showEvent (QShowEvent *event) |
Private Slots | |
void | handleAspectAboutToBeRemoved (const AbstractAspect *aspect) |
void | handleAspectDescriptionChanged (const AbstractAspect *aspect) |
Keep my window title in sync with AbstractAspect::caption(). |
Private Attributes | |
bool | d_closing |
Whether I'm just being closed. | |
AbstractPart * | d_part |
The aspect that owns the view. | |
SubWindowStatus | d_status |
MDI sub window that implements functions common to all aspect views.
This class is to be subclassed for every aspect. Every aspect owns a view that is shown in the ProjectWindow's MDI area. In addition to the functionality provided by QMdiSubWindow, this class automatically updates the window title when AbstractAspect::caption() changes, removes the Aspect when the MDI window is closed (the user is asked then whether he wants to hide the window or remove the aspect). It also provides access to the aspect's context menu.
PartMdiView::PartMdiView | ( | AbstractPart * | part, |
QWidget * | embedded_view | ||
) |
Construct a view owned by the given aspect.
References d_part, handleAspectAboutToBeRemoved(), handleAspectDescriptionChanged(), and AbstractAspect::icon().
|
virtual |
|
protectedvirtual |
When I'm being closed, remove my Aspect from its parent.
References Closed, d_closing, d_part, d_status, AbstractAspect::remove(), and statusChanged().
|
protectedvirtual |
Show a context menu for the view and the aspect.
This creates a view context menu with createContextMenu and then appends a context menu from the aspect to it. Then the context menu is presented to the user.
References AbstractPart::createContextMenu(), and d_part.
|
privateslot |
References d_closing, and d_part.
Referenced by PartMdiView().
|
privateslot |
Keep my window title in sync with AbstractAspect::caption().
References AbstractAspect::caption(), and d_part.
Referenced by PartMdiView().
|
protectedvirtual |
References d_status, Hidden, and statusChanged().
|
inline |
Returns the part that owns the view.
References d_part.
|
protectedvirtual |
References d_status, statusChanged(), and Visible.
|
inline |
References d_status.
|
signal |
Referenced by closeEvent(), hideEvent(), and showEvent().
|
private |
Whether I'm just being closed.
Depending on whether an Aspect is removed programatically or by closing its default view (held by me), either aspectAboutToBeRemoved() generates a close event for me or closeEvent() removes d_part from its parent. Before one causes the other to be called, d_closing is set to true so as to avoid infinite recursion.
Referenced by closeEvent(), and handleAspectAboutToBeRemoved().
|
private |
The aspect that owns the view.
Referenced by closeEvent(), contextMenuEvent(), handleAspectAboutToBeRemoved(), handleAspectDescriptionChanged(), part(), and PartMdiView().
|
private |
Referenced by closeEvent(), hideEvent(), showEvent(), and status().