mirror-chatterino2/src/widgets/textinputdialog.hpp

46 lines
758 B
C++
Raw Normal View History

#pragma once
2017-01-17 00:15:44 +01:00
#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 = nullptr);
2017-01-17 00:15:44 +01:00
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
}
void highlightText();
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();
};
} // namespace widgets
} // namespace chatterino