diff --git a/UI/item-widget-helpers.cpp b/UI/item-widget-helpers.cpp index b1444f933..b10c957c1 100644 --- a/UI/item-widget-helpers.cpp +++ b/UI/item-widget-helpers.cpp @@ -37,8 +37,10 @@ void DeleteListItem(QListWidget *widget, QListWidgetItem *item) void ClearListItems(QListWidget *widget) { +#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) // Workaround for the SceneTree workaround for QTBUG-105870 widget->setProperty("clearing", true); +#endif widget->setCurrentItem(nullptr, QItemSelectionModel::Clear); @@ -46,5 +48,8 @@ void ClearListItems(QListWidget *widget) delete widget->itemWidget(widget->item(i)); widget->clear(); +#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) + // Workaround for the SceneTree workaround for QTBUG-105870 widget->setProperty("clearing", false); +#endif } diff --git a/UI/scene-tree.cpp b/UI/scene-tree.cpp index 544405173..5cad22571 100644 --- a/UI/scene-tree.cpp +++ b/UI/scene-tree.cpp @@ -248,6 +248,7 @@ void SceneTree::rowsInserted(const QModelIndex &parent, int start, int end) QListWidget::rowsInserted(parent, start, end); } +#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) // Workaround for QTBUG-105870. Remove once that is solved upstream. void SceneTree::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) @@ -256,3 +257,4 @@ void SceneTree::selectionChanged(const QItemSelection &selected, !property("clearing").toBool()) setCurrentRow(deselected.indexes().front().row()); } +#endif diff --git a/UI/scene-tree.hpp b/UI/scene-tree.hpp index b80918f14..0950f12ea 100644 --- a/UI/scene-tree.hpp +++ b/UI/scene-tree.hpp @@ -38,9 +38,11 @@ protected: virtual void dragLeaveEvent(QDragLeaveEvent *event) override; virtual void rowsInserted(const QModelIndex &parent, int start, int end) override; +#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override; +#endif signals: void scenesReordered();