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

MDI sub window that implements functions common to all aspect views. More...

#include <PartMdiView.h>

List of all members.

Public Types

enum  SubWindowStatus { Closed, Hidden, Visible }

Signals

void statusChanged (PartMdiView *view, PartMdiView::SubWindowStatus from, PartMdiView::SubWindowStatus to)

Public Member Functions

AbstractPartpart () 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.
AbstractPartd_part
 The aspect that owns the view.
SubWindowStatus d_status

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
Closed 
Hidden 
Visible 

Constructor & Destructor Documentation

PartMdiView::PartMdiView ( AbstractPart part,
QWidget *  embedded_view 
)

Construct a view owned by the given aspect.

References d_part, handleAspectAboutToBeRemoved(), handleAspectDescriptionChanged(), and AbstractAspect::icon().

PartMdiView::~PartMdiView ( )
virtual

Member Function Documentation

void PartMdiView::closeEvent ( QCloseEvent *  event)
protectedvirtual

When I'm being closed, remove my Aspect from its parent.

References Closed, d_closing, d_part, d_status, AbstractAspect::remove(), and statusChanged().

void PartMdiView::contextMenuEvent ( QContextMenuEvent *  event)
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.

void PartMdiView::handleAspectAboutToBeRemoved ( const AbstractAspect aspect)
privateslot

References d_closing, and d_part.

Referenced by PartMdiView().

void PartMdiView::handleAspectDescriptionChanged ( const AbstractAspect aspect)
privateslot

Keep my window title in sync with AbstractAspect::caption().

References AbstractAspect::caption(), and d_part.

Referenced by PartMdiView().

void PartMdiView::hideEvent ( QHideEvent *  event)
protectedvirtual

References d_status, Hidden, and statusChanged().

AbstractPart* PartMdiView::part ( ) const
inline

Returns the part that owns the view.

References d_part.

void PartMdiView::showEvent ( QShowEvent *  event)
protectedvirtual

References d_status, statusChanged(), and Visible.

SubWindowStatus PartMdiView::status ( ) const
inline

References d_status.

void PartMdiView::statusChanged ( PartMdiView view,
PartMdiView::SubWindowStatus  from,
PartMdiView::SubWindowStatus  to 
)
signal

Referenced by closeEvent(), hideEvent(), and showEvent().


Member Data Documentation

bool PartMdiView::d_closing
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().

AbstractPart* PartMdiView::d_part
private
SubWindowStatus PartMdiView::d_status
private

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