No, it won't.
public:
int val = ind.data(Qt::DisplayRole).toInt();
rect.setWidth(rect.width()*val/100);
p->drawRect(rect);
}
};
item->setText(1, 40);
// view will be updated here
item->setText(1, 60);
// view will be updated here
class Dele : public QItemDelegate {
public:
void paint(QPainter *p, const .... &opt, const QModelIndex &ind const {
int val = ind.data(Qt::DisplayRole).toInt();
QRect rect = opt.rect;
rect.setWidth(rect.width()*val/100);
p->drawRect(rect);
}
};
QTreeWidget Item *item = ....
item->setText(1, 40);
// view will be updated here
item->setText(1, 60);
// view will be updated here
To copy to clipboard, switch view to plain text mode
You have at least two almost complete solution on the very first page of this thread. Didn't you see them?
Bookmarks