From 1ec23952dd7c022e11afbb93d93be1bac5c94081 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 20 May 2016 23:51:15 +0800 Subject: Scale GUI correctly on a high DPI device. Fix building for Windows. RC-bugs still exist. --- qmidiplayer-desktop/qmpsettingswindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qmidiplayer-desktop/qmpsettingswindow.cpp') diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp index b47c2ba..7e441e8 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.cpp +++ b/qmidiplayer-desktop/qmpsettingswindow.cpp @@ -19,6 +19,8 @@ qmpSettingsWindow::qmpSettingsWindow(QWidget *parent) : ui(new Ui::qmpSettingsWindow) { ui->setupUi(this);customOptions.clear();customOptPages.clear(); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); settings=new QSettings(QDir::homePath()+QString("/.config/qmprc"),QSettings::IniFormat); settingsInit();outwidget=ui->cbOutputDevice; -- cgit v1.2.3