From 6baf045c4c2ca5388dd8867fe12ff40a6aea4680 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 12 Aug 2017 12:20:51 +0200 Subject: [PATCH] Chat input no longer accepts rich text Fix #96 --- src/widgets/resizingtextedit.cpp | 1 + src/widgets/resizingtextedit.hpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/resizingtextedit.cpp b/src/widgets/resizingtextedit.cpp index 779e9eca3..494201024 100644 --- a/src/widgets/resizingtextedit.cpp +++ b/src/widgets/resizingtextedit.cpp @@ -6,6 +6,7 @@ ResizingTextEdit::ResizingTextEdit() sizePolicy.setHeightForWidth(true); sizePolicy.setVerticalPolicy(QSizePolicy::Preferred); this->setSizePolicy(sizePolicy); + this->setAcceptRichText(false); QObject::connect(this, &QTextEdit::textChanged, this, &QWidget::updateGeometry); diff --git a/src/widgets/resizingtextedit.hpp b/src/widgets/resizingtextedit.hpp index ba76092d2..59098b4ca 100644 --- a/src/widgets/resizingtextedit.hpp +++ b/src/widgets/resizingtextedit.hpp @@ -20,8 +20,8 @@ public: QCompleter *getCompleter() const; protected: - int heightForWidth(int) const override; - void keyPressEvent(QKeyEvent *event) override; + virtual int heightForWidth(int) const override; + virtual void keyPressEvent(QKeyEvent *event) override; private: QCompleter *completer = nullptr;