diff options
author | Javier <dev.git@javispedro.com> | 2016-07-08 22:31:59 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2016-07-08 22:31:59 +0200 |
commit | ea34246e769c30f5257d37ad53bb5defc04bb00b (patch) | |
tree | 308c81edf37628843b8143742a91f465f9111bd1 | |
parent | d334906cdb5ad988c9e3ad1e9827eab774d1a283 (diff) | |
download | scribiu-ea34246e769c30f5257d37ad53bb5defc04bb00b.tar.gz scribiu-ea34246e769c30f5257d37ad53bb5defc04bb00b.zip |
useless dpi workaround for now
-rw-r--r-- | mainwindow.cc | 15 |
1 files changed, 15 insertions, 0 deletions
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); |