!52 5.15缩放

Merge pull request !52 from zhaoshixu/0524
This commit is contained in:
zhaoshixu 2023-05-24 07:35:24 +00:00 committed by Gitee
commit 1a2ba6b2d2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 12 additions and 0 deletions

View File

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

View File

@ -908,6 +908,7 @@ void MainWindow::showCreateWiredConnectWidget(const QString devName)
}); });
m_createPagePtrMap.insert(devName, netDetail); m_createPagePtrMap.insert(devName, netDetail);
netDetail->show(); netDetail->show();
KWindowSystem::raiseWindow(netDetail->winId());
netDetail->centerToScreen(); 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); NetDetail *netDetail = new NetDetail(devName, p_item->m_connectName, uuid, isActive, false, false);
m_lanPagePtrMap.insert(p_item->m_connectPath, netDetail); m_lanPagePtrMap.insert(p_item->m_connectPath, netDetail);
netDetail->show(); netDetail->show();
KWindowSystem::raiseWindow(netDetail->winId());
netDetail->centerToScreen(); netDetail->centerToScreen();
connect(netDetail, &NetDetail::detailPageClose, [&](QString deviceName, QString lanName, QString lanUuid){ 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"); initUkuiLog4qt("kylin-nm");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); 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); // QApplication a(argc, argv);
QString id = QString("kylin-nm"+ QLatin1String(getenv("DISPLAY"))); QString id = QString("kylin-nm"+ QLatin1String(getenv("DISPLAY")));