Info about scaling and screen resolution

This commit is contained in:
Klaus Basan
2019-06-09 01:00:14 +02:00
committed by Mat Sutcliffe
parent c9846f45ee
commit d84ec65271
6 changed files with 119 additions and 2 deletions

View File

@@ -8,6 +8,10 @@
#include "scalescreenfactor.h"
#include "ui_scalescreenfactor.h"
#include "guiutility.h"
#include <QDesktopWidget>
#include <QScreen>
#include <QIntValidator>
namespace BlackGui
@@ -21,8 +25,23 @@ namespace BlackGui
ui->setupUi(this);
this->setMinMax(50, 150);
connect(ui->hs_Factor, &QSlider::valueChanged, this, &CScaleScreenFactor::onSliderChanged);
connect(ui->hs_Factor, &QSlider::valueChanged, this, &CScaleScreenFactor::onSliderChanged);
connect(ui->le_Factor, &QLineEdit::editingFinished, this, &CScaleScreenFactor::onEditFinished);
const QDesktopWidget *w = qApp->desktop();
this->setToolTip(
QStringLiteral(
"Scaling only works on High DPI screens\n"
"Width/height: %1/%2 Ratio: %3\n"
"Logical DPI x/y: %4/%5\n"
"Physical DPI x/y: %6/%7\n"
"width/height MM: %8/%9"
).
arg(w->width()).arg(w->height()).arg(QString::number(CGuiUtility::mainApplicationWidgetPixelRatio(), 'f', 2)).
arg(w->logicalDpiX()).arg(w->logicalDpiY()).
arg(w->physicalDpiX()).arg(w->physicalDpiY()).
arg(w->widthMM()).arg(w->heightMM())
);
}
CScaleScreenFactor::~CScaleScreenFactor()