Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
icl::qt::GUI Class Reference

Main Class of ICL's GUI creation framework. More...

#include <GUI.h>

Inheritance diagram for icl::qt::GUI:
icl::qt::ChromaGUI icl::qt::ContainerGUIComponent icl::qt::DynamicGUI icl::qt::Border icl::qt::HBox icl::qt::HScroll icl::qt::HSplit icl::qt::Tab icl::qt::VBox icl::qt::VScroll icl::qt::VSplit

Public Types

typedef utils::Function
< GUIWidget *, const
GUIDefinition & > 
CreatorFunction
 registered widget type creator function More...
 
typedef utils::Function< void > Callback
 simple callback, that can be registered at GUI components More...
 
typedef utils::Function< void,
const std::string & > 
ComplexCallback
 complex callback type that can be registered at GUI components More...
 

Public Member Functions

 GUI (QWidget *parent=0)
 Default constructor, creates a vbox GUI Component. More...
 
 GUI (const GUIComponent &component, QWidget *parent=0)
 creates a GUI from a givne GUIComponent More...
 
 GUI (const GUI &gui, QWidget *parent=0)
 copy constructor More...
 
GUIoperator= (const GUI &other)
 gui-copy operator More...
 
virtual ~GUI ()
 Destructor. More...
 
virtual GUIoperator<< (const GUIComponent &component)
 adds a new GUI component More...
 
virtual GUIoperator<< (const GUI &g)
 stream operator to add new other GUIs More...
 
template<class T >
T & allocValue (const std::string &id, const T &val=T())
 wraps the data-stores allocValue function More...
 
template<class T >
void release (const std::string &id)
 wraps the datastores release function More...
 
template<class T >
T & get (const std::string &id, bool typeCheck=true)
 
DataStore::Data operator[] (const std::string &key)
 returns a Data instance from the datastore More...
 
template<class T >
std::vector< T > collect (const std::vector< std::string > &keys)
 collects data from different components at once More...
 
virtual bool isVisible () const
 returns whether this gui is actually visible More...
 
virtual void create ()
 internally creates everything More...
 
virtual void show ()
 internally creates everything (and makes the gui visible) More...
 
virtual void hide ()
 make this gui invisible (nothing more) More...
 
virtual void switchVisibility ()
 if widget is visible, this hides the widget, otherwise the widget is shown More...
 
GUIWidgetgetRootWidget ()
 returns the root widget of the gui (only avialable after create() or show()) More...
 
void lockData ()
 internally locks the datastore More...
 
void unlockData ()
 internally unlocks the data store More...
 
void waitForCreation ()
 waits for the gui to be created completely More...
 
const DataStoregetDataStore () const
 returns the GUI internal dataStore More...
 
void registerCallback (const Callback &cb, const std::string &handleNamesList, char listDelim=',')
 registers a callback function on each component More...
 
void registerCallback (const ComplexCallback &cb, const std::string &handleNamesList, char listDelim=',')
 registeres a complex callback at a given GUI component More...
 
void removeCallbacks (const std::string &handleNamesList, char listDelim=',')
 removes all callbacks from components More...
 
bool isDummy () const
 returns whether this GUI is a dummy GUI More...
 
bool hasBeenCreated () const
 returns whether this GUI has been created or not More...
 
std::string createXMLDescription () const
 creates a hierarchical xml-description of the GUI Layout More...
 

Static Public Member Functions

static void register_widget_type (const std::string &tag, CreatorFunction f)
 registers a new widget type More...
 
static GUI create_gui_from_string (const std::string &definition, QWidget *parent)
 legacy creation method (use with care) More...
 

Static Public Attributes

static const int CELLW = 20
 cell width (all sizes are given in this unit) More...
 
static const int CELLH = 20
 cell height (all sizes are given in this unit) More...
 

Protected Member Functions

 GUI (const std::string &definition, QWidget *parent)
 default constructor More...
 
virtual std::string createDefinition () const
 can be overwritten in subclasses (such as ContainerGUIComponent) More...
 

Private Member Functions

virtual GUIoperator<< (const std::string &definition)
 stream operator to add new widgets More...
 
void create (QLayout *parentLayout, ProxyLayout *proxy, QWidget *parentWidget, DataStore *ds)
 

Static Private Member Functions

static void to_string_recursive (const GUI *gui, std::ostream &str, int level)
 

Private Attributes

std::string m_sDefinition
 own definition string More...
 
std::vector< GUI * > m_children
 
GUIWidgetm_poWidget
 
DataStore m_oDataStore
 
bool m_bCreated
 
QWidget * m_poParent
 

Detailed Description

Main Class of ICL's GUI creation framework.

Please refer to the ICL manual for details

Member Typedef Documentation

simple callback, that can be registered at GUI components

Simple callback methods don't get any information about the source

typedef utils::Function<void, const std::string&> icl::qt::GUI::ComplexCallback

complex callback type that can be registered at GUI components

Complex callback methods get the GUI components handle name as parameters. By these means, single callbacks can be registered to several components and still be able to handle events differently

registered widget type creator function

Constructor & Destructor Documentation

icl::qt::GUI::GUI ( const std::string &  definition,
QWidget *  parent 
)
protected

default constructor

