From c5457a893fa34972fbe58004e86ff32001b5a182 Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 12 Feb 2026 17:33:32 +0000 Subject: [PATCH] Fix tests --- autotests/chatmarkdownhelpertestwrapper.h | 2 -- autotests/chattextitemhelpertest.qml | 5 +++++ autotests/chattextitemhelpertesthelper.h | 6 +++++- autotests/modeltest.cpp | 2 +- src/chatbar/ChatBarCore.qml | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/autotests/chatmarkdownhelpertestwrapper.h b/autotests/chatmarkdownhelpertestwrapper.h index 3f1e04177..5689b5e10 100644 --- a/autotests/chatmarkdownhelpertestwrapper.h +++ b/autotests/chatmarkdownhelpertestwrapper.h @@ -48,7 +48,6 @@ public: if (!doc) { return false; } - // qWarning() << doc->toPlainText() <toPlainText(); } @@ -58,7 +57,6 @@ public: if (cursor.isNull()) { return false; } - // qWarning() << RichFormat::formatsAtCursor(cursor) <setFixedChars(startChars, endChars); } @@ -138,10 +141,11 @@ public: if (!m_textItem) { return; } - const auto textItem = new ChatTextItemHelper(); + const auto textItem = new ChatTextItemHelper(this); textItem->setTextItem(item); textItem->setCursorPosition(cursorPos); m_textItem->setCursorFromTextItem(textItem, infront); + textItem->deleteLater(); } Q_INVOKABLE void mergeFormatOnCursor(RichFormat::Format format) diff --git a/autotests/modeltest.cpp b/autotests/modeltest.cpp index f542d43f7..7399af754 100644 --- a/autotests/modeltest.cpp +++ b/autotests/modeltest.cpp @@ -181,7 +181,7 @@ void ModelTest::testRoomTreeModel() void ModelTest::testMessageContentModel() { auto contentModel = std::make_unique(room, eventId); - auto tester = new QAbstractItemModelTester(contentModel.get()); + auto tester = new QAbstractItemModelTester(contentModel.get(), contentModel.get()); tester->setUseFetchMore(true); } diff --git a/src/chatbar/ChatBarCore.qml b/src/chatbar/ChatBarCore.qml index dff408d4b..8fe229b06 100644 --- a/src/chatbar/ChatBarCore.qml +++ b/src/chatbar/ChatBarCore.qml @@ -95,7 +95,7 @@ QQC2.Control { } width: chatScrollView.width - spacing: Kirigami.Units.smallSpacing + spacing: 0 Repeater { id: chatContentView