- Timestamp:
- Oct 24, 2023 12:48:20 AM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 159652
- 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 4698 4698 if (!fOk) 4699 4699 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 #else4704 4700 return QFontDatabase::font(strFamily, strStyleName, iFontSize); 4705 #endif4706 4701 } 4707 4702 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp
r101560 r101571 276 276 /* Add pixmap: */ 277 277 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 */284 278 285 279 /* Parse name to prefix and suffix: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UITranslator.cpp
r100352 r101571 190 190 // We use system installations of Qt on Linux systems, so first, try 191 191 // 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 # else196 192 strLanguageFileName = QLibraryInfo::path(QLibraryInfo::TranslationsPath) + "/qt_" + 197 193 languageId() + vboxLanguageFileExtension(); 198 # endif199 194 QTranslator *pQtSysTr = new QTranslator(s_pTranslator); 200 195 Assert(pQtSysTr); -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r101561 r101571 458 458 } 459 459 460 #ifdef VBOX_IS_QT6_OR_LATER /* it was setSource before 6.0 */461 460 void UIHelpViewer::doSetSource(const QUrl &url, QTextDocument::ResourceType type) 462 #else463 void UIHelpViewer::setSource(const QUrl &url)464 #endif465 461 { 466 462 clearOverlay(); 467 463 if (url.scheme() != "qthelp") 468 464 return; 469 #ifdef VBOX_IS_QT6_OR_LATER /* it was setSource before 6.0 */470 465 QTextBrowser::doSetSource(url, type); 471 #else472 QTextBrowser::setSource(url);473 #endif474 466 QTextDocument *pDocument = document(); 475 467 if (!pDocument || pDocument->isEmpty()) -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r99910 r101571 81 81 virtual QVariant loadResource(int type, const QUrl &name) RT_OVERRIDE; 82 82 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 #endif86 83 void setFont(const QFont &); 87 84 bool isFindInPageWidgetVisible() const; … … 110 107 virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE; 111 108 virtual void keyPressEvent(QKeyEvent *pEvent) RT_OVERRIDE; 112 #ifdef VBOX_IS_QT6_OR_LATER /* it was setSource before 6.0 */113 109 virtual void doSetSource(const QUrl &url, QTextDocument::ResourceType type = QTextDocument::UnknownResource) RT_OVERRIDE; 114 #endif115 110 116 111 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r100718 r101571 469 469 qInstallMessageHandler(QtMessageOutput); 470 470 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 482 472 // WORKAROUND: 483 473 // Some Desktop Environments forcing this variable which was useful in Qt5 case. … … 487 477 // setting it to be always equal to 1. 488 478 qputenv("QT_SCALE_FACTOR", "1"); 489 # endif 490 #endif 479 #endif /* VBOX_WS_NIX */ 491 480 492 481 /* Create application: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r101564 r101571 50 50 #include "UIVirtualMachineItemLocal.h" 51 51 #include "UITools.h" 52 #ifdef VBOX_WS_MAC 53 # include "UIIconPool.h" 54 #endif 52 55 #ifndef VBOX_WS_MAC 53 56 # include "UIMenuBar.h" 54 #endif55 #ifdef VBOX_WS_MAC56 # ifdef VBOX_IS_QT6_OR_LATER /* we are branding as Dev Preview since 6.0 */57 # include "UIIconPool.h"58 # endif59 57 #endif 60 58 … … 654 652 #ifdef VBOX_WS_MAC 655 653 m_pToolBar->emulateMacToolbar(); 656 # ifdef VBOX_IS_QT6_OR_LATER /* we are branding as Dev Preview since 6.0 */657 654 /* Branding stuff for Qt6 beta: */ 658 655 if (uiCommon().showBetaLabel()) … … 661 658 QColor(246, 179, 0), 662 659 74 /* width of BETA label */); 663 # endif664 660 #endif /* VBOX_WS_MAC */ 665 661 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
r98103 r101571 752 752 753 753 /* Re-register VM if required: */ 754 #ifdef VBOX_IS_QT6_OR_LATER /* we have to use range constructors since 6.0 */755 754 QSet<QString> newGroupSet(newGroupList.begin(), newGroupList.end()); 756 755 QSet<QString> oldGroupSet(oldGroupList.begin(), oldGroupList.end()); 757 756 if (newGroupSet != oldGroupSet) 758 #else759 if (newGroupList.toSet() != oldGroupList.toSet())760 #endif761 757 { 762 758 sltLocalMachineRegistrationChanged(uMachineId, false); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r100861 r101571 439 439 440 440 /* 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)) 450 444 setSelectedItem(findClosestUnselectedItem()); 451 #endif452 445 453 446 /* If global item is currently chosen, selection should be invalidated: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserNodeMachine.cpp
r100365 r101571 27 27 28 28 /* 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> 35 30 36 31 /* GUI includes: */ … … 241 236 else 242 237 { 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); 248 240 if (name().contains(searchRegEx)) 249 241 matchedItems << this; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSearchWidget.cpp
r101563 r101571 32 32 #include <QPushButton> 33 33 #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> 39 35 40 36 /* GUI includes: */ … … 81 77 else 82 78 return false; 83 #ifdef VBOX_IS_QT6_OR_LATER /* fromWildcard is available since 6.0 */84 79 QRegularExpression searchRegEx = QRegularExpression::fromWildcard(m_strSearchTerm, Qt::CaseInsensitive, 85 80 QRegularExpression::UnanchoredWildcardConversion); 86 #else87 QRegExp searchRegEx(m_strSearchTerm, Qt::CaseInsensitive, QRegExp::Wildcard);88 #endif89 81 if (strValue.contains(searchRegEx)) 90 82 return true; -
trunk/src/VBox/Frontends/VirtualBox/src/platform/nix/UIDesktopServices_nix.cpp
r99479 r101571 45 45 const QString strVBox = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/" + VBOX_GUI_VMRUNNER_IMAGE); 46 46 QTextStream out(&link); 47 #ifndef VBOX_IS_QT6_OR_LATER /* QTextStream defaults to UTF-8 only since qt6 */48 out.setCodec("UTF-8");49 #endif50 #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)51 # define QT_ENDL Qt::endl52 #else53 # define QT_ENDL endl54 #endif55 47 /* Create a link which starts VirtualBox with the machine uuid. */ 56 out << "[Desktop Entry]" << Q T_ENDL57 << "Encoding=UTF-8" << Q T_ENDL58 << "Version=1.0" << Q T_ENDL59 << "Name=" << strName << Q T_ENDL60 << "Comment=Starts the VirtualBox machine " << strName << Q T_ENDL61 << "Type=Application" << Q T_ENDL62 << "Exec=" << strVBox << " --comment \"" << strName << "\" --startvm \"" << uUuid.toString() << "\"" << Q T_ENDL63 << "Icon=virtualbox-vbox.png" << Q T_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; 64 56 /* This would be a real file link entry, but then we could also simply 65 57 * use a soft link (on most UNIX fs): 66 out << "[Desktop Entry]" << Q T_ENDL67 << "Encoding=UTF-8" << Q T_ENDL68 << "Version=1.0" << Q T_ENDL69 << "Name=" << strName << Q T_ENDL70 << "Type=Link" << Q T_ENDL71 << "Icon=virtualbox-vbox.png" << Q T_ENDL58 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 72 64 */ 73 65 link.setPermissions(link.permissions() | QFile::ExeOwner); -
trunk/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp
r99815 r101571 36 36 #endif /* VBOX_WITH_SCREENSAVER_CONTROL */ 37 37 #include <QWidget> 38 #ifdef VBOX_IS_QT6_OR_LATER /** @todo qt6: ... */ 39 # include <QGuiApplication> 40 #else 41 # include <QX11Info> 42 #endif 38 #include <QGuiApplication> 43 39 44 40 /* GUI includes: */ … … 708 704 Display *NativeWindowSubsystem::X11GetDisplay() 709 705 { 710 #ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */711 706 Display *pDisplay = 0; 712 707 if (qApp) … … 716 711 pDisplay = pX11App->display(); 717 712 } 718 #else719 Display *pDisplay = QX11Info::display();720 #endif721 713 Assert(pDisplay); 722 714 return pDisplay; … … 725 717 xcb_connection_t *NativeWindowSubsystem::X11GetConnection() 726 718 { 727 #ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */728 719 xcb_connection_t *pConnection = 0; 729 720 if (qApp) … … 733 724 pConnection = pX11App->connection(); 734 725 } 735 #else736 xcb_connection_t *pConnection = QX11Info::connection();737 #endif738 726 Assert(pConnection); 739 727 return pConnection; … … 742 730 uint32_t NativeWindowSubsystem::X11GetAppRootWindow() 743 731 { 744 #ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */745 732 Window idWindow = 0; 746 733 Display *pDisplay = NativeWindowSubsystem::X11GetDisplay(); … … 748 735 idWindow = DefaultRootWindow(pDisplay); 749 736 return idWindow; 750 #else 751 return QX11Info::appRootWindow(); 752 #endif 753 } 754 737 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r101567 r101571 1128 1128 updateMousePointerPixmapScaling(pixmapShape, uXHot, uYHot); 1129 1129 /// @todo updateMousePointerPixmapScaling(pixmapMask, uXHot, uYHot); 1130 #ifdef VBOX_IS_QT6_OR_LATER /* since qt6 explicit constructor is replaced with QBitmap::fromPixmap static method */1131 1130 m_cursor = QCursor(QBitmap::fromPixmap(pixmapShape), QBitmap::fromPixmap(pixmapMask), uXHot, uYHot); 1132 #else1133 m_cursor = QCursor(pixmapShape, pixmapMask, uXHot, uYHot);1134 #endif1135 1131 } 1136 1132 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp
r98103 r101571 265 265 //m_pScrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 266 266 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 #endif270 267 m_pScrollArea->setPalette(pal); 271 268 /* Create scroll-viewport: */
Note:
See TracChangeset
for help on using the changeset viewer.