40 #include <QApplication> 68 GUI(
const std::string &definition, QWidget *parent);
78 static void register_widget_type(
const std::string &tag,
CreatorFunction f);
81 static const int CELLW = 20;
83 static const int CELLH = 20;
86 GUI(QWidget *parent=0);
92 GUI(
const GUI &gui,QWidget *parent=0);
95 GUI &operator=(
const GUI &other);
109 inline T &
allocValue(
const std::string &
id,
const T&val=T()){
110 return m_oDataStore.allocValue<T>(id,val);
116 m_oDataStore.release<T>(id);
120 T &
get(
const std::string &
id,
bool typeCheck=
true){
121 return m_oDataStore.getValue<T>(id,typeCheck);
126 return m_oDataStore.operator[](key);
131 std::vector<T>
collect(
const std::vector<std::string> &keys){
132 return m_oDataStore.collect<T>(keys);
136 virtual bool isVisible()
const;
148 virtual void switchVisibility();
161 m_oDataStore.unlock();
164 void waitForCreation();
187 void registerCallback(
const Callback &cb,
const std::string &handleNamesList,
char listDelim=
',');
191 void registerCallback(
const ComplexCallback &cb,
const std::string &handleNamesList,
char listDelim=
',');
194 void removeCallbacks(
const std::string &handleNamesList,
char listDelim=
',');
201 inline bool isDummy()
const {
return m_sDefinition ==
"" || m_sDefinition ==
"dummy"; }
204 bool hasBeenCreated()
const;
208 return GUI(definition, parent);
212 std::string createXMLDescription()
const;
220 static void to_string_recursive(
const GUI *gui, std::ostream &
str,
int level);
static GUI create_gui_from_string(const std::string &definition, QWidget *parent)
legacy creation method (use with care)
Definition: GUI.h:207
The General Function Template.
Definition: Function.h:284
Extension of the associative container MultiTypeMap.
Definition: DataStore.h:47
undocument this line if you encounter any issues!
Definition: Any.h:37
QWidget * m_poParent
Definition: GUI.h:230
Main Class of ICL's GUI creation framework.
Definition: GUI.h:60
ICLQt_API core::Img< T > create(const std::string &name, core::format fmt=icl::core::formatRGB)
create a test image (converted to destination core::format) (affinity for floats)
bool m_bCreated
Definition: GUI.h:229
void lockData()
internally locks the datastore
Definition: GUI.h:156
std::string m_sDefinition
own definition string
Definition: GUI.h:225
GUIWidget * getRootWidget()
returns the root widget of the gui (only avialable after create() or show())
Definition: GUI.h:151
T & get(const std::string &id, bool typeCheck=true)
Definition: GUI.h:120
T & allocValue(const std::string &id, const T &val=T())
wraps the data-stores allocValue function
Definition: GUI.h:109
just a helper class for GUI Layouting
Definition: ProxyLayout.h:43
const DataStore & getDataStore() const
returns the GUI internal dataStore
Definition: GUI.h:167
void release(const std::string &id)
wraps the datastores release function
Definition: GUI.h:115
virtual std::string createDefinition() const
can be overwritten in subclasses (such as ContainerGUIComponent)
Definition: GUI.h:216
utils::Function< void, const std::string & > ComplexCallback
complex callback type that can be registered at GUI components
Definition: GUI.h:177
DataStore::Data operator[](const std::string &key)
returns a Data instance from the datastore
Definition: GUI.h:125
ICLUtils_API std::ostream & operator<<(std::ostream &s, const ConfigFile &cf)
Default ostream operator to put a ConfigFile into a stream.
The GUIComponent class servers as a generic interface for GUI definitions.
Definition: GUIComponent.h:44
GUIWidget * m_poWidget
Definition: GUI.h:227
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
std::vector< T > collect(const std::vector< std::string > &keys)
collects data from different components at once
Definition: GUI.h:131
utils::Function< void > Callback
simple callback, that can be registered at GUI components
Definition: GUI.h:171
#define ICLQt_API
Definition: CompatMacros.h:178
Arbitrary Data encapsulation type.
Definition: DataStore.h:63
void unlockData()
internally unlocks the data store
Definition: GUI.h:160
std::vector< GUI * > m_children
Definition: GUI.h:226
DataStore m_oDataStore
Definition: GUI.h:228
utils::Function< GUIWidget *, const GUIDefinition & > CreatorFunction
registered widget type creator function
Definition: GUI.h:73
bool isDummy() const
returns whether this GUI is a dummy GUI
Definition: GUI.h:201
ICLQt_API void show(const icl::core::ImgBase &image)
shows an image using TestImages::show