PDA

View Full Version : How to set alignment of widget has been added into QTreewiget?



developerUIT
21st March 2014, 11:56
Hi All,

I have problem with QTreeWidget.

I have added a label or Button into QTreeWidget by:


QLabel *status = new QLabel("<a href=\"" + QString::number(count) + "\"><img src=\":/images/status.png\" align=\"right\"></a>");
status->setTextFormat(Qt::RichText);
QTreeWidgetItem *statusItem = item;
ui->listMyPortals->setItemWidget(statusItem ,3 , status);

And seems like it always on right. I want to alignment it become to center of cell.

I hope somebody can help me.

Thanks

wysota
21st March 2014, 15:15
It is "on the right" of what?

ChrisW67
22nd March 2014, 02:40
The image is always on the right like the HTML asks for?

Perhaps developerUIT is looking for QLabel::setAlignment()