Tulip  4.8.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
StringEditor.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 
22 #ifndef STRINGEDITOR_H
23 #define STRINGEDITOR_H
24 
25 #include <QString>
26 #include <QTextEdit>
27 #include <QDialog>
28 
29 #include <tulip/tulipconf.h>
30 
31 namespace tlp {
32 /**
33 * @brief Simple String edition widget.
34 **/
35 class TLP_QT_SCOPE StringEditor : public QDialog {
36  QString currentString;
37  QTextEdit* edit;
38 
39 public:
40  explicit StringEditor(QWidget *parent = NULL);
41 
42  QString getString() const;
43  void setString(const QString& qstr);
44 
45  // redefinition to ensure it is shown in the center of its parent
46  void showEvent(QShowEvent* ev);
47 
48 public slots:
49  // redefinition to ensure to catch the end of input
50  void done(int r);
51 };
52 }
53 
54 #endif // STRINGEDITOR_H
55 ///@endcond