From: vsv Date: Fri, 6 Sep 2019 08:22:33 +0000 (+0300) Subject: Issue #3009: Adapt the application to HD screen X-Git-Tag: V9_4_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=20afea6c885668f6901e7ae42ee19c7b8fb40ac4;p=modules%2Fshaper.git Issue #3009: Adapt the application to HD screen --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 3fadef034..df5c48cb1 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -939,7 +939,11 @@ void XGUI_Workshop::onOpen() } //show file dialog, check if readable and open - QString aFile = QFileDialog::getOpenFileName(desktop(), tr("Open file"), QString(), MyFilter); + qreal aRatio = ModuleBase_Tools::currentPixelRatio(); + // If the ratio is > 1 (HD screen) then QT has a bug in + // displaying of system open file dialog (too small) + QString aFile = QFileDialog::getOpenFileName(desktop(), tr("Open file"), QString(), MyFilter, + Q_NULLPTR, ((aRatio > 1)? QFileDialog::DontUseNativeDialog : QFileDialog::Options())); if (!aFile.isNull()) openFile(aFile); } @@ -1106,8 +1110,10 @@ bool XGUI_Workshop::onSaveAs() { if(!myOperationMgr->abortAllOperations(XGUI_OperationMgr::XGUI_InformationMessage)) return false; + qreal aRatio = ModuleBase_Tools::currentPixelRatio(); myCurrentFile = QFileDialog::getSaveFileName(desktop(), tr("Select name to save file..."), - QString(), MyFilter2); + QString(), MyFilter2, + Q_NULLPTR, ((aRatio > 1) ? QFileDialog::DontUseNativeDialog : QFileDialog::Options())); if (!myCurrentFile.isNull()) { if (!myCurrentFile.endsWith(MyExtension)) { myCurrentFile += MyExtension;