VirtualBox

Changeset 8915 in vbox


Ignore:
Timestamp:
May 19, 2008 12:11:49 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30970
Message:

FE/Qt4: set/mainWidget is deprecated so create our own place to store that bit of information.

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

Legend:

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

    r8785 r8915  
    166166    VBoxConsoleWnd &consoleWnd();
    167167
     168    /* main window handle storage */
     169    void setMainWindow (QWidget *aMainWindow) { mMainWindow = aMainWindow; }
     170    QWidget *mainWindow() const { return mMainWindow; }
     171
     172
    168173    bool isVMConsoleProcess() const { return !vmUuid.isNull(); }
    169174    QUuid managedVMUuid() const { return vmUuid; }
     
    623628    VBoxSelectorWnd *mSelectorWnd;
    624629    VBoxConsoleWnd *mConsoleWnd;
     630    QWidget* mMainWindow;
    625631
    626632#ifdef VBOX_WITH_REGISTRATION
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFBQuartz2D.cpp

    r8155 r8915  
    157157    Assert (mImage);
    158158
    159     QWidget *pMain = qApp->mainWidget();
    160     Assert (VALID_PTR (pMain));
     159    QWidget *main = vboxGlobal().mainWindow();
     160    Assert (VALID_PTR (main));
    161161    QWidget* viewport = mView->viewport();
    162162    Assert (VALID_PTR (viewport));
     
    171171    Assert (VALID_PTR (ctx));
    172172    /* We handle the seamless mode as a special case. */
    173     if (qobject_cast <VBoxConsoleWnd *> (pMain)->isTrueSeamless())
     173    if (qobject_cast <VBoxConsoleWnd *> (main)->isTrueSeamless())
    174174    {
    175175        /* Here we paint the windows without any wallpaper.
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r8895 r8915  
    222222                    {
    223223                        if (sVal.isEmpty() ||
    224                             sVal == QString ("%1").arg ((long)qApp->mainWidget()->winId()))
     224                            sVal == QString ("%1").arg (static_cast<long> (vboxGlobal().mainWindow()->winId())))
    225225                            *allowChange = TRUE;
    226226                        else
     
    272272                        QApplication::postEvent (&mGlobal, new VBoxCanShowRegDlgEvent (true));
    273273                    }
    274                     else if (sVal == QString ("%1").arg ((long) qApp->mainWidget()->winId()))
     274                    else if (sVal == QString ("%1").arg (static_cast<long> (vboxGlobal().mainWindow()->winId())))
    275275                    {
    276276                        mIsRegDlgOwner = true;
     
    33363336            QString result;
    33373337
    3338             QWidget *topParent = mParent ? mParent->window() : qApp->mainWidget();
     3338            QWidget *topParent = mParent ? mParent->window() : vboxGlobal()->mainWindow();
    33393339            QString title = mCaption.isNull() ? tr ("Select a directory") : mCaption;
    33403340
     
    34853485            QString title = mCaption.isNull() ? tr ("Select a file") : mCaption;
    34863486
    3487             QWidget *topParent = mParent ? mParent->window() : qApp->mainWidget();
     3487            QWidget *topParent = mParent ? mParent->window() : vboxGlobal()->mainWindow();
    34883488            QString winFilters = winFilter (mFilters);
    34893489            AssertCompile (sizeof (TCHAR) == sizeof (QChar));
     
    39123912         * the SetExtraData() call. */
    39133913        mVBox.SetExtraData (VBoxDefs::GUI_RegistrationDlgWinID,
    3914             QString ("%1").arg ((long) qApp->mainWidget()->winId()));
     3914            QString ("%1").arg (static_cast<long> (mMainWindow->winId())));
    39153915
    39163916        if (mVBox.isOk())
  • trunk/src/VBox/Frontends/VirtualBox4/src/darwin/DarwinCursor.cpp

    r8155 r8915  
    861861    CursorTestWindow wnd;
    862862
    863     app.setMainWidget(&wnd);
    864863    //wnd.showMaximized();
    865864    wnd.show();
  • trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp

    r8155 r8915  
    255255            if (vboxGlobal().isVMConsoleProcess())
    256256            {
    257                 a.setMainWidget (&vboxGlobal().consoleWnd());
     257                vboxGlobal().setMainWindow (&vboxGlobal().consoleWnd());
    258258                if (vboxGlobal().startMachine (vboxGlobal().managedVMUuid()))
    259259                    rc = a.exec();
     
    265265            else
    266266            {
    267                 a.setMainWidget (&vboxGlobal().selectorWnd());
     267                vboxGlobal().setMainWindow (&vboxGlobal().selectorWnd());
    268268                vboxGlobal().selectorWnd().show();
    269269#ifdef VBOX_WITH_REGISTRATION_REQUEST
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