From ea34246e769c30f5257d37ad53bb5defc04bb00b Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 8 Jul 2016 22:31:59 +0200 Subject: useless dpi workaround for now --- mainwindow.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mainwindow.cc b/mainwindow.cc index 21b98ee..5d513b1 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -37,6 +37,21 @@ MainWindow::MainWindow(QWidget *parent) : _statusLabel(new QLabel) { ui->setupUi(this); +#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) + // Some tricks for DPI support + const qreal scale = logicalDpiX() / 96.0; + if (scale > 1.1) { + ui->notebookTree->header()->setDefaultSectionSize(ui->notebookTree->header()->defaultSectionSize() * scale); + ui->notebookTree->setIconSize(QSize(16, 16) * scale); + ui->prevButton->setMaximumSize(ui->prevButton->maximumSize() * scale); + ui->nextButton->setMaximumSize(ui->nextButton->maximumSize() * scale); + ui->exportButton->setMaximumSize(ui->exportButton->maximumSize() * scale); + ui->playButton->setMaximumSize(ui->playButton->maximumSize() * scale); + ui->pauseButton->setMaximumSize(ui->pauseButton->maximumSize() * scale); + ui->playButton->setMaximumSize(ui->prevButton->maximumSize() * scale); + ui->pageEdit->setMaximumWidth(ui->pageEdit->maximumWidth() * scale); + } +#endif ui->notebookTree->setModel(_notebooks); ui->notebookTree->header()->setResizeMode(0, QHeaderView::Stretch); ui->notebookTree->header()->setResizeMode(1, QHeaderView::Fixed); -- cgit v1.2.3