From 204fbd300b7494792c992ac58d5ff137ec27c002 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 29 Jan 2008 13:03:18 +0000 Subject: [PATCH] formated some alignment to Qt::AlignRight size,completed and speed git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@320 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/DLListDelegate.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/DLListDelegate.cpp b/retroshare-gui/src/gui/DLListDelegate.cpp index 0561122c2..ef9f2cf08 100644 --- a/retroshare-gui/src/gui/DLListDelegate.cpp +++ b/retroshare-gui/src/gui/DLListDelegate.cpp @@ -95,7 +95,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti multi *= 1024.0; } } - painter->drawText(option.rect, Qt::AlignCenter, temp); + painter->drawText(option.rect, Qt::AlignRight, temp); break; case REMAINING: remaining = index.data().toLongLong(); @@ -135,14 +135,14 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti multi *= 1024.0; } } - painter->drawText(option.rect, Qt::AlignCenter, temp); + painter->drawText(option.rect, Qt::AlignRight, temp); break; case DLSPEED: dlspeed = index.data().toDouble(); temp.clear(); temp.sprintf("%.2f", dlspeed/1024.); temp += " KB/s"; - painter->drawText(option.rect, Qt::AlignCenter, temp); + painter->drawText(option.rect, Qt::AlignRight, temp); break; case PROGRESS: progress = index.data().toDouble(); @@ -183,6 +183,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti QSize DLListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const { + return QSize(50,17); QVariant value = index.data(Qt::FontRole); QFont fnt = value.isValid() ? qvariant_cast(value) : option.font; QFontMetrics fontMetrics(fnt);