mirror-chatterino2/widgets/textinputdialog.h

46 lines
749 B
C
Raw Normal View History

2017-01-17 00:15:44 +01:00
#ifndef TEXTINPUTDIALOG_H
#define TEXTINPUTDIALOG_H
#include <QDialog>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include <QString>
#include <QVBoxLayout>
2017-04-14 17:52:22 +02:00
namespace chatterino {
namespace widgets {
2017-01-18 21:30:23 +01:00
2017-01-17 00:15:44 +01:00
class TextInputDialog : public QDialog
{
Q_OBJECT
public:
TextInputDialog(QWidget *parent = NULL);
2017-04-12 17:46:44 +02:00
QString getText() const
2017-01-17 00:15:44 +01:00
{
2017-04-12 17:46:44 +02:00
return _lineEdit.text();
2017-01-17 00:15:44 +01:00
}
2017-04-12 17:46:44 +02:00
void setText(const QString &text)
2017-01-17 00:15:44 +01:00
{
2017-04-12 17:46:44 +02:00
_lineEdit.setText(text);
2017-01-17 00:15:44 +01:00
}
private:
2017-04-12 17:46:44 +02:00
QVBoxLayout _vbox;
QLineEdit _lineEdit;
QHBoxLayout _buttonBox;
QPushButton _okButton;
QPushButton _cancelButton;
2017-01-17 00:15:44 +01:00
2017-01-17 00:42:32 +01:00
private slots:
2017-01-17 00:15:44 +01:00
void okButtonClicked();
void cancelButtonClicked();
};
2017-01-18 21:30:23 +01:00
}
}
2017-01-17 00:15:44 +01:00
#endif // TEXTINPUTDIALOG_H