Window Class Reference

Class for the application's windows, both the main window and additional windows. More...

#include <Window.h>

List of all members.

Public Slots

void updateWindowTitle (const QString &panelTypeName)
 Updates the window title according to the given panel type name if there is only one panel in the window.
void duplicatePanelFrame (PanelFrame *panelFrame)
 Duplicates the given panel frame by creating a new window.
void extractPanelFrame (PanelFrame *panelFrame)
 Extracts the given panel frame to a new window.
void closePanelFrame (PanelFrame *panelFrame)
 Closes and deletes the given panel.

Signals

void windowActivated (Window *window)
 Signal that is emitted when the window has become active.
void windowRenamed (Window *window)
 Signal that is emitted when the window's title has changed.
void windowClosed (Window *window, QCloseEvent *event)
 Signal that is emitted when the window has been closed.
void createWindowRequested (const QString &panelTypeName, const QPoint &position, const QSize &panelSize)
 Signal that is emitted when a new window should be created.
void viewPanelCreated (ViewPanel *viewPanel)
 Signal that is emitted when a ViewPanel-derived widget has been created for the window.
void nodeContextMenuRequested (const QPoint &position)
 Signal to notify connected objects that the context menu for creating new nodes should be displayed at the given position.

Public Member Functions

 Window (QObject *parent, const QString &applicationName, const QString &title, const QString &layoutName, bool isMainWindow=false)
 Constructor of the Window class.
virtual ~Window ()
 Destructor of the Window class.
void getLayoutSettings (QSettings &settings, QObject *rootChild) const
 Returns the window layout state.
QWidget * setLayoutSettings (QSettings &settings, QString index="0")
 Sets the window layout states.
void setLayoutIds (QObject *rootChild)
 Insert unique IDs to the splitter and panel wedget names.
bool isMainWindow ()
 Returns whether the window is the application's main window.
bool hasDocumentation ()
 Returns whether the window contains a documentation panel.
void showDocumentationMainPage ()
 Opens the documentation main page in the first documentation panel found in the window's layout.
QString title ()
 Returns the window's title.
void setTitle (const QString &title)
 Sets the window's title.
void setFullscreen (bool fullscreen)
 Set fullscreen.
void clearLayout ()
 Deletes all layout widgets on contral widget.

Static Public Attributes

static const QString DefaultLayout = "Default"
 The name of the default window layout.
static const QString SingleViewLayout = "Single View"
 The name of the window layout with only a single view.
static const QString FullscreenViewLayout = "Fullscreen View"
 The name of the window layout with a fullscreen view.

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event)
 Event handler for context menu events.
void changeEvent (QEvent *event)
 Event handler for widget state change events.
void closeEvent (QCloseEvent *event)
 Event handler for widget close events.

Private Slots

void applyDefaultLayout ()
 Apply the default layout on the window.
void applyViewportOnlyLayout ()
 Apply the viewport layout on the window, which means that only a viewport panel is displayed.

Private Member Functions

void applyLayout (const QString &layoutName, Panel::Type panelType=Panel::T_Viewport)
 Applies the layout with the given name to the window. The given panel type is used only in specific layouts.

Private Attributes

QString m_applicationName
 The name of the application that this window is a part of.
bool m_isMainWindow
 Flag that states whether the window is the application's main window.
QString m_title
 The window's title.


Detailed Description

Class for the application's windows, both the main window and additional windows.

Inheritance Diagram

inline_dotgraph_19.dot
[legend]

Constructor & Destructor Documentation

Window::Window ( QObject *  parent,
const QString &  applicationName,
const QString &  title,
const QString &  layoutName,
bool  isMainWindow = false 
)

Constructor of the Window class.

Constructors and Destructors.

Creates a new application window using the given layout.

Parameters:
parent The parent object (should be the Application object).
applicationName The name of the application that the window will be a part of.
title The title to give to the new window.
layoutName The name of the layout to apply to the window.
isMainWindow Flag that states whether the window to create is the application's main window.
Constructor of the Window class.

Creates a new application window using the layout with the given name.

Parameters:
parent The parent object (should be the Application object).
applicationName The name of the application that the window will be a part of.
title The title to give to the new window.
layoutName The name of the layout to apply to the window.
isMainWindow Flag that states whether the window to create is the application's main window.

Window::~Window (  )  [virtual]

Destructor of the Window class.

Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.


Member Function Documentation

void Window::getLayoutSettings ( QSettings &  settings,
QObject *  rootChild 
) const

Returns the window layout state.

Public Functions.

Parameters:
settings The window layout settings state reference.
rootChild The root widget.
Returns the window layout state

Parameters:
settings The window layout settings state reference.
rootChild The root widget.

QWidget * Window::setLayoutSettings ( QSettings &  settings,
QString  index = "0" 
)

Sets the window layout states.

Parameters:
The window layout settings state reference.
rootChild The root widget.

void Window::setLayoutIds ( QObject *  rootChild  ) 

