Skip to content

Commit

Permalink
enable HiDPI only Qt >= 5.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bigeagle authored and Wang Yuzhi committed Oct 17, 2017
1 parent ad1960c commit 4ce34da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
sudo: required
dist: xenial
dist: trusty
language: cpp

env:
- BUILDTYPE=Release
- BUILDTYPE=Debug

before_install:
- sudo add-apt-repository --yes ppa:beineri/opt-qt591-xenial
- sudo apt-get update -qq

install:
- sudo apt-get install -qq qt59-meta-full libqt5x11extras5-dev
- sudo apt-get install -qq qt5-default libqt5x11extras5-dev

script:
- source /opt/qt59/bin/qt59-env.sh
- mkdir build/
- cd build/
- cmake .. -DCMAKE_BUILD_TYPE=$BUILDTYPE
Expand Down
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <QApplication>
#include <QtGlobal>
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
#include <ctime>
Expand All @@ -11,7 +12,9 @@
#endif
int main(int argc, char *argv[])
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication app(argc, argv);
std::srand(std::time(0));

Expand Down

0 comments on commit 4ce34da

Please sign in to comment.