From 13d7692a89331ef4183ba3307bb9f5d3c916b4eb Mon Sep 17 00:00:00 2001 From: unknown <1310440+hemirt@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:38:32 +0200 Subject: [PATCH] add older version code --- src/widgets/helper/NotebookTab.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index 42d9d4340..8b08c1bbd 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -307,11 +307,20 @@ bool NotebookTab::isSelected() const void NotebookTab::updateHighlightSources( const QHash &removedHighlightSources) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) for (const auto &[otherChannel, otherEvent] : removedHighlightSources.asKeyValueRange()) { this->highlightSources_.remove(otherChannel); } +#else + for (auto it = removedHighlightSources.cbegin(), + end = removedHighlightSources.cend(); + it != end; ++it) + { + this->highlightSources_.remove(it.key()); + } +#endif if (this->highlightSources_.empty()) { @@ -324,7 +333,7 @@ void NotebookTab::setSelected(bool value) { this->selected_ = value; - if (value == true) + if (value) { auto *splitNotebook = dynamic_cast(this->notebook_); if (splitNotebook)