5.15缩放

This commit is contained in:
jzxc95 2023-05-24 15:35:06 +08:00
parent 61c8ac15a9
commit 820e455ee1
4 changed files with 12 additions and 0 deletions

View File

@ -80,8 +80,13 @@ int main(int argc, char *argv[])
{
initUkuiLog4qt("kylin-vpn");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
QString id = QString("kylin-vpn"+ QLatin1String(getenv("DISPLAY")));
QtSingleApplication a(id, argc, argv);

View File

@ -908,6 +908,7 @@ void MainWindow::showCreateWiredConnectWidget(const QString devName)
});
m_createPagePtrMap.insert(devName, netDetail);
netDetail->show();
KWindowSystem::raiseWindow(netDetail->winId());
netDetail->centerToScreen();
}

View File

@ -1277,6 +1277,7 @@ void LanPage::showDetailPage(QString devName, QString uuid)
NetDetail *netDetail = new NetDetail(devName, p_item->m_connectName, uuid, isActive, false, false);
m_lanPagePtrMap.insert(p_item->m_connectPath, netDetail);
netDetail->show();
KWindowSystem::raiseWindow(netDetail->winId());
netDetail->centerToScreen();
connect(netDetail, &NetDetail::detailPageClose, [&](QString deviceName, QString lanName, QString lanUuid){

View File

@ -82,8 +82,13 @@ int main(int argc, char *argv[])
{
initUkuiLog4qt("kylin-nm");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
// QApplication a(argc, argv);
QString id = QString("kylin-nm"+ QLatin1String(getenv("DISPLAY")));