Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#278 closed defect (fixed)

Qwidget setWinIcon()

Reported by: Silvan Scherrer Owned by:
Priority: major Milestone: Qt 5
Component: QtGui Version: 4.7.3
Severity: low Keywords:
Cc:

Description

the above function doesn't work as expected. It sets the icon the first time ok, but when a app wants to change the icon later it doesn't work.
The reason is, that in qwidget.cpp setWindowsIcon() the iconPixmap is deleted which is ok. But then in qwidget_pm.cpp setWindowsIcon_sys() it has a if for iconPointer. As this wasn't deleted earlier it's still available and so the new icon is not set.

Change History (7)

comment:1 Changed 7 years ago by Silvan Scherrer

Resolution: fixed
Status: newclosed

fixed in r1107

comment:2 Changed 7 years ago by Dmitry A. Kuminov

Silvan, your fix is not quite correct. The 'iconPixmap' field is never used on OS/2 and is always 0. As a result, after your patch, the icon would have been always re-created from scratch which is not optimal. It should be enough to change #6062 in qwidget.cpp from

    d->setWindowIcon_sys();

to

    d->setWindowIcon_sys(true);

to cause the internal icon representation to be re-created each time when a new QIcon object is passed in.

Please try this (remember to rollback r1107 first!) and report if it works.

comment:3 Changed 7 years ago by Dmitry A. Kuminov

Resolution: fixed
Status: closedreopened

comment:4 Changed 7 years ago by Dmitry A. Kuminov

To correct myself: it would not have been re-created each time since you create a new QPixmap object indeed but it's a bit overwhelming to use a complex QPixmap object just as a boolean flag in this case -- as like I said this field itself is not needed on OS/2.

comment:5 Changed 7 years ago by Silvan Scherrer

fixed in r1108

comment:6 Changed 7 years ago by Silvan Scherrer

Resolution: fixed
Status: reopenedclosed

comment:7 Changed 5 years ago by Silvan Scherrer

Milestone: Qt 4.nextQt 5

Milestone renamed

Note: See TracTickets for help on using tickets.