Qt-interest Archive, November 2007
QStandardItem with QIcon question
Message 1 in thread
Hi Everyone,
I use QT 4.2.3 now for my GUI application. I have a QTableView
with QStandardItemModel inside. I would like to put QIcon as
item in this model. But I found the icon will always align to left if
I create as below :
QStandardItem* pItem=new QStandardItem(QIcon(iconFile), " ");
m_pMyModel->setItem(nRow, nColumn, pItem);
But I want the QIcon to align horizontal center.
I tried the setTextAlignment for QStandardItem and not working.
Could anybody help me out ?
Regards,
Pagan
--
[ signature omitted ]
Message 2 in thread
Is there anyone can help me out ?
"Pagan Chou" <pagan_chou@xxxxxxxxxxxxxx> ¦b¶l¥ó
news:fgm3tt$1bm$1@xxxxxxxxxxxxxxxxxx ¤¤¼¶¼g...
> Hi Everyone,
> I use QT 4.2.3 now for my GUI application. I have a QTableView
> with QStandardItemModel inside. I would like to put QIcon as
> item in this model. But I found the icon will always align to left if
> I create as below :
>
> QStandardItem* pItem=new QStandardItem(QIcon(iconFile), " ");
> m_pMyModel->setItem(nRow, nColumn, pItem);
>
> But I want the QIcon to align horizontal center.
>
> I tried the setTextAlignment for QStandardItem and not working.
>
> Could anybody help me out ?
>
> Regards,
> Pagan
>
>
--
[ signature omitted ]