Changeset 306 for trunk/src/gui/widgets


Ignore:
Timestamp:
Nov 9, 2009, 5:24:09 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: QPushButton: Fixed: Deactivating the window with a push button showing a popup menu would hide the popup but leave the button pressed due to different native event order [vendor bug].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/widgets/qpushbutton.cpp

    r2 r306  
    612612    if (guard) {
    613613        menuOpen = false;
    614         q->setDown(false);
     614        // on some platforms (e.g. OS/2) QPushButton::focusOutEvent() may be called
     615        // before we return from exec() above (for example, as a result of window
     616        // deactivation). It will set down to false but since menuOpen won't be
     617        // false yet, the button will be redrawn as sunken still. Simple setDown(false)
     618        // won't do anything in this case so we need to call update() instead to make
     619        // sure the button is redrawn as unsunken.
     620        if (down)
     621            q->setDown(false);
     622        else
     623            q->update();
    615624    }
    616625}
Note: See TracChangeset for help on using the changeset viewer.