tuchulcha  0.10.1
Graphical Workflow Configuration Editor
QTextInputDialog.h
Go to the documentation of this file.
1 /* Copyright (C) 2013 Jens-Malte Gottfried
2 
3  This file is part of Tuchulcha.
4 
5  Tuchulcha is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Tuchulcha is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Tuchulcha. If not, see <http://www.gnu.org/licenses/>.
17 */
23 #ifndef QTEXTINPUTDIALOG_H
24 #define QTEXTINPUTDIALOG_H
25 
26 #include <QDialog>
27 #include <QLineEdit>
28 
29 class QLabel;
30 
32 
33 class QTextInputDialog : public QDialog
34 {
35  Q_OBJECT
37  Q_PROPERTY(QString labelText READ labelText WRITE setLabelText)
39  Q_PROPERTY(QString textValue READ textValue WRITE setTextValue NOTIFY textValueChanged)
41  Q_PROPERTY(QLineEdit::EchoMode textEchoMode READ textEchoMode WRITE setTextEchoMode)
42 
43 public:
45 
48  explicit QTextInputDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
50 
52 
64  static QString getText (
65  QWidget * parent, const QString & title,
66  const QString & label,
67  QLineEdit::EchoMode mode = QLineEdit::Normal,
68  const QString & text = QString(),
69  bool * ok = 0,
70  Qt::WindowFlags flags = 0,
71  Qt::InputMethodHints iHints = Qt::ImhNone,
72  QValidator* val = 0);
73 
76  QString labelText() const;
77  void setLabelText(const QString&);
78  QString textValue() const;
79  void setTextValue(const QString&);
80  QLineEdit::EchoMode textEchoMode() const;
81  void setTextEchoMode(QLineEdit::EchoMode);
82  const QValidator* validator() const;
83  void setValidator(const QValidator*);
84 
86 signals:
87  void textValueChanged(const QString&);
88  void textValueSelected(const QString &);
89 
90 protected:
91  QLabel *lText;
92  QLineEdit *eText;
93  virtual void done (int result);
94 };
95 
96 #endif // QTEXTINPUTDIALOG_H
QLineEdit * eText
text line edit
QLabel * lText
text label
void setTextValue(const QString &)
set line edit text
void textValueChanged(const QString &)
changed text
QLineEdit::EchoMode textEchoMode() const
text echo mode
void setLabelText(const QString &)
set label text
QString textValue() const
line edit text
void setValidator(const QValidator *)
set validator
const QValidator * validator() const
text validator
QString labelText() const
label text
dialog to query a string variable, similar to QInputDialog
void textValueSelected(const QString &)
text selected
virtual void done(int result)
dialog done
static QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode=QLineEdit::Normal, const QString &text=QString(), bool *ok=0, Qt::WindowFlags flags=0, Qt::InputMethodHints iHints=Qt::ImhNone, QValidator *val=0)
get text
void setTextEchoMode(QLineEdit::EchoMode)
set text echo mode