qt - How to change value of QProgressBar in QTreeWidgetItem? -


i'm receiving signal parametres (current, total) , each time i'm suppose alter value of progressbar inside qtreewidgetitem. source code. have:

qmap<qxmpptransferjob*, transferitemwidget*> widget_map;

and add here new items

void mainwindow::additem(qxmpptransferjob *job) {     qtreewidgetitem *item = new qtreewidgetitem(ui->treewidget);      widget_map[job] = new transferitemwidget;     widget_map[job]->filenamelabel->settext(job->filename());     widget_map[job]->barejidlabel->settext(job->jid());      ui->treewidget->setitemwidget(item,0,widget_map[job]); } 

and each time when receive signal there implemented following slot:

void mainwindow::progress(qint64 &current, qint64 &total) {     qxmpptransferjob *job = (qxmpptransferjob*)qobject::sender();     widget_map[job]->progressbar->setmaximum(total);     widget_map[job]->progressbar->setvalue(current); } 

progressbar isn't changing value remains same? can guide me through find mistake


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -