From 79d9606c41f65c25df54758e064697208895d402 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 3 Feb 2012 13:04:08 +0100 Subject: [PATCH] Work around problems in QTreeView when using Qt 4.8 Looks like having animated QTreeViews lead to problems with rendering nested trees. This affects both the NickView and BufferView. Maybe it's something in our code, but looks like simply disabling animations for Qt >= 4.8 does the trick as well... --- src/uisupport/bufferview.cpp | 5 ++++- src/uisupport/nickview.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index b2fbc0fb..ef1d927d 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -65,11 +65,14 @@ void BufferView::init() { hideColumn(1); hideColumn(2); setIndentation(10); + expandAll(); header()->hide(); // nobody seems to use this anyway - setAnimated(true); + // breaks with Qt 4.8 + if(QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10! + setAnimated(true); // FIXME This is to workaround bug #663 setUniformRowHeights(true); diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index bdba62f9..34fb554e 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -44,7 +44,6 @@ NickView::NickView(QWidget *parent) : QTreeView(parent) { setIndentation(10); - setAnimated(true); header()->hide(); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setSortingEnabled(true); @@ -53,6 +52,10 @@ NickView::NickView(QWidget *parent) setContextMenuPolicy(Qt::CustomContextMenu); setSelectionMode(QAbstractItemView::ExtendedSelection); + // breaks with Qt 4.8 + if(QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10! + setAnimated(true); + connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(showContextMenu(const QPoint&))); #if defined Q_WS_QWS || defined Q_WS_X11 -- 2.20.1