DPI awareness and latest changes from gta5sync

This commit is contained in:
Syping 2017-05-01 05:05:55 +02:00
parent 6b4f856e4d
commit ed559f3ce9
24 changed files with 343 additions and 213 deletions

View file

@ -20,10 +20,14 @@
#include "AppEnv.h"
#include "StringParser.h"
#include "StandardPaths.h"
#include <QDir>
#include <QDebug>
#include <QtGlobal>
#include <QDesktopWidget>
#include <QApplication>
#include <QSettings>
#include <QScreen>
#include <QDebug>
#include <QRect>
#include <QDir>
#include <iostream>
using namespace std;
@ -130,3 +134,13 @@ QUrl AppEnv::getPlayerFetchingUrl(QString crewID, QString pageNumber)
{
return QUrl(QString("https://socialclub.rockstargames.com/crewsapi/GetMembersList?crewId=%1&pageNumber=%2").arg(crewID, pageNumber));
}
qreal AppEnv::screenRatio()
{
#if QT_VERSION >= 0x050000
qreal dpi = QGuiApplication::primaryScreen()->logicalDotsPerInch();
#else
qreal dpi = qApp->desktop()->logicalDpiX();
#endif
return (dpi / 96);
}