icl::qt::GUI::GUI ( QWidget *  parent = 0)

Default constructor, creates a vbox GUI Component.

icl::qt::GUI::GUI ( const GUIComponent component,
QWidget *  parent = 0 
)

creates a GUI from a givne GUIComponent

icl::qt::GUI::GUI ( const GUI gui,
QWidget *  parent = 0 
)

copy constructor

virtual icl::qt::GUI::~GUI ( )
virtual

Destructor.

Member Function Documentation

template<class T >
T& icl::qt::GUI::allocValue ( const std::string &  id,
const T &  val = T() 
)
inline

wraps the data-stores allocValue function

template<class T >
std::vector<T> icl::qt::GUI::collect ( const std::vector< std::string > &  keys)
inline

collects data from different components at once

virtual void icl::qt::GUI::create ( )
virtual

internally creates everything

void icl::qt::GUI::create ( QLayout *  parentLayout,
ProxyLayout proxy,
QWidget *  parentWidget,
DataStore ds 
)
private
static GUI icl::qt::GUI::create_gui_from_string ( const std::string &  definition,
QWidget *  parent 
)
inlinestatic

legacy creation method (use with care)

virtual std::string icl::qt::GUI::createDefinition ( ) const
inlineprotectedvirtual

can be overwritten in subclasses (such as ContainerGUIComponent)

Reimplemented in icl::qt::ContainerGUIComponent.

std::string icl::qt::GUI::createXMLDescription ( ) const

creates a hierarchical xml-description of the GUI Layout

template<class T >
T& icl::qt::GUI::get ( const std::string &  id,
bool  typeCheck = true 
)
inline
const DataStore& icl::qt::GUI::getDataStore ( ) const
inline

returns the GUI internal dataStore

GUIWidget* icl::qt::GUI::getRootWidget ( )
inline

returns the root widget of the gui (only avialable after create() or show())

bool icl::qt::GUI::hasBeenCreated ( ) const

returns whether this GUI has been created or not

virtual void icl::qt::GUI::hide ( )
virtual

make this gui invisible (nothing more)

bool icl::qt::GUI::isDummy ( ) const
inline

returns whether this GUI is a dummy GUI

Please note: dummy GUIs cannot be created are not added by the stream operator

virtual bool icl::qt::GUI::isVisible ( ) const
virtual

returns whether this gui is actually visible

void icl::qt::GUI::lockData ( )
inline

internally locks the datastore

virtual GUI& icl::qt::GUI::operator<< ( const std::string &  definition)
privatevirtual

stream operator to add new widgets

if the given definition is "" or "dummy", this operator does nothing

virtual GUI& icl::qt::GUI::operator<< ( const GUIComponent component)
virtual

adds a new GUI component

virtual GUI& icl::qt::GUI::operator<< ( const GUI g)
virtual

stream operator to add new other GUIs

if the given GUI is a dummy GUI, this operator does nothing

GUI& icl::qt::GUI::operator= ( const GUI other)

gui-copy operator

DataStore::Data icl::qt::GUI::operator[] ( const std::string &  key)
inline

returns a Data instance from the datastore

static void icl::qt::GUI::register_widget_type ( const std::string &  tag,
CreatorFunction  f 
)
static

registers a new widget type

The registered widget can then be added using a corresponding extension of the GUIComponent class

void icl::qt::GUI::registerCallback ( const Callback cb,
const std::string &  handleNamesList,
char  listDelim = ',' 
)

registers a callback function on each component

Parameters
cbcallback to execute
handleNamesList'listDelim'-separated list of handle names
listDelimdelimiter for the handle list ownership is passed to the childrens; deletion is performed by the smart pointers that are used...
void icl::qt::GUI::registerCallback ( const ComplexCallback cb,
const std::string &  handleNamesList,
char  listDelim = ',' 
)

registeres a complex callback at a given GUI component

complex callbacks are called with the actual GUI components handle name as parameter

template<class T >
void icl::qt::GUI::release ( const std::string &  id)
inline

wraps the datastores release function

void icl::qt::GUI::removeCallbacks ( const std::string &  handleNamesList,
char  listDelim = ',' 
)

removes all callbacks from components

virtual void icl::qt::GUI::show ( )
virtual

internally creates everything (and makes the gui visible)

virtual void icl::qt::GUI::switchVisibility ( )
virtual

if widget is visible, this hides the widget, otherwise the widget is shown

static void icl::qt::GUI::to_string_recursive ( const GUI gui,
std::ostream &  str,
int  level 
)
staticprivate
void icl::qt::GUI::unlockData ( )
inline

internally unlocks the data store

void icl::qt::GUI::waitForCreation ( )

waits for the gui to be created completely

Member Data Documentation

const int icl::qt::GUI::CELLH = 20
static

cell height (all sizes are given in this unit)

const int icl::qt::GUI::CELLW = 20
static

cell width (all sizes are given in this unit)

bool icl::qt::GUI::m_bCreated
private
std::vector<GUI*> icl::qt::GUI::m_children
private
DataStore icl::qt::GUI::m_oDataStore
private
QWidget* icl::qt::GUI::m_poParent
private
GUIWidget* icl::qt::GUI::m_poWidget
private
std::string icl::qt::GUI::m_sDefinition
private

own definition string


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