Tulip  5.2.0
Large graphs analysis and drawing
StringEditor.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
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 #ifndef STRINGEDITOR_H
22 #define STRINGEDITOR_H
23 
24 #include <QString>
25 #include <QTextEdit>
26 #include <QDialog>
27 
28 #include <tulip/tulipconf.h>
29 
30 namespace tlp {
31 /**
32 * @brief Simple String edition widget.
33 **/
34 class TLP_QT_SCOPE StringEditor : public QDialog {
35  QString currentString;
36  QTextEdit *edit;
37 
38 public:
39  explicit StringEditor(QWidget *parent = nullptr);
40 
41  QString getString() const;
42  void setString(const QString &qstr);
43 
44  // redefinition to ensure it is shown in the center of its parent
45  void showEvent(QShowEvent *ev) override;
46 
47 public slots:
48  // redefinition to ensure to catch the end of input
49  void done(int r) override;
50 };
51 }
52 
53 #endif // STRINGEDITOR_H
54 ///@endcond