From 6d97b7f19824e36caee34219e02e7bbe7ec29fa1 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 10 Oct 2023 15:39:33 +0200 Subject: Replace QInputDialog with custom dialog for queries 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. --- src/widgets/querydialog.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/widgets/querydialog.hpp (limited to 'src/widgets/querydialog.hpp') 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 +#include +#include + +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 -- cgit v1.2.3