From a5ac742c1fbb667f037574a928c9aec8b6352932 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Fri, 27 Jul 2007 16:10:50 +0000 Subject: [PATCH] - Fixed (workaround, maybe Qt's bug?) for transfers list background painting problem. --- TODO | 1 - src/DLListDelegate.h | 13 +++-- src/FinishedListDelegate.h | 13 +++-- src/MainWindow.ui | 99 +++++++++++++++++++++++++++++--------- 4 files changed, 95 insertions(+), 31 deletions(-) diff --git a/TODO b/TODO index f946fbe42..b4e5bcfc0 100644 --- a/TODO +++ b/TODO @@ -42,7 +42,6 @@ - Windows port (Chris - Peerkoel) - Translations update - Optimize and cleanup code - - check painting problems in dl list - Wait for some bug fixes in libtorrent : - upload/download limit per torrent - double free or corruption on exit diff --git a/src/DLListDelegate.h b/src/DLListDelegate.h index ca7db1f51..8700db9ab 100644 --- a/src/DLListDelegate.h +++ b/src/DLListDelegate.h @@ -72,10 +72,15 @@ class DLListDelegate: public QAbstractItemDelegate { } painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Highlight)); }else{ - value = index.data(Qt::BackgroundColorRole); - if (value.isValid() && qvariant_cast(value).isValid()){ - painter->fillRect(option.rect, qvariant_cast(value)); - } + painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Base)); + // The following should work but is broken (retry with future versions of Qt) +// QVariant value = index.data(Qt::BackgroundRole); +// if (qVariantCanConvert(value)) { +// QPointF oldBO = painter->brushOrigin(); +// painter->setBrushOrigin(option.rect.topLeft()); +// painter->fillRect(option.rect, qvariant_cast(value)); +// painter->setBrushOrigin(oldBO); +// } } } switch(index.column()){ diff --git a/src/FinishedListDelegate.h b/src/FinishedListDelegate.h index 0c1035a52..7cb1dde22 100644 --- a/src/FinishedListDelegate.h +++ b/src/FinishedListDelegate.h @@ -70,10 +70,15 @@ class FinishedListDelegate: public QAbstractItemDelegate { } painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Highlight)); }else{ - value = index.data(Qt::BackgroundColorRole); - if (value.isValid() && qvariant_cast(value).isValid()){ - painter->fillRect(option.rect, qvariant_cast(value)); - } + painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Base)); + // The following should work but is broken (retry with future versions of Qt) +// QVariant value = index.data(Qt::BackgroundRole); +// if (qVariantCanConvert(value)) { +// QPointF oldBO = painter->brushOrigin(); +// painter->setBrushOrigin(option.rect.topLeft()); +// painter->fillRect(option.rect, qvariant_cast(value)); +// painter->setBrushOrigin(oldBO); +// } } } switch(index.column()){ diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 1fc7bf4f7..5e43031cf 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -17,12 +17,21 @@ - - 9 - 6 + + 9 + + + 9 + + + 9 + + + 9 + @@ -36,28 +45,55 @@ Downloads - - 9 - 6 + + 9 + + + 9 + + + 9 + + + 9 + - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -275,18 +311,25 @@ Log - - 9 - 6 + + 9 + + + 9 + + + 9 + + + 9 + - - 7 - 7 + 0 0 @@ -309,12 +352,21 @@ IP filter - - 9 - 6 + + 9 + + + 9 + + + 9 + + + 9 + @@ -408,7 +460,10 @@ - 4 + TopToolBarArea + + + false