VirtualBox

Changeset 75672 in vbox


Ignore:
Timestamp:
Nov 22, 2018 3:15:29 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126866
Message:

FE/Qt: bugref:8694: Make sure Close VM Dialog is opened at proper position in multi-screen environment with different system scale-factors.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp

    r72887 r75672  
    104104bool UIVMCloseDialog::event(QEvent *pEvent)
    105105{
    106     /* Handle know event types: */
     106    /* Pre-process in base-class: */
     107    const bool fResult = QIWithRetranslateUI<QIDialog>::event(pEvent);
     108
     109    /* Post-process know event types: */
    107110    switch (pEvent->type())
    108111    {
    109         case QEvent::Show:
    110112        case QEvent::ScreenChangeInternal:
    111113        {
    112114            /* Update pixmaps: */
    113115            updatePixmaps();
    114 
    115             // NOTE:
    116             // This thing works after QEvent::Show but isn't
    117             // working after QEvent::ScreenChangeInternal,
    118             // because it is too early, layout isn't calculated.
    119             // We want to "force" it to work, just no idea how.
    120             // Resize to minimum size-hint:
    121             resize(minimumSizeHint());
    122 
    123116            break;
    124117        }
     
    127120    }
    128121
     122    /* Return pre-processed result: */
     123    return fResult;
     124}
     125
     126void UIVMCloseDialog::showEvent(QShowEvent *pEvent)
     127{
     128    /* Update pixmaps: */
     129    updatePixmaps();
     130
    129131    /* Call to base-class: */
    130     return QIWithRetranslateUI<QIDialog>::event(pEvent);
     132    QIWithRetranslateUI<QIDialog>::showEvent(pEvent);
    131133}
    132134
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.h

    r72887 r75672  
    6363    /** Handles any Qt @a pEvent. */
    6464    virtual bool event(QEvent *pEvent) /* override */;
     65
     66    /** Handles show @a pEvent. */
     67    virtual void showEvent(QShowEvent *pEvent) /* override */;
    6568
    6669    /** Handles translation event. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette