[Qt-interest] Changing the size of the icon of a tree widget item
bar tomas
bartomas at gmail.com
Tue Mar 2 12:42:06 CET 2010
Thanks very much for your help.
I'm not using any QStyle. I've pasted a snippet of my code (PyQt)
below. As I said, the size I specify is completely ignored (but my
knowledge of Qt is pretty limited). Do you have any idea of what I'm
doing wrong?
Many thanks.
it=QTreeWidgetItem(parent,"item1")
icon = QIcon()
s=QSize( 22, 22)
pixM=QIcon.pixmap(icon, s)
pixM.load("images/logo.png")
icon.addPixmap(pixM, QIcon.Normal, QIcon.Off)
it.setIcon(0,icon)
On Mon, Mar 1, 2010 at 2:29 PM, Andre Somers <andre at familiesomers.nl> wrote:
> bar tomas wrote:
>> Hi,
>> Is it possible to change the size of the icon of a tree widget item?
>> I've tried to by setting the size of the icon's pixmap, but my
>> settings are completely ignored.
>> Maybe the size of an icon of a tree widget item is set by Qt to some
>> fixed size that can't be changed?
>> Many thanks
> Could it be an artifact of the QStyle you are using? I am creating a
> tree on Windows (XP) with Qt 4.6, and that tree shows icons in all the
> sizes I want them.
>
>
> André
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list