VirtualBox

Changeset 11343 in vbox for trunk/src


Ignore:
Timestamp:
Aug 11, 2008 6:03:38 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34486
Message:

Fe/Qt4: Enabling auto-centering (according parent) mechanism for QIMainDialog. This is directly influent to Virtual Disk Manager opened mode-less (with no parent passed).

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIMainDialog.h

    r10934 r11343  
    5959
    6060    virtual bool event (QEvent *aEvent);
     61    virtual void showEvent (QShowEvent *aEvent);
    6162    virtual void resizeEvent (QResizeEvent *aEvent);
    6263    virtual bool eventFilter (QObject *aObject, QEvent *aEvent);
     
    8485    QPointer<QSizeGrip> mSizeGrip;
    8586    QPointer<QPushButton> mDefaultButton;
     87
     88    bool mPolished;
    8689};
    8790
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIMainDialog.cpp

    r10934 r11343  
    2323#include "QIMainDialog.h"
    2424#include "VBoxUtils.h"
     25#include "VBoxGlobal.h"
    2526
    2627#include <iprt/assert.h>
     
    4243    : QMainWindow (aParent, aFlags)
    4344    , mRescode (QDialog::Rejected)
     45    , mPolished (false)
    4446{
    4547    qApp->installEventFilter (this);
     
    212214}
    213215
     216void QIMainDialog::showEvent (QShowEvent *aEvent)
     217{
     218        QMainWindow::showEvent (aEvent);
     219
     220    /* Polishing border */
     221    if (mPolished)
     222        return;
     223    mPolished = true;
     224
     225    /* Explicit widget centering relatively to it's parent
     226     * if any or desktop if parent is missed. */
     227    vboxGlobal().centerWidget (this, parentWidget(), false);
     228}
     229
    214230void QIMainDialog::resizeEvent (QResizeEvent *aEvent)
    215231{
Note: See TracChangeset for help on using the changeset viewer.

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