VirtualBox

Ignore:
Timestamp:
Oct 27, 2016 2:52:13 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8636: Desktop-widget watchdog: Split the code with proper QT_VERSION ifdefs since r111568 allows to avoid moc conflicts related to QT_VERSION.

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

Legend:

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

    r64437 r64440  
    284284#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
    285285
     286#if QT_VERSION < 0x050000
     287
    286288void UIDesktopWidgetWatchdog::sltHandleHostScreenCountChanged(int cHostScreenCount)
    287289{
    288     Q_UNUSED(cHostScreenCount);
    289 
    290 #if QT_VERSION < 0x050000
    291290//    printf("UIDesktopWidgetWatchdog::sltHandleHostScreenCountChanged(%d)\n", cHostScreenCount);
    292291
     
    298297    /* Notify listeners: */
    299298    emit sigHostScreenCountChanged(cHostScreenCount);
    300 #endif /* QT_VERSION < 0x050000 */
    301 }
     299}
     300
     301#else /* QT_VERSION >= 0x050000 */
    302302
    303303void UIDesktopWidgetWatchdog::sltHostScreenAdded(QScreen *pHostScreen)
    304304{
    305     Q_UNUSED(pHostScreen);
    306 
    307 #if QT_VERSION >= 0x050000
    308305//    printf("UIDesktopWidgetWatchdog::sltHostScreenAdded(%d)\n", screenCount());
    309306
     
    315312    /* Notify listeners: */
    316313    emit sigHostScreenCountChanged(screenCount());
    317 #endif /* QT_VERSION >= 0x050000 */
    318314}
    319315
    320316void UIDesktopWidgetWatchdog::sltHostScreenRemoved(QScreen *pHostScreen)
    321317{
    322     Q_UNUSED(pHostScreen);
    323 
    324 #if QT_VERSION >= 0x050000
    325318//    printf("UIDesktopWidgetWatchdog::sltHostScreenRemoved(%d)\n", screenCount());
    326319
     
    332325    /* Notify listeners: */
    333326    emit sigHostScreenCountChanged(screenCount());
     327}
     328
    334329#endif /* QT_VERSION >= 0x050000 */
    335 }
    336330
    337331void UIDesktopWidgetWatchdog::sltHandleHostScreenResized(int iHostScreenIndex)
     
    385379{
    386380    /* Prepare connections: */
     381#if QT_VERSION < 0x050000
    387382    connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int)));
     383#else /* QT_VERSION >= 0x050000 */
    388384    connect(qApp, SIGNAL(screenAdded(QScreen *)), this, SLOT(sltHostScreenAdded(QScreen *)));
    389385    connect(qApp, SIGNAL(screenRemoved(QScreen *)), this, SLOT(sltHostScreenRemoved(QScreen *)));
     386#endif /* QT_VERSION >= 0x050000 */
    390387    connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int)));
    391388    connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(sltHandleHostScreenWorkAreaResized(int)));
     
    400397{
    401398    /* Cleanup connections: */
     399#if QT_VERSION < 0x050000
    402400    disconnect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int)));
     401#else /* QT_VERSION >= 0x050000 */
    403402    disconnect(qApp, SIGNAL(screenAdded(QScreen *)), this, SLOT(sltHostScreenAdded(QScreen *)));
    404403    disconnect(qApp, SIGNAL(screenRemoved(QScreen *)), this, SLOT(sltHostScreenRemoved(QScreen *)));
     404#endif /* QT_VERSION >= 0x050000 */
    405405    disconnect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int)));
    406406    disconnect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(sltHandleHostScreenWorkAreaResized(int)));
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h

    r63344 r64440  
    108108private slots:
    109109
     110#if QT_VERSION < 0x050000
    110111    /** Handles host-screen count change to @a cHostScreenCount. */
    111112    void sltHandleHostScreenCountChanged(int cHostScreenCount);
     113#else /* QT_VERSION >= 0x050000 */
    112114    /** Handles @a pHostScreen adding. */
    113115    void sltHostScreenAdded(QScreen *pHostScreen);
    114116    /** Handles @a pHostScreen removing. */
    115117    void sltHostScreenRemoved(QScreen *pHostScreen);
     118#endif /* QT_VERSION >= 0x050000 */
    116119
    117120    /** Handles resize for the host-screen with @a iHostScreenIndex. */
    118121    void sltHandleHostScreenResized(int iHostScreenIndex);
    119 
    120122    /** Handles work-area resize for the host-screen with @a iHostScreenIndex. */
    121123    void sltHandleHostScreenWorkAreaResized(int iHostScreenIndex);
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