File indexing completed on 2024-04-21 05:45:48
0001 /******************************************************************************* 0002 * Copyright (C) 2018 Alexander Volkov <a.volkov@rusbitech.ru> * 0003 * * 0004 * This program is free software: you can redistribute it and/or modify it * 0005 * under the terms of the GNU General Public License as published by the Free * 0006 * Software Foundation, either version 3 of the License, or (at your option) * 0007 * any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT * 0010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * 0011 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * 0012 * more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License along * 0015 * with this program. If not, see <http://www.gnu.org/licenses/>. * 0016 *******************************************************************************/ 0017 0018 #ifndef TEXTINPUTDIALOG_H 0019 #define TEXTINPUTDIALOG_H 0020 0021 #include <QDialog> 0022 0023 class QLabel; 0024 class QLineEdit; 0025 class QValidator; 0026 0027 class TextInputDialog : public QDialog 0028 { 0029 public: 0030 explicit TextInputDialog(QWidget *parent = nullptr); 0031 0032 void setLabelText(const QString &text); 0033 0034 QString textValue() const; 0035 void setTextValue(const QString &resolution); 0036 0037 void setValidator(const QValidator *v); 0038 0039 static QString getText(QWidget *parent, const QString &title, const QString &label, const QString &text, const QValidator *v, bool *ok); 0040 0041 private: 0042 QLabel *m_label; 0043 QLineEdit *m_lineEdit; 0044 }; 0045 0046 #endif // TEXTINPUTDIALOG_H