Image Component Library (ICL)
|
Main Class of ICL's GUI creation framework. More...
#include <GUI.h>
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... | |
GUI & | operator= (const GUI &other) |
gui-copy operator More... | |
virtual | ~GUI () |
Destructor. More... | |
virtual GUI & | operator<< (const GUIComponent &component) |
adds a new GUI component More... | |
virtual GUI & | operator<< (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... | |
GUIWidget * | getRootWidget () |
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 DataStore & | getDataStore () 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 GUI & | operator<< (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 |
GUIWidget * | m_poWidget |
DataStore | m_oDataStore |
bool | m_bCreated |
QWidget * | m_poParent |
Main Class of ICL's GUI creation framework.
Please refer to the ICL manual for details
typedef utils::Function<void> icl::qt::GUI::Callback |
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 |
typedef utils::Function<GUIWidget*,const GUIDefinition&> icl::qt::GUI::CreatorFunction |
registered widget type creator function
|
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 |
Destructor.
|
inline |
wraps the data-stores allocValue function
|
inline |
collects data from different components at once
|
virtual |
internally creates everything
|
private |
|
inlinestatic |
legacy creation method (use with care)
|
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
|
inline |
|
inline |
bool icl::qt::GUI::hasBeenCreated | ( | ) | const |
returns whether this GUI has been created or not
|
virtual |
make this gui invisible (nothing more)
|
inline |
|
virtual |
returns whether this gui is actually visible
|
inline |
internally locks the datastore
|
privatevirtual |
stream operator to add new widgets
if the given definition is "" or "dummy", this operator does nothing
|
virtual |
adds a new GUI component
|
inline |
returns a Data instance from the datastore
|
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
cb | callback to execute |
handleNamesList | 'listDelim'-separated list of handle names |
listDelim | delimiter 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 = ',' |
||
) |
|
inline |
wraps the datastores release function
void icl::qt::GUI::removeCallbacks | ( | const std::string & | handleNamesList, |
char | listDelim = ',' |
||
) |
removes all callbacks from components
|
virtual |
internally creates everything (and makes the gui visible)
|
virtual |
if widget is visible, this hides the widget, otherwise the widget is shown
|
staticprivate |
|
inline |
internally unlocks the data store
void icl::qt::GUI::waitForCreation | ( | ) |
waits for the gui to be created completely
|
static |
cell height (all sizes are given in this unit)
|
static |
cell width (all sizes are given in this unit)
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
own definition string