Image Component Library (ICL)
StringHandle.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLQt/src/ICLQt/StringHandle.h **
10 ** Module : ICLQt **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLQt/GUIHandle.h>
35 #include <QtCore/QString>
36 #include <string>
37 
39 class QLineEdit;
42 namespace icl{
43  namespace qt{
44 
46  class ICLQt_API StringHandle : public GUIHandle<QLineEdit>{
47  public:
50 
52  StringHandle(QLineEdit *le,std::string *str, GUIWidget *w):
53  GUIHandle<QLineEdit>(le,w),m_str(str){}
54 
56  void operator=(const std::string &text);
57 
59  void operator=(const QString &text){ (*this)=text.toLatin1().data(); }
60 
62  void operator=(const char *text) {(*this) = std::string(text); }
63 
65  std::string getValue() const;
66 
68  std::string getCurrentText() const;
69 
70  private:
71  std::string *m_str;
72  };
73  } // namespace qt
74 }
75 
void operator=(const QString &text)
makes the associated textfield show the given text
Definition: StringHandle.h:59
undocument this line if you encounter any issues!
Definition: Any.h:37
Class for handling "string" textfield components.
Definition: StringHandle.h:46
StringHandle(QLineEdit *le, std::string *str, GUIWidget *w)
Create a new Int handle.
Definition: StringHandle.h:52
ICLQt_API void text(ImgQ &image, int x, int y, const string &text)
renders a text into an image (only available with Qt-Support)
std::string * m_str
Definition: StringHandle.h:71
Abstract base class for Handle classes.
Definition: GUIHandle.h:40
StringHandle()
Creates an empty string handle.
Definition: StringHandle.h:49
Abstract class for GUI components.
Definition: GUIWidget.h:52
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
#define ICLQt_API
Definition: CompatMacros.h:178
void operator=(const char *text)
makes the associated textfield show the given text
Definition: StringHandle.h:62