-changend order of the columns

-set correct Alignment for each column

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@348 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2008-02-16 22:42:34 +00:00
parent 3f582afe5a
commit 0234c5f5cf
2 changed files with 12 additions and 10 deletions

View File

@ -93,7 +93,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0; multi *= 1024.0;
} }
} }
painter->drawText(option.rect, Qt::AlignCenter, temp); painter->drawText(option.rect, Qt::AlignRight, temp);
break; break;
case UTRANSFERRED: case UTRANSFERRED:
transferred = index.data().toLongLong(); transferred = index.data().toLongLong();
@ -112,14 +112,14 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0; multi *= 1024.0;
} }
} }
painter->drawText(option.rect, Qt::AlignCenter, temp); painter->drawText(option.rect, Qt::AlignRight, temp);
break; break;
case ULSPEED: case ULSPEED:
ulspeed = index.data().toDouble(); ulspeed = index.data().toDouble();
temp.clear(); temp.clear();
temp.sprintf("%.2f", ulspeed/1024.); temp.sprintf("%.2f", ulspeed/1024.);
temp += " KB/s"; temp += " KB/s";
painter->drawText(option.rect, Qt::AlignCenter, temp); painter->drawText(option.rect, Qt::AlignRight, temp);
break; break;
case UPROGRESS: case UPROGRESS:
progress = index.data().toDouble(); progress = index.data().toDouble();
@ -153,6 +153,9 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
} }
painter->drawText(option.rect.translated(pixmap.size().width(), 0), Qt::AlignLeft, index.data().toString()); painter->drawText(option.rect.translated(pixmap.size().width(), 0), Qt::AlignLeft, index.data().toString());
break; break;
case USTATUS:
painter->drawText(option.rect.translated(pixmap.size().width(), 0), Qt::AlignLeft, index.data().toString());
break;
default: default:
painter->drawText(option.rect, Qt::AlignCenter, index.data().toString()); painter->drawText(option.rect, Qt::AlignCenter, index.data().toString());
} }

View File

@ -25,14 +25,13 @@
#include <QAbstractItemDelegate> #include <QAbstractItemDelegate>
// Defines for upload list list columns // Defines for upload list list columns
#define UNAME 0 #define USERNAME 0
#define USERNAME 1 #define UNAME 1
#define USIZE 2 #define ULSPEED 2
#define UPROGRESS 3 #define UTRANSFERRED 3
#define ULSPEED 4 #define UPROGRESS 4
#define USTATUS 5 #define USTATUS 5
#define UTRANSFERRED 6 #define USIZE 6
#define MAX_CHAR_TMP 128 #define MAX_CHAR_TMP 128