VirtualBox

Changeset 57590 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 1, 2015 2:06:35 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102438
Message:

FE/Qt: 7958: Adding more host-screen related wrappers to VBoxGlobal. Will be reused in other places.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r57547 r57590  
    346346}
    347347
     348int VBoxGlobal::screenNumber(const QWidget *pWidget) const
     349{
     350    /* Redirect call to QDesktopWidget: */
     351    return QApplication::desktop()->screenNumber(pWidget);
     352}
     353
     354int VBoxGlobal::screenNumber(const QPoint &point) const
     355{
     356    /* Redirect call to QDesktopWidget: */
     357    return QApplication::desktop()->screenNumber(point);
     358}
     359
    348360const QRect VBoxGlobal::screenGeometry(int iHostScreenIndex /* = -1 */) const
    349361{
     
    372384}
    373385
    374 const QRect VBoxGlobal::screenGeometry(QWidget *pWidget /* = 0 */) const
     386const QRect VBoxGlobal::screenGeometry(const QWidget *pWidget) const
    375387{
    376388    /* Redirect call to existing wrapper: */
    377     return screenGeometry(QApplication::desktop()->screenNumber(pWidget));
    378 }
    379 
    380 const QRect VBoxGlobal::availableGeometry(QWidget *pWidget /* = 0 */) const
     389    return screenGeometry(screenNumber(pWidget));
     390}
     391
     392const QRect VBoxGlobal::availableGeometry(const QWidget *pWidget) const
    381393{
    382394    /* Redirect call to existing wrapper: */
    383     return availableGeometry(QApplication::desktop()->screenNumber(pWidget));
     395    return availableGeometry(screenNumber(pWidget));
     396}
     397
     398const QRect VBoxGlobal::screenGeometry(const QPoint &point) const
     399{
     400    /* Redirect call to existing wrapper: */
     401    return screenGeometry(screenNumber(point));
     402}
     403
     404const QRect VBoxGlobal::availableGeometry(const QPoint &point) const
     405{
     406    /* Redirect call to existing wrapper: */
     407    return availableGeometry(screenNumber(point));
    384408}
    385409
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r57547 r57590  
    145145        int screenCount() const;
    146146
     147        /** Returns the index of the screen which contains contains @a pWidget. */
     148        int screenNumber(const QWidget *pWidget) const;
     149        /** Returns the index of the screen which contains contains @a point. */
     150        int screenNumber(const QPoint &point) const;
     151
    147152        /** Returns the geometry of the host-screen with @a iHostScreenIndex.
    148153          * @note The default screen is used if @a iHostScreenIndex is -1. */
     
    152157        const QRect availableGeometry(int iHostScreenIndex = -1) const;
    153158
    154         /** Returns the geometry of the host-screen which contains @a pWidget.
    155           * @note The default screen is used if @a pWidget is 0. */
    156         const QRect screenGeometry(QWidget *pWidget = 0) const;
    157         /** Returns the available-geometry of the host-screen which contains @a pWidget.
    158           * @note The default screen is used if @a pWidget is 0. */
    159         const QRect availableGeometry(QWidget *pWidget = 0) const;
     159        /** Returns the geometry of the host-screen which contains @a pWidget. */
     160        const QRect screenGeometry(const QWidget *pWidget) const;
     161        /** Returns the available-geometry of the host-screen which contains @a pWidget. */
     162        const QRect availableGeometry(const QWidget *pWidget) const;
     163
     164        /** Returns the geometry of the host-screen which contains @a point. */
     165        const QRect screenGeometry(const QPoint &point) const;
     166        /** Returns the available-geometry of the host-screen which contains @a point. */
     167        const QRect availableGeometry(const QPoint &point) const;
    160168    /** @} */
    161169
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