aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/querydialog.hpp
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-10 15:39:33 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-10 20:47:18 +0200
commit7a7d9dc216ecf0bf7200666b479fb08c0edec834 (patch)
tree30957e51979a26f5baaf54e0c3f193d9689fe92c /src/widgets/querydialog.hpp
parent8cb79ee6711b3db3f138db6367752053f45efc17 (diff)
Replace QInputDialog with custom dialog for queriesquery-dialog
Recent commits allowed multi-line input while reusing the QInputDialog object already defined by Kristall. However, QInputDialog lacks a way to access its QPlainTextEdit directly, and therefore set the wrap mode. Since QInputDialog does no wrapping, it is inconvenient for writing a long text (think of social media sites such as BBS or Station). Therefore, a custom QDialog-derived class, namely QueryDialog, has been provided.
Diffstat (limited to 'src/widgets/querydialog.hpp')
-rw-r--r--src/widgets/querydialog.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/widgets/querydialog.hpp b/src/widgets/querydialog.hpp
new file mode 100644
index 0000000..d3ea71a
--- /dev/null
+++ b/src/widgets/querydialog.hpp
@@ -0,0 +1,20 @@
+#ifndef QUERYDIALOG_H
+#define QUERYDIALOG_H
+
+#include "ui_querydialog.h"
+#include <QDialog>
+#include <QLineEdit>
+#include <QString>
+
+class QueryDialog : public QDialog {
+public:
+ QueryDialog(QWidget *parent);
+ void setLabelText(const QString &text);
+ void setTextEchoMode(QLineEdit::EchoMode mode);
+ QString textValue();
+private:
+ Ui_QueryDialog ui;
+ QLineEdit::EchoMode mode;
+};
+
+#endif