mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added for Uploads progess xprogressbar
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@715 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
174c3f7377
commit
9ca175308d
@ -122,23 +122,14 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
||||
painter->drawText(option.rect, Qt::AlignRight, temp);
|
||||
break;
|
||||
case UPROGRESS:
|
||||
{
|
||||
progress = index.data().toDouble();
|
||||
temp.clear();
|
||||
temp.sprintf("%.2f", progress);
|
||||
temp += "%";
|
||||
newopt.rect = opt.rect;
|
||||
//newopt.text = temp;
|
||||
newopt.maximum = 100;
|
||||
newopt.minimum = 0;
|
||||
newopt.progress = (int)progress;
|
||||
newopt.state |= QStyle::State_Enabled;
|
||||
newopt.textVisible = false;
|
||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt,
|
||||
painter);
|
||||
//We prefer to display text manually to control color/font/boldness
|
||||
if (option.state & QStyle::State_Selected){
|
||||
opt.palette.setColor(QPalette::Text, QColor("grey"));
|
||||
painter->setPen(opt.palette.color(cg, QPalette::Text));
|
||||
// create a xProgressBar
|
||||
xProgressBar progressBar(option.rect, painter); // the 3rd param is the color schema (0 is the default value)
|
||||
progressBar.setDisplayText(false); // should display % text?
|
||||
progressBar.setValue(progress); // set the progress value
|
||||
progressBar.setVerticalSpan(1);
|
||||
progressBar.paint(); // paint the progress bar
|
||||
}
|
||||
painter->drawText(option.rect, Qt::AlignCenter, newopt.text);
|
||||
break;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#define ULLISTDELEGATE_H
|
||||
|
||||
#include <QAbstractItemDelegate>
|
||||
#include "xprogressbar.h"
|
||||
|
||||
// Defines for upload list list columns
|
||||
#define USERNAME 0
|
||||
|
Loading…
Reference in New Issue
Block a user