From: Manuel Nickschas Date: Fri, 3 Feb 2012 12:04:08 +0000 (+0100) Subject: Work around problems in QTreeView when using Qt 4.8 X-Git-Tag: 0.8-beta1~29 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=79d9606c41f65c25df54758e064697208895d402 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... --- 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