#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 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
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 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 by , 12 years ago
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:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
fixed in r1107