VirtualBox

Changeset 101571 in vbox for trunk/src


Ignore:
Timestamp:
Oct 24, 2023 12:48:20 AM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159652
Message:

FE/Qt: bugref:10450: Get rid of Qt5 stuff; This one is about replacing obsolete stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r101447 r101571  
    46984698    if (!fOk)
    46994699        iFontSize = 9;
    4700 #ifndef VBOX_IS_QT6_OR_LATER /* QFontDatabase is now more like a namespace .. */
    4701     QFontDatabase dataBase;
    4702     return dataBase.font(strFamily, strStyleName, iFontSize);
    4703 #else
    47044700    return QFontDatabase::font(strFamily, strStyleName, iFontSize);
    4705 #endif
    47064701}
    47074702
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp

    r101560 r101571  
    276276    /* Add pixmap: */
    277277    icon.addPixmap(pixmap, mode, state);
    278 
    279 #if defined(VBOX_WS_MAC) && !defined(VBOX_IS_QT6_OR_LATER)
    280     /* Test if HiDPI icons are enabled on macOS @ Qt5 only: */
    281     if (!qApp->testAttribute(Qt::AA_UseHighDpiPixmaps))
    282         return;
    283 #endif /* VBOX_WS_MAC */
    284278
    285279    /* Parse name to prefix and suffix: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UITranslator.cpp

    r100352 r101571  
    190190        // We use system installations of Qt on Linux systems, so first, try
    191191        // to load the Qt translation from the system location.
    192 # ifndef VBOX_IS_QT6_OR_LATER /* QLibraryInfo::location replaced by QLibraryInfo::path in Qt6 */
    193         strLanguageFileName = QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/qt_" +
    194                               languageId() + vboxLanguageFileExtension();
    195 # else
    196192        strLanguageFileName = QLibraryInfo::path(QLibraryInfo::TranslationsPath) + "/qt_" +
    197193                              languageId() + vboxLanguageFileExtension();
    198 # endif
    199194        QTranslator *pQtSysTr = new QTranslator(s_pTranslator);
    200195        Assert(pQtSysTr);
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp

    r101561 r101571  
    458458}
    459459
    460 #ifdef VBOX_IS_QT6_OR_LATER /* it was setSource before 6.0 */
    461460void UIHelpViewer::doSetSource(const QUrl &url, QTextDocument::ResourceType type)
    462 #else
    463 void UIHelpViewer::setSource(const QUrl &url)
    464 #endif
    465461{
    466462    clearOverlay();
    467463    if (url.scheme() != "qthelp")
    468464        return;
    469 #ifdef VBOX_IS_QT6_OR_LATER /* it was setSource before 6.0 */
    470465    QTextBrowser::doSetSource(url, type);
    471 #else
    472     QTextBrowser::setSource(url);
    473 #endif
    474466    QTextDocument *pDocument = document();
    475467    if (!pDocument || pDocument->isEmpty())
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h

    r99910 r101571  
    8181    virtual QVariant loadResource(int type, const QUrl &name) RT_OVERRIDE;
    8282    void emitHistoryChangedSignal();
    83 #ifndef VBOX_IS_QT6_OR_LATER /* must override doSetSource since 6.0 */
    84     virtual void setSource(const QUrl &url) RT_OVERRIDE;
    85 #endif
    8683    void setFont(const QFont &);
    8784    bool isFindInPageWidgetVisible() const;
     
    110107    virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
    111108    virtual void keyPressEvent(QKeyEvent *pEvent) RT_OVERRIDE;
    112 #ifdef VBOX_IS_QT6_OR_LATER /* it was setSource before 6.0 */
    113109    virtual void doSetSource(const QUrl &url, QTextDocument::ResourceType type = QTextDocument::UnknownResource) RT_OVERRIDE;
    114 #endif
    115110
    116111private slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r100718 r101571  
    469469        qInstallMessageHandler(QtMessageOutput);
    470470
    471         /* Enable HiDPI support: */
    472 #ifndef VBOX_IS_QT6_OR_LATER
    473         QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
    474 # if (!defined(DEBUG_bird) || defined(RT_OS_DARWIN))
    475 #  ifndef VBOX_GUI_WITH_CUSTOMIZATIONS1
    476         /* This shouldn't be enabled for customer WM, since Qt has conflicts in that case. */
    477         QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    478 #  endif
    479 # endif
    480 #else
    481 # ifdef VBOX_WS_NIX
     471#ifdef VBOX_WS_NIX
    482472        // WORKAROUND:
    483473        // Some Desktop Environments forcing this variable which was useful in Qt5 case.
     
    487477        // setting it to be always equal to 1.
    488478        qputenv("QT_SCALE_FACTOR", "1");
    489 # endif
    490 #endif
     479#endif /* VBOX_WS_NIX */
    491480
    492481        /* Create application: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r101564 r101571  
    5050#include "UIVirtualMachineItemLocal.h"
    5151#include "UITools.h"
     52#ifdef VBOX_WS_MAC
     53# include "UIIconPool.h"
     54#endif
    5255#ifndef VBOX_WS_MAC
    5356# include "UIMenuBar.h"
    54 #endif
    55 #ifdef VBOX_WS_MAC
    56 # ifdef VBOX_IS_QT6_OR_LATER /* we are branding as Dev Preview since 6.0 */
    57 #  include "UIIconPool.h"
    58 # endif
    5957#endif
    6058
     
    654652#ifdef VBOX_WS_MAC
    655653                        m_pToolBar->emulateMacToolbar();
    656 # ifdef VBOX_IS_QT6_OR_LATER /* we are branding as Dev Preview since 6.0 */
    657654                        /* Branding stuff for Qt6 beta: */
    658655                        if (uiCommon().showBetaLabel())
     
    661658                                                       QColor(246, 179, 0),
    662659                                                       74 /* width of BETA label */);
    663 # endif
    664660#endif /* VBOX_WS_MAC */
    665661
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r98103 r101571  
    752752
    753753    /* Re-register VM if required: */
    754 #ifdef VBOX_IS_QT6_OR_LATER /* we have to use range constructors since 6.0 */
    755754    QSet<QString> newGroupSet(newGroupList.begin(), newGroupList.end());
    756755    QSet<QString> oldGroupSet(oldGroupList.begin(), oldGroupList.end());
    757756    if (newGroupSet != oldGroupSet)
    758 #else
    759     if (newGroupList.toSet() != oldGroupList.toSet())
    760 #endif
    761757    {
    762758        sltLocalMachineRegistrationChanged(uMachineId, false);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r100861 r101571  
    439439
    440440    /* If we have at least one of those items currently selected: */
    441 #ifdef VBOX_IS_QT6_OR_LATER /* we have to use range constructors since 6.0 */
    442     {
    443         QList<UIChooserItem *> selectedItemsList = selectedItems();
    444         QSet<UIChooserItem *> selectedItemsSet(selectedItemsList.begin(), selectedItemsList.end());
    445         if (selectedItemsSet.intersects(matchedItems))
    446             setSelectedItem(findClosestUnselectedItem());
    447     }
    448 #else
    449     if (selectedItems().toSet().intersects(matchedItems))
     441    const QList<UIChooserItem*> selectedItemsList = selectedItems();
     442    const QSet<UIChooserItem*> selectedItemsSet(selectedItemsList.begin(), selectedItemsList.end());
     443    if (selectedItemsSet.intersects(matchedItems))
    450444        setSelectedItem(findClosestUnselectedItem());
    451 #endif
    452445
    453446    /* If global item is currently chosen, selection should be invalidated: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp

    r100365 r101571  
    2727
    2828/* Qt includes: */
    29 #include <qglobal.h>
    30 #ifdef VBOX_IS_QT6_OR_LATER /* fromWildcard is available since 6.0 */
    31 # include <QRegularExpression>
    32 #else
    33 # include <QRegExp>
    34 #endif
     29#include <QRegularExpression>
    3530
    3631/* GUI includes: */
     
    241236        else
    242237        {
    243 #ifdef VBOX_IS_QT6_OR_LATER /* fromWildcard is available since 6.0 */
    244             QRegularExpression searchRegEx = QRegularExpression::fromWildcard(strSearchTerm, Qt::CaseInsensitive, QRegularExpression::UnanchoredWildcardConversion);
    245 #else
    246             QRegExp searchRegEx(strSearchTerm, Qt::CaseInsensitive, QRegExp::WildcardUnix);
    247 #endif
     238            QRegularExpression searchRegEx = QRegularExpression::fromWildcard(strSearchTerm, Qt::CaseInsensitive,
     239                                                                              QRegularExpression::UnanchoredWildcardConversion);
    248240            if (name().contains(searchRegEx))
    249241                matchedItems << this;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSearchWidget.cpp

    r101563 r101571  
    3232#include <QPushButton>
    3333#include <QPainter>
    34 #ifdef VBOX_IS_QT6_OR_LATER /* fromWildcard is available since 6.0 */
    35 # include <QRegularExpression>
    36 #else
    37 # include <QRegExp>
    38 #endif
     34#include <QRegularExpression>
    3935
    4036/* GUI includes: */
     
    8177        else
    8278            return false;
    83 #ifdef VBOX_IS_QT6_OR_LATER /* fromWildcard is available since 6.0 */
    8479        QRegularExpression searchRegEx = QRegularExpression::fromWildcard(m_strSearchTerm, Qt::CaseInsensitive,
    8580                                                                          QRegularExpression::UnanchoredWildcardConversion);
    86 #else
    87         QRegExp searchRegEx(m_strSearchTerm, Qt::CaseInsensitive, QRegExp::Wildcard);
    88 #endif
    8981        if (strValue.contains(searchRegEx))
    9082            return true;
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/nix/UIDesktopServices_nix.cpp

    r99479 r101571  
    4545        const QString strVBox = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/" + VBOX_GUI_VMRUNNER_IMAGE);
    4646        QTextStream out(&link);
    47 #ifndef VBOX_IS_QT6_OR_LATER /* QTextStream defaults to UTF-8 only since qt6 */
    48         out.setCodec("UTF-8");
    49 #endif
    50 #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
    51 # define QT_ENDL Qt::endl
    52 #else
    53 # define QT_ENDL endl
    54 #endif
    5547        /* Create a link which starts VirtualBox with the machine uuid. */
    56         out << "[Desktop Entry]" << QT_ENDL
    57             << "Encoding=UTF-8" << QT_ENDL
    58             << "Version=1.0" << QT_ENDL
    59             << "Name=" << strName << QT_ENDL
    60             << "Comment=Starts the VirtualBox machine " << strName << QT_ENDL
    61             << "Type=Application" << QT_ENDL
    62             << "Exec=" << strVBox << " --comment \"" << strName << "\" --startvm \"" << uUuid.toString() << "\"" << QT_ENDL
    63             << "Icon=virtualbox-vbox.png" << QT_ENDL;
     48        out << "[Desktop Entry]" << Qt::endl
     49            << "Encoding=UTF-8" << Qt::endl
     50            << "Version=1.0" << Qt::endl
     51            << "Name=" << strName << Qt::endl
     52            << "Comment=Starts the VirtualBox machine " << strName << Qt::endl
     53            << "Type=Application" << Qt::endl
     54            << "Exec=" << strVBox << " --comment \"" << strName << "\" --startvm \"" << uUuid.toString() << "\"" << Qt::endl
     55            << "Icon=virtualbox-vbox.png" << Qt::endl;
    6456        /* This would be a real file link entry, but then we could also simply
    6557         * use a soft link (on most UNIX fs):
    66         out << "[Desktop Entry]" << QT_ENDL
    67             << "Encoding=UTF-8" << QT_ENDL
    68             << "Version=1.0" << QT_ENDL
    69             << "Name=" << strName << QT_ENDL
    70             << "Type=Link" << QT_ENDL
    71             << "Icon=virtualbox-vbox.png" << QT_ENDL
     58        out << "[Desktop Entry]" << Qt::endl
     59            << "Encoding=UTF-8" << Qt::endl
     60            << "Version=1.0" << Qt::endl
     61            << "Name=" << strName << Qt::endl
     62            << "Type=Link" << Qt::endl
     63            << "Icon=virtualbox-vbox.png" << Qt::endl
    7264        */
    7365        link.setPermissions(link.permissions() | QFile::ExeOwner);
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp

    r99815 r101571  
    3636#endif /* VBOX_WITH_SCREENSAVER_CONTROL */
    3737#include <QWidget>
    38 #ifdef VBOX_IS_QT6_OR_LATER /** @todo qt6: ... */
    39 # include <QGuiApplication>
    40 #else
    41 # include <QX11Info>
    42 #endif
     38#include <QGuiApplication>
    4339
    4440/* GUI includes: */
     
    708704Display *NativeWindowSubsystem::X11GetDisplay()
    709705{
    710 #ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */
    711706    Display *pDisplay = 0;
    712707    if (qApp)
     
    716711            pDisplay = pX11App->display();
    717712    }
    718 #else
    719     Display *pDisplay = QX11Info::display();
    720 #endif
    721713    Assert(pDisplay);
    722714    return pDisplay;
     
    725717xcb_connection_t *NativeWindowSubsystem::X11GetConnection()
    726718{
    727 #ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */
    728719    xcb_connection_t *pConnection = 0;
    729720    if (qApp)
     
    733724            pConnection = pX11App->connection();
    734725    }
    735 #else
    736     xcb_connection_t *pConnection = QX11Info::connection();
    737 #endif
    738726    Assert(pConnection);
    739727    return pConnection;
     
    742730uint32_t NativeWindowSubsystem::X11GetAppRootWindow()
    743731{
    744 #ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */
    745732    Window idWindow = 0;
    746733    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     
    748735        idWindow = DefaultRootWindow(pDisplay);
    749736    return idWindow;
    750 #else
    751     return QX11Info::appRootWindow();
    752 #endif
    753 }
    754 
     737}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r101567 r101571  
    11281128        updateMousePointerPixmapScaling(pixmapShape, uXHot, uYHot);
    11291129        /// @todo updateMousePointerPixmapScaling(pixmapMask, uXHot, uYHot);
    1130 #ifdef VBOX_IS_QT6_OR_LATER /* since qt6 explicit constructor is replaced with QBitmap::fromPixmap static method */
    11311130        m_cursor = QCursor(QBitmap::fromPixmap(pixmapShape), QBitmap::fromPixmap(pixmapMask), uXHot, uYHot);
    1132 #else
    1133         m_cursor = QCursor(pixmapShape, pixmapMask, uXHot, uYHot);
    1134 #endif
    11351131    }
    11361132
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp

    r98103 r101571  
    265265            //m_pScrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    266266            QPalette pal = m_pScrollArea->palette();
    267 #ifndef VBOX_IS_QT6_OR_LATER /** @todo Qt::transparent glitches in qt6? */
    268             pal.setColor(QPalette::Window, QColor(Qt::transparent));
    269 #endif
    270267            m_pScrollArea->setPalette(pal);
    271268            /* Create scroll-viewport: */
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