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/qmpmainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp') diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index f634375..c81816c 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -52,7 +52,9 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) : { ui->setupUi(this); ui->lnPolyphone->display("00000-00000"); - ui->lbFileName->setText("");ref=this; + ui->lbFileName->setText("");ref=this;ui->verticalLayout->setAlignment(ui->pushButton,Qt::AlignRight); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); playing=false;stopped=true;dragging=false;memset(VIs,0,sizeof(VIs)); settingsw=new qmpSettingsWindow(this);pmgr=new qmpPluginManager(); plistw=new qmpPlistWindow(this);player=NULL;timer=NULL; -- cgit v1.2.3