VirtualBox

Changeset 100349 in vbox for trunk/src


Ignore:
Timestamp:
Jul 3, 2023 2:58:50 PM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10450: Migrating some stuff outdated in Qt5, not even Qt6.

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

Legend:

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

    r100094 r100349  
    27432743    if (   pEvent->type() == QEvent::LanguageChange
    27442744        && pObject->isWidgetType()
    2745         && static_cast<QWidget*>(pObject)->isTopLevel())
     2745        && qobject_cast<QWidget*>(pObject)->isWindow())
    27462746    {
    27472747        /* Catch the language change event before any other widget gets it in
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp

    r100346 r100349  
    764764                case UIPortForwardingDataType_HostIp:
    765765                case UIPortForwardingDataType_GuestIp:
     766                {
     767                    QFontMetrics fm = qobject_cast<QWidget*>(parent())->fontMetrics();
    766768#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
    767                     return QSize(QApplication::fontMetrics().horizontalAdvance(" 888.888.888.888 "),
    768                                  QApplication::fontMetrics().height());
     769                    return QSize(fm.horizontalAdvance(" 888.888.888.888 "), fm.height());
    769770#else
    770                     return QSize(QApplication::fontMetrics().width(" 888.888.888.888 "), QApplication::fontMetrics().height());
     771                    return QSize(fm.width(" 888.888.888.888 "), fm.height());
    771772#endif
     773                }
    772774                default: return QVariant();
    773775            }
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