From 7ce0ebfee75a01d28b8fa94836456d6f557521f5 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Mon, 20 Apr 2015 09:28:26 +0000 Subject: [PATCH] Ifdef the code which does manual relayout on compact view toggle to Qt < 5.4 (QTBUG-33537) --- qt/mainwin.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt/mainwin.cc b/qt/mainwin.cc index 1ee503c2e..9b7fb5318 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -1048,16 +1048,20 @@ TrMainWindow::refreshPref (int key) break; case Prefs::COMPACT_VIEW: { +#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) // QTBUG-33537 QItemSelectionModel * selectionModel (ui.listView->selectionModel ()); const QItemSelection selection (selectionModel->selection ()); const QModelIndex currentIndex (selectionModel->currentIndex ()); +#endif b = myPrefs.getBool (key); ui.action_CompactView->setChecked (b); ui.listView->setItemDelegate (b ? myTorrentDelegateMin : myTorrentDelegate); +#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) // QTBUG-33537 selectionModel->clear (); ui.listView->reset (); // force the rows to resize selectionModel->select (selection, QItemSelectionModel::Select); selectionModel->setCurrentIndex (currentIndex, QItemSelectionModel::NoUpdate); +#endif break; } -- 2.49.0