synthclone  0.3.0
synthclone::View Class Reference

Utility view class. More...

#include <synthclone/view.h>

Inheritance diagram for synthclone::View:
Collaboration diagram for synthclone::View:

Public Slots

virtual void setCloseEnabled (bool enabled)
 Enables/disables closing for this view. More...
 
virtual void setVisible (bool visible)
 Sets the visibility of the root widget. More...
 

Signals

void closeEnabledChanged (bool enabled)
 Emitted when closing is enabled/disabled. More...
 
void closeRequest ()
 Emitted when a root widget's close button is pressed. More...
 
void visibilityChanged (bool visible)
 Emitted when the visibility flag for the view changes. More...
 

Public Member Functions

bool isCloseEnabled () const
 Gets a boolean indicating whether or not closing of this view is enabled. More...
 
bool isVisible () const
 Gets a boolean indicating whether or not the view is visible. More...
 

Protected Member Functions

 View (QWidget *rootWidget, QObject *parent=0)
 Constructs a new View. More...
 
virtual ~View ()
 Destroys the View object. More...
 
const QWidget * getRootWidget () const
 Gets the root widget for this view. More...
 
QWidget * getRootWidget ()
 Gets the root widget for this view. More...
 

Detailed Description

Utility view class.

Captures any close event and emits a signal instead of requiring the subclassing of a widget.

Views based on this class attempt to build on the 'passive view' design pattern, meaning that the view knows nothing about the model, and is subject to the will of the controller.

Constructor & Destructor Documentation

synthclone::View::View ( QWidget *  rootWidget,
QObject *  parent = 0 
)
explicitprotected

Constructs a new View.

This class is not meant to be called directly; instead, subclass constructors should call this constructor.

Parameters
rootWidgetThe root widget for this View.
parentThe parent object of this View.
virtual synthclone::View::~View ( )
protectedvirtual

Destroys the View object.

Member Function Documentation

void synthclone::View::closeEnabledChanged ( bool  enabled)
signal

Emitted when closing is enabled/disabled.

Parameters
enabledWhether or not closing is enabled.
void synthclone::View::closeRequest ( )
signal

Emitted when a root widget's close button is pressed.

const QWidget* synthclone::View::getRootWidget ( ) const
protected

Gets the root widget for this view.

Returns
The root widget.
QWidget* synthclone::View::getRootWidget ( )
protected

Gets the root widget for this view.

Returns
The root widget.
bool synthclone::View::isCloseEnabled ( ) const

Gets a boolean indicating whether or not closing of this view is enabled.

Returns
The boolean.
bool synthclone::View::isVisible ( ) const

Gets a boolean indicating whether or not the view is visible.

Returns
The boolean.
virtual void synthclone::View::setCloseEnabled ( bool  enabled)
virtualslot

Enables/disables closing for this view.

If closing is disabled, closeRequest() signals will not be raised when a user presses the close button in the taskbar. Closing is enabled by default.

Parameters
enabledWhether or not closing is enabled.
virtual void synthclone::View::setVisible ( bool  visible)
virtualslot

Sets the visibility of the root widget.

Parameters
visibleWhether or not the root widget should be visible.
void synthclone::View::visibilityChanged ( bool  visible)
signal

Emitted when the visibility flag for the view changes.

Parameters
visibleThe updated visibility flag.

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