All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Slots | Public Member Functions
Qtilities::Examples::MainWindow::ExampleMode Class Reference

An example mode widget which demonstrates the dynamic side widget architecture. More...

#include <ExampleMode.h>

Inheritance diagram for Qtilities::Examples::MainWindow::ExampleMode:
Inheritance graph
[legend]

List of all members.

Public Slots

void handleNewFileSystemWidget (QWidget *widget)
 Slot which handles new side widget file system instances being produced.
void loadFile (const QString &file_name)
 Loads file into text editor.

Public Member Functions

QString contextHelpId () const
 Returns a help ID for this context.
QString contextString () const
 Returns a context string for the context associated with this mode.
void initializeMode ()
 This function is called in the initializeDependencies() function, thus all objects implementing interfaces in which a mode might be interested will be present in the global object pool.
QIcon modeIcon () const
 An icon for the mode.
int modeID () const
 Returns a unique ID for this mode.
QString modeName () const
 The name of the mode which is the text used to represent it.
QWidget * modeWidget ()
 The main window's central widget for the mode.
QObject * objectBase ()
 Returns the QObject* base of the interface.
const QObject * objectBase () const
 Returns a const QObject* base of the interface.
- Public Member Functions inherited from Qtilities::CoreGui::Interfaces::IMode
virtual void aboutToBeActivated ()
 This function is called when the mode is about to be activated. That is, when the user clicks on the mode and it is going to become the active mode.
virtual void justActivated ()
 This function is called after a mode was activated. That is, when the user clicked on the mode and it became the active mode.
virtual bool setModeIcon (QIcon icon)
 A function which can be implemented by modes if they allow their icon to be changed. By default this function does nothing and returns false.
void setModeID (int mode_id)
 Sets the mode ID for this mode.
void setTargetManagerIDs (QList< int > new_target_manager_ids)
 Sets the list of mode managers in which this mode must appear.
int supportedExtensionWidgetLocations () const
 Returns the supported locations of extension widgets in this mode.
QList< int > targetManagerIDs () const
 Gets the list of mode managers in which this mode must appear.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase
QString objectOriginID () const
 Allows interfaces to provide some sort of source identification.
void setObjectOriginID (const QString &object_origin_id)
 Allows setting of the object source ID of this interface implementation.

Detailed Description

An example mode widget which demonstrates the dynamic side widget architecture.


Member Function Documentation

QString Qtilities::Examples::MainWindow::ExampleMode::contextString ( ) const
inlinevirtual

Returns a context string for the context associated with this mode.

By default no context will be associated with a mode.

Reimplemented from Qtilities::CoreGui::Interfaces::IMode.

QIcon Qtilities::Examples::MainWindow::ExampleMode::modeIcon ( ) const
virtual

An icon for the mode.

The expected mode icon size is 48x48.

See also:
setModeIcon()

Implements Qtilities::CoreGui::Interfaces::IMode.

int Qtilities::Examples::MainWindow::ExampleMode::modeID ( ) const
inlinevirtual

Returns a unique ID for this mode.

A mode ID is an unique number which is associated with a mode in an application. This allows modes with the same name to be added if desired. From the developer's perspective you don't have to reimplement this function in your interface implementation. In that case the Qtilities::CoreGui::ModeManager class will assign an unique mode ID when the mode is added to the mode manager and a debug message will be printed with information about the newly assigned mode ID.

It is however desired to specify your own mode ID in some cases, more specifically if you use the Qtilities::CoreGui::DynamicSideWidgetViewer widget in your application and you want dynamic side viewer widgets to appear only in specific application modes. To achieve this your modeID() must appear in the list of Qtilities::CoreGui::Interfaces::ISideViewerWidget::destinationModes() for a specific side viewer widget implementation.

Note:
Mode IDs available for user modes range from 100 - 999. The mode manager starts to auto-assign unique mode IDs from 1000 onwards for modes which does not have their own IDs.

Reimplemented from Qtilities::CoreGui::Interfaces::IMode.

QWidget * Qtilities::Examples::MainWindow::ExampleMode::modeWidget ( )
virtual

The main window's central widget for the mode.

This widget must have a proper layout in order to be displayed correctly.

Implements Qtilities::CoreGui::Interfaces::IMode.

const QObject* Qtilities::Examples::MainWindow::ExampleMode::objectBase ( ) const
inlinevirtual

Returns a const QObject* base of the interface.

This function can be used in const methods, but make sure that you don't modify things that should stay const. An example where this is used is when we want to get a property on an object in a const method. This is a const operation.

Implements Qtilities::Core::Interfaces::IObjectBase.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé