Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#278 closed defect (fixed)

Qwidget setWinIcon()

Reported by: diver 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 diver

  • Resolution set to fixed
  • Status changed from new to closed

fixed in r1107

comment:2 Changed 7 years ago by dmik

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 dmik

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:4 Changed 7 years ago by dmik

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 diver

fixed in r1108

comment:6 Changed 7 years ago by diver

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:7 Changed 4 years ago by diver

  • Milestone changed from Qt 4.next to Qt 5

Milestone renamed

Note: See TracTickets for help on using tickets.