Insert unique IDs to the splitter and panel wedget names.

bool Window::isMainWindow (  ) 

Returns whether the window is the application's main window.

Returns:
True if the window is the application's main window, otherwise False.

bool Window::hasDocumentation (  ) 

Returns whether the window contains a documentation panel.

Returns:
True if the window contains a documentation panel, otherwise False.

void Window::showDocumentationMainPage (  ) 

Opens the documentation main page in the first documentation panel found in the window's layout.

QString Window::title (  ) 

Returns the window's title.

Returns:
The window's title.

void Window::setTitle ( const QString &  title  ) 

Sets the window's title.

Parameters:
title The title to set for the window.

void Window::setFullscreen ( bool  fullscreen  ) 

Set fullscreen.

void Window::clearLayout (  ) 

Deletes all layout widgets on contral widget.

void Window::updateWindowTitle ( const QString &  panelTypeName  )  [slot]

Updates the window title according to the given panel type name if there is only one panel in the window.

Public Slots.

Parameters:
panelTypeName The name of the new panel type.
Updates the window title according to the given panel type name if there is only one panel in the window.

Parameters:
panelTypeName The name of the new panel type.

void Window::duplicatePanelFrame ( PanelFrame panelFrame  )  [slot]

Duplicates the given panel frame by creating a new window.

Duplicates the given panel by creating a new window.

Parameters:
panelFrame The panel frame to duplicate.

void Window::extractPanelFrame ( PanelFrame panelFrame  )  [slot]

Extracts the given panel frame to a new window.

Parameters:
panelFrame The panel frame to extract to a new window.

void Window::closePanelFrame ( PanelFrame panelFrame  )  [slot]

Closes and deletes the given panel.

Closes and deletes the given panel frame.

Parameters:
panelFrame The panel frame to close.

void Window::windowActivated ( Window window  )  [signal]

Signal that is emitted when the window has become active.

Parameters:
window The window that was activated.

void Window::windowRenamed ( Window window  )  [signal]

Signal that is emitted when the window's title has changed.

Parameters:
window The window whose title has been changed.

void Window::windowClosed ( Window window,
QCloseEvent *  event 
) [signal]

Signal that is emitted when the window has been closed.

Parameters:
window The window that has been closed.
event The object containing details about the window close event.

void Window::createWindowRequested ( const QString &  panelTypeName,
const QPoint &  position,
const QSize &  panelSize 
) [signal]

Signal that is emitted when a new window should be created.

Parameters:
panelTypeName The name of the panel type that the new window should contain.
position The position for the new window.
panelSize The size of the panel to be contained in the new window.

void Window::viewPanelCreated ( ViewPanel viewPanel  )  [signal]

Signal that is emitted when a ViewPanel-derived widget has been created for the window.

Parameters:
viewPanel The ViewPanel-derived widget that has been created for the window.

void Window::nodeContextMenuRequested ( const QPoint &  position  )  [signal]

Signal to notify connected objects that the context menu for creating new nodes should be displayed at the given position.

Parameters:
position The position at which to display the node context menu.

void Window::contextMenuEvent ( QContextMenuEvent *  event  )  [protected]

Event handler for context menu events.

Protected Events.

Parameters:
event The object that contains details about the event.
Event handler for context menu events.

Parameters:
event The object that contains details about the event.

void Window::changeEvent ( QEvent *  event  )  [protected]

Event handler for widget state change events.

Parameters:
event The object that contains details about the event.

void Window::closeEvent ( QCloseEvent *  event  )  [protected]

Event handler for widget close events.

Parameters:
event The object that contains details about the event.

void Window::applyLayout ( const QString &  layoutName,
Panel::Type  panelType = Panel::T_Viewport 
) [private]

Applies the layout with the given name to the window. The given panel type is used only in specific layouts.

Private Functions.

Parameters:
layoutName The name of the layout to apply to the window.
panelType A panel type that is used only in specific layout.
Applies the layout with the given name to the window. The given panel type is used only in specific layouts.

Parameters:
layoutName The name of the layout to apply to the window.
panelType A panel type that is used only in specific layout.

void Window::applyDefaultLayout (  )  [private, slot]

Apply the default layout on the window.

Private Slots.

void Window::applyViewportOnlyLayout (  )  [private, slot]

Apply the viewport layout on the window, which means that only a viewport panel is displayed.


Member Data Documentation

const QString Window::DefaultLayout = "Default" [static]

The name of the default window layout.

Static Constants.

const QString Window::SingleViewLayout = "Single View" [static]

The name of the window layout with only a single view.

const QString Window::FullscreenViewLayout = "Fullscreen View" [static]

The name of the window layout with a fullscreen view.

QString Window::m_applicationName [private]

The name of the application that this window is a part of.

bool Window::m_isMainWindow [private]

Flag that states whether the window is the application's main window.

QString Window::m_title [private]

The window's title.


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

Generated on Wed Feb 24 15:01:04 2010 for Frapper by  doxygen 1.5.9