Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtBase. Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
e1ce78d484
commit
b3c991ae8f
@ -107,9 +107,9 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */)
|
|||||||
//! [6] //! [7]
|
//! [6] //! [7]
|
||||||
} else {
|
} else {
|
||||||
//! [7] //! [8]
|
//! [7] //! [8]
|
||||||
auto previewPixmap = qFuzzyCompare(pixmap.devicePixelRatioF(), qreal(1))
|
auto previewPixmap = qFuzzyCompare(pixmap.devicePixelRatio(), qreal(1))
|
||||||
? pixmap
|
? pixmap
|
||||||
: pixmap.scaled(pixmap.size() / pixmap.devicePixelRatioF(), Qt::KeepAspectRatio,
|
: pixmap.scaled(pixmap.size() / pixmap.devicePixelRatio(), Qt::KeepAspectRatio,
|
||||||
Qt::SmoothTransformation);
|
Qt::SmoothTransformation);
|
||||||
double scaleFactor = pixmapScale / curScale;
|
double scaleFactor = pixmapScale / curScale;
|
||||||
int newWidth = int(previewPixmap.width() * scaleFactor);
|
int newWidth = int(previewPixmap.width() * scaleFactor);
|
||||||
@ -143,7 +143,7 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */)
|
|||||||
//! [10]
|
//! [10]
|
||||||
void MandelbrotWidget::resizeEvent(QResizeEvent * /* event */)
|
void MandelbrotWidget::resizeEvent(QResizeEvent * /* event */)
|
||||||
{
|
{
|
||||||
thread.render(centerX, centerY, curScale, size(), devicePixelRatioF());
|
thread.render(centerX, centerY, curScale, size(), devicePixelRatio());
|
||||||
}
|
}
|
||||||
//! [10]
|
//! [10]
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ void MandelbrotWidget::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
pixmapOffset += event->position().toPoint() - lastDragPos;
|
pixmapOffset += event->position().toPoint() - lastDragPos;
|
||||||
lastDragPos = QPoint();
|
lastDragPos = QPoint();
|
||||||
|
|
||||||
const auto pixmapSize = pixmap.size() / pixmap.devicePixelRatioF();
|
const auto pixmapSize = pixmap.size() / pixmap.devicePixelRatio();
|
||||||
int deltaX = (width() - pixmapSize.width()) / 2 - pixmapOffset.x();
|
int deltaX = (width() - pixmapSize.width()) / 2 - pixmapOffset.x();
|
||||||
int deltaY = (height() - pixmapSize.height()) / 2 - pixmapOffset.y();
|
int deltaY = (height() - pixmapSize.height()) / 2 - pixmapOffset.y();
|
||||||
scroll(deltaX, deltaY);
|
scroll(deltaX, deltaY);
|
||||||
@ -239,7 +239,7 @@ void MandelbrotWidget::zoom(double zoomFactor)
|
|||||||
{
|
{
|
||||||
curScale *= zoomFactor;
|
curScale *= zoomFactor;
|
||||||
update();
|
update();
|
||||||
thread.render(centerX, centerY, curScale, size(), devicePixelRatioF());
|
thread.render(centerX, centerY, curScale, size(), devicePixelRatio());
|
||||||
}
|
}
|
||||||
//! [17]
|
//! [17]
|
||||||
|
|
||||||
@ -249,6 +249,6 @@ void MandelbrotWidget::scroll(int deltaX, int deltaY)
|
|||||||
centerX += deltaX * curScale;
|
centerX += deltaX * curScale;
|
||||||
centerY += deltaY * curScale;
|
centerY += deltaY * curScale;
|
||||||
update();
|
update();
|
||||||
thread.render(centerX, centerY, curScale, size(), devicePixelRatioF());
|
thread.render(centerX, centerY, curScale, size(), devicePixelRatio());
|
||||||
}
|
}
|
||||||
//! [18]
|
//! [18]
|
||||||
|
@ -94,7 +94,7 @@ ToolBar::ToolBar(const QString &title, QWidget *parent)
|
|||||||
|
|
||||||
setIconSize(QSize(32, 32));
|
setIconSize(QSize(32, 32));
|
||||||
|
|
||||||
qreal dpr = devicePixelRatioF();
|
qreal dpr = devicePixelRatio();
|
||||||
menu = new QMenu("One", this);
|
menu = new QMenu("One", this);
|
||||||
menu->setIcon(genIcon(iconSize(), 1, Qt::black, dpr));
|
menu->setIcon(genIcon(iconSize(), 1, Qt::black, dpr));
|
||||||
menu->addAction(genIcon(iconSize(), "A", Qt::blue, dpr), "A");
|
menu->addAction(genIcon(iconSize(), "A", Qt::blue, dpr), "A");
|
||||||
|
@ -290,8 +290,8 @@ QString FontInfoDialog::text() const
|
|||||||
|
|
||||||
str << "Qt " << QT_VERSION_STR << " on " << QGuiApplication::platformName()
|
str << "Qt " << QT_VERSION_STR << " on " << QGuiApplication::platformName()
|
||||||
<< ", " << logicalDpiX() << "DPI";
|
<< ", " << logicalDpiX() << "DPI";
|
||||||
if (!qFuzzyCompare(devicePixelRatioF(), qreal(1)))
|
if (!qFuzzyCompare(devicePixelRatio(), qreal(1)))
|
||||||
str << ", device pixel ratio: " << devicePixelRatioF();
|
str << ", device pixel ratio: " << devicePixelRatio();
|
||||||
str << "\n\nDefault font : " << defaultFont.family() << ", " << defaultFont.pointSizeF() << "pt\n"
|
str << "\n\nDefault font : " << defaultFont.family() << ", " << defaultFont.pointSizeF() << "pt\n"
|
||||||
<< "Fixed font : " << fixedFont.family() << ", " << fixedFont.pointSizeF() << "pt\n"
|
<< "Fixed font : " << fixedFont.family() << ", " << fixedFont.pointSizeF() << "pt\n"
|
||||||
<< "Title font : " << titleFont.family() << ", " << titleFont.pointSizeF() << "pt\n"
|
<< "Title font : " << titleFont.family() << ", " << titleFont.pointSizeF() << "pt\n"
|
||||||
|
@ -170,7 +170,7 @@ void IconPreviewArea::updatePixmapLabels()
|
|||||||
tr("Size: %1x%2\nActual size: %3x%4\nDevice pixel ratio: %5")
|
tr("Size: %1x%2\nActual size: %3x%4\nDevice pixel ratio: %5")
|
||||||
.arg(size.width()).arg(size.height())
|
.arg(size.width()).arg(size.height())
|
||||||
.arg(actualSize.width()).arg(actualSize.height())
|
.arg(actualSize.width()).arg(actualSize.height())
|
||||||
.arg(pixmap.devicePixelRatioF());
|
.arg(pixmap.devicePixelRatio());
|
||||||
}
|
}
|
||||||
pixmapLabel->setToolTip(toolTip);
|
pixmapLabel->setToolTip(toolTip);
|
||||||
}
|
}
|
||||||
|
@ -419,7 +419,7 @@ QWidget *MainWindow::createIconSizeGroupBox()
|
|||||||
|
|
||||||
void MainWindow::screenChanged()
|
void MainWindow::screenChanged()
|
||||||
{
|
{
|
||||||
devicePixelRatioLabel->setText(QString::number(devicePixelRatioF()));
|
devicePixelRatioLabel->setText(QString::number(devicePixelRatio()));
|
||||||
if (const QWindow *window = windowHandle()) {
|
if (const QWindow *window = windowHandle()) {
|
||||||
const QScreen *screen = window->screen();
|
const QScreen *screen = window->screen();
|
||||||
const QString screenDescription =
|
const QString screenDescription =
|
||||||
|
@ -133,7 +133,7 @@ void TabletCanvas::tabletEvent(QTabletEvent *event)
|
|||||||
//! [4]
|
//! [4]
|
||||||
void TabletCanvas::initPixmap()
|
void TabletCanvas::initPixmap()
|
||||||
{
|
{
|
||||||
qreal dpr = devicePixelRatioF();
|
qreal dpr = devicePixelRatio();
|
||||||
QPixmap newPixmap = QPixmap(qRound(width() * dpr), qRound(height() * dpr));
|
QPixmap newPixmap = QPixmap(qRound(width() * dpr), qRound(height() * dpr));
|
||||||
newPixmap.setDevicePixelRatio(dpr);
|
newPixmap.setDevicePixelRatio(dpr);
|
||||||
newPixmap.fill(Qt::white);
|
newPixmap.fill(Qt::white);
|
||||||
@ -149,8 +149,8 @@ void TabletCanvas::paintEvent(QPaintEvent *event)
|
|||||||
if (m_pixmap.isNull())
|
if (m_pixmap.isNull())
|
||||||
initPixmap();
|
initPixmap();
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
QRect pixmapPortion = QRect(event->rect().topLeft() * devicePixelRatioF(),
|
QRect pixmapPortion = QRect(event->rect().topLeft() * devicePixelRatio(),
|
||||||
event->rect().size() * devicePixelRatioF());
|
event->rect().size() * devicePixelRatio());
|
||||||
painter.drawPixmap(event->rect().topLeft(), m_pixmap, pixmapPortion);
|
painter.drawPixmap(event->rect().topLeft(), m_pixmap, pixmapPortion);
|
||||||
}
|
}
|
||||||
//! [4]
|
//! [4]
|
||||||
|
@ -185,7 +185,7 @@ QPixmapIconEngine::~QPixmapIconEngine()
|
|||||||
void QPixmapIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state)
|
void QPixmapIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state)
|
||||||
{
|
{
|
||||||
auto paintDevice = painter->device();
|
auto paintDevice = painter->device();
|
||||||
qreal dpr = paintDevice ? paintDevice->devicePixelRatioF() : qApp->devicePixelRatio();
|
qreal dpr = paintDevice ? paintDevice->devicePixelRatio() : qApp->devicePixelRatio();
|
||||||
const QSize pixmapSize = rect.size() * dpr;
|
const QSize pixmapSize = rect.size() * dpr;
|
||||||
QPixmap px = pixmap(pixmapSize, mode, state);
|
QPixmap px = pixmap(pixmapSize, mode, state);
|
||||||
painter->drawPixmap(rect, px);
|
painter->drawPixmap(rect, px);
|
||||||
|
@ -641,7 +641,7 @@ void QIconLoaderEngine::ensureLoaded()
|
|||||||
void QIconLoaderEngine::paint(QPainter *painter, const QRect &rect,
|
void QIconLoaderEngine::paint(QPainter *painter, const QRect &rect,
|
||||||
QIcon::Mode mode, QIcon::State state)
|
QIcon::Mode mode, QIcon::State state)
|
||||||
{
|
{
|
||||||
QSize pixmapSize = rect.size() * painter->device()->devicePixelRatioF();
|
QSize pixmapSize = rect.size() * painter->device()->devicePixelRatio();
|
||||||
painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
|
painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ QT_END_NAMESPACE
|
|||||||
// NSImage.
|
// NSImage.
|
||||||
auto nsImage = [[NSImage alloc] initWithSize:NSZeroSize];
|
auto nsImage = [[NSImage alloc] initWithSize:NSZeroSize];
|
||||||
auto *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
auto *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
||||||
imageRep.size = (image.size() / image.devicePixelRatioF()).toCGSize();
|
imageRep.size = (image.size() / image.devicePixelRatio()).toCGSize();
|
||||||
[nsImage addRepresentation:[imageRep autorelease]];
|
[nsImage addRepresentation:[imageRep autorelease]];
|
||||||
Q_ASSERT(CGSizeEqualToSize(nsImage.size, imageRep.size));
|
Q_ASSERT(CGSizeEqualToSize(nsImage.size, imageRep.size));
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ QT_END_NAMESPACE
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
auto *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
||||||
imageRep.size = (image.size() / image.devicePixelRatioF()).toCGSize();
|
imageRep.size = (image.size() / image.devicePixelRatio()).toCGSize();
|
||||||
[nsImage addRepresentation:[imageRep autorelease]];
|
[nsImage addRepresentation:[imageRep autorelease]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ void QEmulationPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (style == Qt::TexturePattern) {
|
} else if (style == Qt::TexturePattern) {
|
||||||
qreal dpr = qHasPixmapTexture(brush) ? brush.texture().devicePixelRatioF() : brush.textureImage().devicePixelRatioF();
|
qreal dpr = qHasPixmapTexture(brush) ? brush.texture().devicePixelRatio() : brush.textureImage().devicePixelRatio();
|
||||||
if (!qFuzzyCompare(dpr, qreal(1.0))) {
|
if (!qFuzzyCompare(dpr, qreal(1.0))) {
|
||||||
QBrush copy = brush;
|
QBrush copy = brush;
|
||||||
combineXForm(©, QRectF(0, 0, 1.0/dpr, 1.0/dpr));
|
combineXForm(©, QRectF(0, 0, 1.0/dpr, 1.0/dpr));
|
||||||
|
@ -951,8 +951,8 @@ void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, con
|
|||||||
{
|
{
|
||||||
QBrush brush(state()->pen.color(), pixmap);
|
QBrush brush(state()->pen.color(), pixmap);
|
||||||
QTransform xform = QTransform::fromTranslate(r.x() - s.x(), r.y() - s.y());
|
QTransform xform = QTransform::fromTranslate(r.x() - s.x(), r.y() - s.y());
|
||||||
if (!qFuzzyCompare(pixmap.devicePixelRatioF(), qreal(1.0)))
|
if (!qFuzzyCompare(pixmap.devicePixelRatio(), qreal(1.0)))
|
||||||
xform.scale(1.0/pixmap.devicePixelRatioF(), 1.0/pixmap.devicePixelRatioF());
|
xform.scale(1.0/pixmap.devicePixelRatio(), 1.0/pixmap.devicePixelRatio());
|
||||||
brush.setTransform(xform);
|
brush.setTransform(xform);
|
||||||
|
|
||||||
qreal pts[] = { r.x(), r.y(),
|
qreal pts[] = { r.x(), r.y(),
|
||||||
|
@ -197,9 +197,9 @@ void QPainterPrivate::checkEmulation()
|
|||||||
|
|
||||||
if (state->brush.style() == Qt::TexturePattern) {
|
if (state->brush.style() == Qt::TexturePattern) {
|
||||||
if (qHasPixmapTexture(state->brush))
|
if (qHasPixmapTexture(state->brush))
|
||||||
doEmulation |= !qFuzzyCompare(state->brush.texture().devicePixelRatioF(), qreal(1.0));
|
doEmulation |= !qFuzzyCompare(state->brush.texture().devicePixelRatio(), qreal(1.0));
|
||||||
else
|
else
|
||||||
doEmulation |= !qFuzzyCompare(state->brush.textureImage().devicePixelRatioF(), qreal(1.0));
|
doEmulation |= !qFuzzyCompare(state->brush.textureImage().devicePixelRatio(), qreal(1.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doEmulation && extended->flags() & QPaintEngineEx::DoNotEmulate)
|
if (doEmulation && extended->flags() & QPaintEngineEx::DoNotEmulate)
|
||||||
@ -242,7 +242,7 @@ qreal QPainterPrivate::effectiveDevicePixelRatio() const
|
|||||||
if (device->devType() == QInternal::Printer)
|
if (device->devType() == QInternal::Printer)
|
||||||
return qreal(1);
|
return qreal(1);
|
||||||
|
|
||||||
return qMax(qreal(1), device->devicePixelRatioF());
|
return qMax(qreal(1), device->devicePixelRatio());
|
||||||
}
|
}
|
||||||
|
|
||||||
QTransform QPainterPrivate::hidpiScaleTransform() const
|
QTransform QPainterPrivate::hidpiScaleTransform() const
|
||||||
|
@ -240,10 +240,10 @@ void QTextImageHandler::drawObject(QPainter *p, const QRectF &rect, QTextDocumen
|
|||||||
const QTextImageFormat imageFormat = format.toImageFormat();
|
const QTextImageFormat imageFormat = format.toImageFormat();
|
||||||
|
|
||||||
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
|
if (QCoreApplication::instance()->thread() != QThread::currentThread()) {
|
||||||
const QImage image = getImage(doc, imageFormat, p->device()->devicePixelRatioF());
|
const QImage image = getImage(doc, imageFormat, p->device()->devicePixelRatio());
|
||||||
p->drawImage(rect, image, image.rect());
|
p->drawImage(rect, image, image.rect());
|
||||||
} else {
|
} else {
|
||||||
const QPixmap pixmap = getPixmap(doc, imageFormat, p->device()->devicePixelRatioF());
|
const QPixmap pixmap = getPixmap(doc, imageFormat, p->device()->devicePixelRatio());
|
||||||
p->drawPixmap(rect, pixmap, pixmap.rect());
|
p->drawPixmap(rect, pixmap, pixmap.rect());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -695,7 +695,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
|
|||||||
if (textureFormat)
|
if (textureFormat)
|
||||||
format.setInternalTextureFormat(textureFormat);
|
format.setInternalTextureFormat(textureFormat);
|
||||||
|
|
||||||
const QSize deviceSize = q->size() * q->devicePixelRatioF();
|
const QSize deviceSize = q->size() * q->devicePixelRatio();
|
||||||
fbo = new QOpenGLFramebufferObject(deviceSize, format);
|
fbo = new QOpenGLFramebufferObject(deviceSize, format);
|
||||||
if (samples > 0)
|
if (samples > 0)
|
||||||
resolvedFbo = new QOpenGLFramebufferObject(deviceSize);
|
resolvedFbo = new QOpenGLFramebufferObject(deviceSize);
|
||||||
@ -707,7 +707,7 @@ void QOpenGLWidgetPrivate::recreateFbo()
|
|||||||
flushPending = true; // Make sure the FBO is initialized before use
|
flushPending = true; // Make sure the FBO is initialized before use
|
||||||
|
|
||||||
paintDevice->setSize(deviceSize);
|
paintDevice->setSize(deviceSize);
|
||||||
paintDevice->setDevicePixelRatio(q->devicePixelRatioF());
|
paintDevice->setDevicePixelRatio(q->devicePixelRatio());
|
||||||
|
|
||||||
emit q->resized();
|
emit q->resized();
|
||||||
}
|
}
|
||||||
@ -794,8 +794,8 @@ void QOpenGLWidgetPrivate::initialize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
paintDevice = new QOpenGLWidgetPaintDevice(q);
|
paintDevice = new QOpenGLWidgetPaintDevice(q);
|
||||||
paintDevice->setSize(q->size() * q->devicePixelRatioF());
|
paintDevice->setSize(q->size() * q->devicePixelRatio());
|
||||||
paintDevice->setDevicePixelRatio(q->devicePixelRatioF());
|
paintDevice->setDevicePixelRatio(q->devicePixelRatio());
|
||||||
|
|
||||||
context = ctx.take();
|
context = ctx.take();
|
||||||
initialized = true;
|
initialized = true;
|
||||||
@ -824,7 +824,7 @@ void QOpenGLWidgetPrivate::invokeUserPaint()
|
|||||||
QOpenGLFunctions *f = ctx->functions();
|
QOpenGLFunctions *f = ctx->functions();
|
||||||
QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = fbo->handle();
|
QOpenGLContextPrivate::get(ctx)->defaultFboRedirect = fbo->handle();
|
||||||
|
|
||||||
f->glViewport(0, 0, q->width() * q->devicePixelRatioF(), q->height() * q->devicePixelRatioF());
|
f->glViewport(0, 0, q->width() * q->devicePixelRatio(), q->height() * q->devicePixelRatio());
|
||||||
inPaintGL = true;
|
inPaintGL = true;
|
||||||
q->paintGL();
|
q->paintGL();
|
||||||
inPaintGL = false;
|
inPaintGL = false;
|
||||||
@ -898,8 +898,8 @@ QImage QOpenGLWidgetPrivate::grabFramebuffer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bool hasAlpha = q->format().hasAlpha();
|
const bool hasAlpha = q->format().hasAlpha();
|
||||||
QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatioF(), hasAlpha, hasAlpha);
|
QImage res = qt_gl_read_framebuffer(q->size() * q->devicePixelRatio(), hasAlpha, hasAlpha);
|
||||||
res.setDevicePixelRatio(q->devicePixelRatioF());
|
res.setDevicePixelRatio(q->devicePixelRatio());
|
||||||
|
|
||||||
// While we give no guarantees of what is going to be left bound, prefer the
|
// While we give no guarantees of what is going to be left bound, prefer the
|
||||||
// multisample fbo instead of the resolved one. Clients may continue to
|
// multisample fbo instead of the resolved one. Clients may continue to
|
||||||
@ -924,7 +924,7 @@ void QOpenGLWidgetPrivate::resizeViewportFramebuffer()
|
|||||||
if (!initialized)
|
if (!initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!fbo || q->size() * q->devicePixelRatioF() != fbo->size()) {
|
if (!fbo || q->size() * q->devicePixelRatio() != fbo->size()) {
|
||||||
recreateFbo();
|
recreateFbo();
|
||||||
q->update();
|
q->update();
|
||||||
}
|
}
|
||||||
@ -1403,7 +1403,7 @@ bool QOpenGLWidget::event(QEvent *e)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QEvent::ScreenChangeInternal:
|
case QEvent::ScreenChangeInternal:
|
||||||
if (d->initialized && d->paintDevice->devicePixelRatioF() != devicePixelRatioF())
|
if (d->initialized && d->paintDevice->devicePixelRatio() != devicePixelRatio())
|
||||||
d->recreateFbo();
|
d->recreateFbo();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -456,7 +456,7 @@ void QWasmCompositor::drawFrameWindow(QWasmFrameOptions options, QPainter *paint
|
|||||||
const QColor &c4 = options.palette.dark().color();
|
const QColor &c4 = options.palette.dark().color();
|
||||||
const QBrush *fill = 0;
|
const QBrush *fill = 0;
|
||||||
|
|
||||||
const qreal devicePixelRatio = painter->device()->devicePixelRatioF();
|
const qreal devicePixelRatio = painter->device()->devicePixelRatio();
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
||||||
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
||||||
painter->scale(inverseScale, inverseScale);
|
painter->scale(inverseScale, inverseScale);
|
||||||
@ -599,7 +599,7 @@ void QWasmCompositor::drawShadePanel(QWasmTitleBarOptions options, QPainter *pai
|
|||||||
int w = options.rect.width();
|
int w = options.rect.width();
|
||||||
int h = options.rect.height();
|
int h = options.rect.height();
|
||||||
|
|
||||||
const qreal devicePixelRatio = painter->device()->devicePixelRatioF();
|
const qreal devicePixelRatio = painter->device()->devicePixelRatio();
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
||||||
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
||||||
painter->scale(inverseScale, inverseScale);
|
painter->scale(inverseScale, inverseScale);
|
||||||
|
@ -102,7 +102,7 @@ QWindowsPixmapCursorCacheKey::QWindowsPixmapCursorCacheKey(const QCursor &c)
|
|||||||
HCURSOR QWindowsCursor::createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor)
|
HCURSOR QWindowsCursor::createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor)
|
||||||
{
|
{
|
||||||
HCURSOR cur = nullptr;
|
HCURSOR cur = nullptr;
|
||||||
const qreal pixmapScaleFactor = scaleFactor / pixmap.devicePixelRatioF();
|
const qreal pixmapScaleFactor = scaleFactor / pixmap.devicePixelRatio();
|
||||||
if (!qFuzzyCompare(pixmapScaleFactor, 1)) {
|
if (!qFuzzyCompare(pixmapScaleFactor, 1)) {
|
||||||
pixmap = pixmap.scaled((pixmapScaleFactor * QSizeF(pixmap.size())).toSize(),
|
pixmap = pixmap.scaled((pixmapScaleFactor * QSizeF(pixmap.size())).toSize(),
|
||||||
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
@ -170,7 +170,7 @@ static HCURSOR createBitmapCursor(const QCursor &cursor, qreal scaleFactor = 1)
|
|||||||
Q_ASSERT(cursor.shape() == Qt::BitmapCursor && !cursor.bitmap(Qt::ReturnByValue).isNull());
|
Q_ASSERT(cursor.shape() == Qt::BitmapCursor && !cursor.bitmap(Qt::ReturnByValue).isNull());
|
||||||
QImage bbits = cursor.bitmap(Qt::ReturnByValue).toImage();
|
QImage bbits = cursor.bitmap(Qt::ReturnByValue).toImage();
|
||||||
QImage mbits = cursor.mask(Qt::ReturnByValue).toImage();
|
QImage mbits = cursor.mask(Qt::ReturnByValue).toImage();
|
||||||
scaleFactor /= bbits.devicePixelRatioF();
|
scaleFactor /= bbits.devicePixelRatio();
|
||||||
if (!qFuzzyCompare(scaleFactor, 1)) {
|
if (!qFuzzyCompare(scaleFactor, 1)) {
|
||||||
const QSize scaledSize = (QSizeF(bbits.size()) * scaleFactor).toSize();
|
const QSize scaledSize = (QSizeF(bbits.size()) * scaleFactor).toSize();
|
||||||
bbits = bbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
bbits = bbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
@ -3977,7 +3977,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||||||
|
|
||||||
if (needsInactiveHack) {
|
if (needsInactiveHack) {
|
||||||
// First, render tab as non-selected tab on a pixamp
|
// First, render tab as non-selected tab on a pixamp
|
||||||
const qreal pixelRatio = p->device()->devicePixelRatioF();
|
const qreal pixelRatio = p->device()->devicePixelRatio();
|
||||||
QImage tabPixmap(opt->rect.size() * pixelRatio, QImage::Format_ARGB32_Premultiplied);
|
QImage tabPixmap(opt->rect.size() * pixelRatio, QImage::Format_ARGB32_Premultiplied);
|
||||||
tabPixmap.setDevicePixelRatio(pixelRatio);
|
tabPixmap.setDevicePixelRatio(pixelRatio);
|
||||||
tabPixmap.fill(Qt::transparent);
|
tabPixmap.fill(Qt::transparent);
|
||||||
@ -5570,7 +5570,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||||||
QPainterPath outerFramePath = d->windowPanelPath(outerFrameRect);
|
QPainterPath outerFramePath = d->windowPanelPath(outerFrameRect);
|
||||||
p->fillPath(outerFramePath, opt->palette.dark());
|
p->fillPath(outerFramePath, opt->palette.dark());
|
||||||
|
|
||||||
const auto frameAdjust = 1.0 / p->device()->devicePixelRatioF();
|
const auto frameAdjust = 1.0 / p->device()->devicePixelRatio();
|
||||||
const auto innerFrameRect = outerFrameRect.adjusted(frameAdjust, frameAdjust, -frameAdjust, 0);
|
const auto innerFrameRect = outerFrameRect.adjusted(frameAdjust, frameAdjust, -frameAdjust, 0);
|
||||||
QPainterPath innerFramePath = d->windowPanelPath(innerFrameRect);
|
QPainterPath innerFramePath = d->windowPanelPath(innerFrameRect);
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
|
@ -679,7 +679,7 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData, qreal correc
|
|||||||
|
|
||||||
bool translucentToplevel = false;
|
bool translucentToplevel = false;
|
||||||
const QPaintDevice *paintDevice = painter->device();
|
const QPaintDevice *paintDevice = painter->device();
|
||||||
const qreal aditionalDevicePixelRatio = themeData.widget ? themeData.widget->devicePixelRatioF() : qreal(1);
|
const qreal aditionalDevicePixelRatio = themeData.widget ? themeData.widget->devicePixelRatio() : qreal(1);
|
||||||
if (paintDevice->devType() == QInternal::Widget) {
|
if (paintDevice->devType() == QInternal::Widget) {
|
||||||
const QWidget *window = static_cast<const QWidget *>(paintDevice)->window();
|
const QWidget *window = static_cast<const QWidget *>(paintDevice)->window();
|
||||||
translucentToplevel = window->testAttribute(Qt::WA_TranslucentBackground);
|
translucentToplevel = window->testAttribute(Qt::WA_TranslucentBackground);
|
||||||
@ -2495,7 +2495,7 @@ static void populateMdiButtonTheme(const QStyle *proxy, const QWidget *widget,
|
|||||||
// small on High DPI screens (QTBUG-75927).
|
// small on High DPI screens (QTBUG-75927).
|
||||||
qreal mdiButtonCorrectionFactor(XPThemeData &theme, const QPaintDevice *pd = nullptr)
|
qreal mdiButtonCorrectionFactor(XPThemeData &theme, const QPaintDevice *pd = nullptr)
|
||||||
{
|
{
|
||||||
const auto dpr = pd ? pd->devicePixelRatioF() : qApp->devicePixelRatio();
|
const auto dpr = pd ? pd->devicePixelRatio() : qApp->devicePixelRatio();
|
||||||
const QSizeF nativeSize = QSizeF(theme.size()) / dpr;
|
const QSizeF nativeSize = QSizeF(theme.size()) / dpr;
|
||||||
const QSizeF requestedSize(theme.rect.size());
|
const QSizeF requestedSize(theme.rect.size());
|
||||||
const auto rawFactor = qMin(requestedSize.width() / nativeSize.width(),
|
const auto rawFactor = qMin(requestedSize.width() / nativeSize.width(),
|
||||||
|
@ -162,12 +162,12 @@ inline bool qCompare(QImage const &t1, QImage const &t2,
|
|||||||
}
|
}
|
||||||
if (t1Null && t2Null)
|
if (t1Null && t2Null)
|
||||||
return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
|
return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
|
||||||
if (!qFuzzyCompare(t1.devicePixelRatioF(), t2.devicePixelRatioF())) {
|
if (!qFuzzyCompare(t1.devicePixelRatio(), t2.devicePixelRatio())) {
|
||||||
qsnprintf(msg, 1024, "Compared QImages differ in device pixel ratio.\n"
|
qsnprintf(msg, 1024, "Compared QImages differ in device pixel ratio.\n"
|
||||||
" Actual (%s): %g\n"
|
" Actual (%s): %g\n"
|
||||||
" Expected (%s): %g",
|
" Expected (%s): %g",
|
||||||
actual, t1.devicePixelRatioF(),
|
actual, t1.devicePixelRatio(),
|
||||||
expected, t2.devicePixelRatioF());
|
expected, t2.devicePixelRatio());
|
||||||
return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
|
return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
|
||||||
}
|
}
|
||||||
if (t1.width() != t2.width() || t1.height() != t2.height()) {
|
if (t1.width() != t2.width() || t1.height() != t2.height()) {
|
||||||
@ -204,12 +204,12 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c
|
|||||||
}
|
}
|
||||||
if (t1Null && t2Null)
|
if (t1Null && t2Null)
|
||||||
return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
|
return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
|
||||||
if (!qFuzzyCompare(t1.devicePixelRatioF(), t2.devicePixelRatioF())) {
|
if (!qFuzzyCompare(t1.devicePixelRatio(), t2.devicePixelRatio())) {
|
||||||
qsnprintf(msg, 1024, "Compared QPixmaps differ in device pixel ratio.\n"
|
qsnprintf(msg, 1024, "Compared QPixmaps differ in device pixel ratio.\n"
|
||||||
" Actual (%s): %g\n"
|
" Actual (%s): %g\n"
|
||||||
" Expected (%s): %g",
|
" Expected (%s): %g",
|
||||||
actual, t1.devicePixelRatioF(),
|
actual, t1.devicePixelRatio(),
|
||||||
expected, t2.devicePixelRatioF());
|
expected, t2.devicePixelRatio());
|
||||||
return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
|
return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
|
||||||
}
|
}
|
||||||
if (t1.width() != t2.width() || t1.height() != t2.height()) {
|
if (t1.width() != t2.width() || t1.height() != t2.height()) {
|
||||||
|
@ -719,7 +719,7 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp
|
|||||||
}
|
}
|
||||||
|
|
||||||
QImage temp(img.height(), img.width(), img.format());
|
QImage temp(img.height(), img.width(), img.format());
|
||||||
temp.setDevicePixelRatio(img.devicePixelRatioF());
|
temp.setDevicePixelRatio(img.devicePixelRatio());
|
||||||
if (transposed >= 0) {
|
if (transposed >= 0) {
|
||||||
if (img.depth() == 8) {
|
if (img.depth() == 8) {
|
||||||
qt_memrotate270(reinterpret_cast<const quint8*>(img.bits()),
|
qt_memrotate270(reinterpret_cast<const quint8*>(img.bits()),
|
||||||
@ -781,7 +781,7 @@ Q_WIDGETS_EXPORT QImage qt_halfScaled(const QImage &source)
|
|||||||
if (source.format() == QImage::Format_Indexed8 || source.format() == QImage::Format_Grayscale8) {
|
if (source.format() == QImage::Format_Indexed8 || source.format() == QImage::Format_Grayscale8) {
|
||||||
// assumes grayscale
|
// assumes grayscale
|
||||||
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
|
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
|
||||||
dest.setDevicePixelRatio(source.devicePixelRatioF());
|
dest.setDevicePixelRatio(source.devicePixelRatio());
|
||||||
|
|
||||||
const uchar *src = reinterpret_cast<const uchar*>(const_cast<const QImage &>(srcImage).bits());
|
const uchar *src = reinterpret_cast<const uchar*>(const_cast<const QImage &>(srcImage).bits());
|
||||||
qsizetype sx = srcImage.bytesPerLine();
|
qsizetype sx = srcImage.bytesPerLine();
|
||||||
@ -803,7 +803,7 @@ Q_WIDGETS_EXPORT QImage qt_halfScaled(const QImage &source)
|
|||||||
return dest;
|
return dest;
|
||||||
} else if (source.format() == QImage::Format_ARGB8565_Premultiplied) {
|
} else if (source.format() == QImage::Format_ARGB8565_Premultiplied) {
|
||||||
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
|
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
|
||||||
dest.setDevicePixelRatio(source.devicePixelRatioF());
|
dest.setDevicePixelRatio(source.devicePixelRatio());
|
||||||
|
|
||||||
const uchar *src = reinterpret_cast<const uchar*>(const_cast<const QImage &>(srcImage).bits());
|
const uchar *src = reinterpret_cast<const uchar*>(const_cast<const QImage &>(srcImage).bits());
|
||||||
qsizetype sx = srcImage.bytesPerLine();
|
qsizetype sx = srcImage.bytesPerLine();
|
||||||
@ -840,7 +840,7 @@ Q_WIDGETS_EXPORT QImage qt_halfScaled(const QImage &source)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
|
QImage dest(source.width() / 2, source.height() / 2, srcImage.format());
|
||||||
dest.setDevicePixelRatio(source.devicePixelRatioF());
|
dest.setDevicePixelRatio(source.devicePixelRatio());
|
||||||
|
|
||||||
const quint32 *src = reinterpret_cast<const quint32*>(const_cast<const QImage &>(srcImage).bits());
|
const quint32 *src = reinterpret_cast<const quint32*>(const_cast<const QImage &>(srcImage).bits());
|
||||||
qsizetype sx = srcImage.bytesPerLine() >> 2;
|
qsizetype sx = srcImage.bytesPerLine() >> 2;
|
||||||
@ -885,7 +885,7 @@ Q_WIDGETS_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius,
|
|||||||
if (p) {
|
if (p) {
|
||||||
p->scale(scale, scale);
|
p->scale(scale, scale);
|
||||||
p->setRenderHint(QPainter::SmoothPixmapTransform);
|
p->setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
p->drawImage(QRect(QPoint(0, 0), blurImage.size() / blurImage.devicePixelRatioF()), blurImage);
|
p->drawImage(QRect(QPoint(0, 0), blurImage.size() / blurImage.devicePixelRatio()), blurImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1114,7 +1114,7 @@ void QPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const Q
|
|||||||
srcImage = std::move(srcImage).convertToFormat(format);
|
srcImage = std::move(srcImage).convertToFormat(format);
|
||||||
destImage = QImage(rect.size(), srcImage.format());
|
destImage = QImage(rect.size(), srcImage.format());
|
||||||
}
|
}
|
||||||
destImage.setDevicePixelRatio(src.devicePixelRatioF());
|
destImage.setDevicePixelRatio(src.devicePixelRatio());
|
||||||
|
|
||||||
// do colorizing
|
// do colorizing
|
||||||
QPainter destPainter(&destImage);
|
QPainter destPainter(&destImage);
|
||||||
@ -1323,7 +1323,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QImage tmp(px.size(), QImage::Format_ARGB32_Premultiplied);
|
QImage tmp(px.size(), QImage::Format_ARGB32_Premultiplied);
|
||||||
tmp.setDevicePixelRatio(px.devicePixelRatioF());
|
tmp.setDevicePixelRatio(px.devicePixelRatio());
|
||||||
tmp.fill(0);
|
tmp.fill(0);
|
||||||
QPainter tmpPainter(&tmp);
|
QPainter tmpPainter(&tmp);
|
||||||
tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
|
tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
@ -1332,7 +1332,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
|
|||||||
|
|
||||||
// blur the alpha channel
|
// blur the alpha channel
|
||||||
QImage blurred(tmp.size(), QImage::Format_ARGB32_Premultiplied);
|
QImage blurred(tmp.size(), QImage::Format_ARGB32_Premultiplied);
|
||||||
blurred.setDevicePixelRatio(px.devicePixelRatioF());
|
blurred.setDevicePixelRatio(px.devicePixelRatio());
|
||||||
blurred.fill(0);
|
blurred.fill(0);
|
||||||
QPainter blurPainter(&blurred);
|
QPainter blurPainter(&blurred);
|
||||||
qt_blurImage(&blurPainter, tmp, d->radius, false, true);
|
qt_blurImage(&blurPainter, tmp, d->radius, false, true);
|
||||||
|
@ -11194,7 +11194,7 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP
|
|||||||
if (effectRect.isEmpty())
|
if (effectRect.isEmpty())
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
const auto dpr = info ? info->painter->device()->devicePixelRatioF() : 1.0;
|
const auto dpr = info ? info->painter->device()->devicePixelRatio() : 1.0;
|
||||||
QPixmap pixmap(QRectF(effectRectF.topLeft(), effectRectF.size() * dpr).toAlignedRect().size());
|
QPixmap pixmap(QRectF(effectRectF.topLeft(), effectRectF.size() * dpr).toAlignedRect().size());
|
||||||
pixmap.setDevicePixelRatio(dpr);
|
pixmap.setDevicePixelRatio(dpr);
|
||||||
pixmap.fill(Qt::transparent);
|
pixmap.fill(Qt::transparent);
|
||||||
|
@ -3449,7 +3449,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
|
|||||||
// Recreate the background pixmap, and flag the whole background as
|
// Recreate the background pixmap, and flag the whole background as
|
||||||
// exposed.
|
// exposed.
|
||||||
if (d->mustResizeBackgroundPixmap) {
|
if (d->mustResizeBackgroundPixmap) {
|
||||||
const qreal dpr = d->viewport->devicePixelRatioF();
|
const qreal dpr = d->viewport->devicePixelRatio();
|
||||||
d->backgroundPixmap = QPixmap(viewport()->size() * dpr);
|
d->backgroundPixmap = QPixmap(viewport()->size() * dpr);
|
||||||
d->backgroundPixmap.setDevicePixelRatio(dpr);
|
d->backgroundPixmap.setDevicePixelRatio(dpr);
|
||||||
QBrush bgBrush = viewport()->palette().brush(viewport()->backgroundRole());
|
QBrush bgBrush = viewport()->palette().brush(viewport()->backgroundRole());
|
||||||
|
@ -3350,7 +3350,7 @@ void QHeaderViewPrivate::setupSectionIndicator(int section, int position)
|
|||||||
sectionIndicator->resize(w, h);
|
sectionIndicator->resize(w, h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const qreal pixmapDevicePixelRatio = q->devicePixelRatioF();
|
const qreal pixmapDevicePixelRatio = q->devicePixelRatio();
|
||||||
QPixmap pm(QSize(w, h) * pixmapDevicePixelRatio);
|
QPixmap pm(QSize(w, h) * pixmapDevicePixelRatio);
|
||||||
pm.setDevicePixelRatio(pixmapDevicePixelRatio);
|
pm.setDevicePixelRatio(pixmapDevicePixelRatio);
|
||||||
pm.fill(QColor(0, 0, 0, 45));
|
pm.fill(QColor(0, 0, 0, 45));
|
||||||
|
@ -3254,8 +3254,8 @@ void QTreeViewPrivate::drawAnimatedOperation(QPainter *painter) const
|
|||||||
QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect &rect) const
|
QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect &rect) const
|
||||||
{
|
{
|
||||||
Q_Q(const QTreeView);
|
Q_Q(const QTreeView);
|
||||||
QPixmap pixmap(rect.size() * q->devicePixelRatioF());
|
QPixmap pixmap(rect.size() * q->devicePixelRatio());
|
||||||
pixmap.setDevicePixelRatio(q->devicePixelRatioF());
|
pixmap.setDevicePixelRatio(q->devicePixelRatio());
|
||||||
if (rect.size().isEmpty())
|
if (rect.size().isEmpty())
|
||||||
return pixmap;
|
return pixmap;
|
||||||
pixmap.fill(Qt::transparent); //the base might not be opaque, and we don't want uninitialized pixels.
|
pixmap.fill(Qt::transparent); //the base might not be opaque, and we don't want uninitialized pixels.
|
||||||
|
@ -5072,7 +5072,7 @@ QPixmap QWidget::grab(const QRect &rectangle)
|
|||||||
if (!r.intersects(rect()))
|
if (!r.intersects(rect()))
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
const qreal dpr = devicePixelRatioF();
|
const qreal dpr = devicePixelRatio();
|
||||||
QPixmap res((QSizeF(r.size()) * dpr).toSize());
|
QPixmap res((QSizeF(r.size()) * dpr).toSize());
|
||||||
res.setDevicePixelRatio(dpr);
|
res.setDevicePixelRatio(dpr);
|
||||||
if (!d->isOpaque)
|
if (!d->isOpaque)
|
||||||
@ -5237,7 +5237,7 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
|
|||||||
if (size.isNull())
|
if (size.isNull())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const qreal pixmapDevicePixelRatio = painter->device()->devicePixelRatioF();
|
const qreal pixmapDevicePixelRatio = painter->device()->devicePixelRatio();
|
||||||
QPixmap pixmap(size * pixmapDevicePixelRatio);
|
QPixmap pixmap(size * pixmapDevicePixelRatio);
|
||||||
pixmap.setDevicePixelRatio(pixmapDevicePixelRatio);
|
pixmap.setDevicePixelRatio(pixmapDevicePixelRatio);
|
||||||
|
|
||||||
@ -5308,7 +5308,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
|
|||||||
QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, repaintManager);
|
QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, repaintManager);
|
||||||
sourced->context = &context;
|
sourced->context = &context;
|
||||||
if (!sharedPainter) {
|
if (!sharedPainter) {
|
||||||
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), rgn.translated(offset));
|
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatio(), rgn.translated(offset));
|
||||||
QPainter p(pdev);
|
QPainter p(pdev);
|
||||||
p.translate(offset);
|
p.translate(offset);
|
||||||
context.painter = &p;
|
context.painter = &p;
|
||||||
@ -5322,7 +5322,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
|
|||||||
}
|
}
|
||||||
sharedPainter->save();
|
sharedPainter->save();
|
||||||
sharedPainter->translate(offset);
|
sharedPainter->translate(offset);
|
||||||
setSystemClip(sharedPainter->paintEngine(), sharedPainter->device()->devicePixelRatioF(), rgn.translated(offset));
|
setSystemClip(sharedPainter->paintEngine(), sharedPainter->device()->devicePixelRatio(), rgn.translated(offset));
|
||||||
graphicsEffect->draw(sharedPainter);
|
graphicsEffect->draw(sharedPainter);
|
||||||
setSystemClip(sharedPainter->paintEngine(), 1, QRegion());
|
setSystemClip(sharedPainter->paintEngine(), 1, QRegion());
|
||||||
sharedPainter->restore();
|
sharedPainter->restore();
|
||||||
@ -5362,7 +5362,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
|
|||||||
setRedirected(pdev, -offset);
|
setRedirected(pdev, -offset);
|
||||||
|
|
||||||
if (sharedPainter)
|
if (sharedPainter)
|
||||||
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), toBePainted);
|
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatio(), toBePainted);
|
||||||
else
|
else
|
||||||
paintEngine->d_func()->systemRect = q->data->crect;
|
paintEngine->d_func()->systemRect = q->data->crect;
|
||||||
|
|
||||||
@ -5380,7 +5380,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!sharedPainter)
|
if (!sharedPainter)
|
||||||
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), toBePainted.translated(offset));
|
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatio(), toBePainted.translated(offset));
|
||||||
|
|
||||||
if (!onScreen && !asRoot && !isOpaque && q->testAttribute(Qt::WA_TintedBackground)) {
|
if (!onScreen && !asRoot && !isOpaque && q->testAttribute(Qt::WA_TintedBackground)) {
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
@ -5687,7 +5687,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
|
|||||||
|
|
||||||
qreal dpr(1.0);
|
qreal dpr(1.0);
|
||||||
if (const auto *paintDevice = context->painter->device())
|
if (const auto *paintDevice = context->painter->device())
|
||||||
dpr = paintDevice->devicePixelRatioF();
|
dpr = paintDevice->devicePixelRatio();
|
||||||
else
|
else
|
||||||
qWarning("QWidgetEffectSourcePrivate::pixmap: Painter not active");
|
qWarning("QWidgetEffectSourcePrivate::pixmap: Painter not active");
|
||||||
QPixmap pixmap(effectRect.size() * dpr);
|
QPixmap pixmap(effectRect.size() * dpr);
|
||||||
@ -12842,7 +12842,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
|
|||||||
frameGeometry.bottom() - geometry.bottom());
|
frameGeometry.bottom() - geometry.bottom());
|
||||||
debug << ", margins=" << margins;
|
debug << ", margins=" << margins;
|
||||||
}
|
}
|
||||||
debug << ", devicePixelRatio=" << widget->devicePixelRatioF();
|
debug << ", devicePixelRatio=" << widget->devicePixelRatio();
|
||||||
if (const WId wid = widget->internalWinId())
|
if (const WId wid = widget->internalWinId())
|
||||||
debug << ", winId=0x" << Qt::hex << wid << Qt::dec;
|
debug << ", winId=0x" << Qt::hex << wid << Qt::dec;
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
|||||||
% QLatin1String(metaObject()->className()), opt, QSize(size, size))
|
% QLatin1String(metaObject()->className()), opt, QSize(size, size))
|
||||||
% HexString<uint>(pe);
|
% HexString<uint>(pe);
|
||||||
if (!QPixmapCache::find(pixmapName, &pixmap)) {
|
if (!QPixmapCache::find(pixmapName, &pixmap)) {
|
||||||
qreal pixelRatio = p->device()->devicePixelRatioF();
|
qreal pixelRatio = p->device()->devicePixelRatio();
|
||||||
int border = qRound(pixelRatio*(size/5));
|
int border = qRound(pixelRatio*(size/5));
|
||||||
int sqsize = qRound(pixelRatio*(2*(size/2)));
|
int sqsize = qRound(pixelRatio*(2*(size/2)));
|
||||||
QImage image(sqsize, sqsize, QImage::Format_ARGB32_Premultiplied);
|
QImage image(sqsize, sqsize, QImage::Format_ARGB32_Premultiplied);
|
||||||
|
@ -244,7 +244,7 @@ void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PainterStateGuard painterGuard(p);
|
PainterStateGuard painterGuard(p);
|
||||||
const qreal devicePixelRatio = p->device()->devicePixelRatioF();
|
const qreal devicePixelRatio = p->device()->devicePixelRatio();
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
||||||
painterGuard.save();
|
painterGuard.save();
|
||||||
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
||||||
@ -358,7 +358,7 @@ void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PainterStateGuard painterGuard(p);
|
PainterStateGuard painterGuard(p);
|
||||||
const qreal devicePixelRatio = p->device()->devicePixelRatioF();
|
const qreal devicePixelRatio = p->device()->devicePixelRatio();
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
||||||
painterGuard.save();
|
painterGuard.save();
|
||||||
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
||||||
@ -449,7 +449,7 @@ static void qDrawWinShades(QPainter *p,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
PainterStateGuard painterGuard(p);
|
PainterStateGuard painterGuard(p);
|
||||||
const qreal devicePixelRatio = p->device()->devicePixelRatioF();
|
const qreal devicePixelRatio = p->device()->devicePixelRatio();
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
||||||
painterGuard.save();
|
painterGuard.save();
|
||||||
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
||||||
@ -591,7 +591,7 @@ void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PainterStateGuard painterGuard(p);
|
PainterStateGuard painterGuard(p);
|
||||||
const qreal devicePixelRatio = p->device()->devicePixelRatioF();
|
const qreal devicePixelRatio = p->device()->devicePixelRatio();
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
||||||
painterGuard.save();
|
painterGuard.save();
|
||||||
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
const qreal inverseScale = qreal(1) / devicePixelRatio;
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr);
|
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr);
|
||||||
static int fixedPixelMetric(QStyle::PixelMetric pm);
|
static int fixedPixelMetric(QStyle::PixelMetric pm);
|
||||||
static qreal devicePixelRatio(const QWidget *widget = nullptr)
|
static qreal devicePixelRatio(const QWidget *widget = nullptr)
|
||||||
{ return widget ? widget->devicePixelRatioF() : QWindowsStylePrivate::appDevicePixelRatio(); }
|
{ return widget ? widget->devicePixelRatio() : QWindowsStylePrivate::appDevicePixelRatio(); }
|
||||||
static qreal nativeMetricScaleFactor(const QWidget *widget = nullptr);
|
static qreal nativeMetricScaleFactor(const QWidget *widget = nullptr);
|
||||||
static bool isDarkMode();
|
static bool isDarkMode();
|
||||||
|
|
||||||
|
@ -1129,7 +1129,7 @@ void QLabel::paintEvent(QPaintEvent *)
|
|||||||
if (d->pixmap && !d->pixmap->isNull()) {
|
if (d->pixmap && !d->pixmap->isNull()) {
|
||||||
QPixmap pix;
|
QPixmap pix;
|
||||||
if (d->scaledcontents) {
|
if (d->scaledcontents) {
|
||||||
QSize scaledSize = cr.size() * devicePixelRatioF();
|
QSize scaledSize = cr.size() * devicePixelRatio();
|
||||||
if (!d->scaledpixmap || d->scaledpixmap->size() != scaledSize) {
|
if (!d->scaledpixmap || d->scaledpixmap->size() != scaledSize) {
|
||||||
if (!d->cachedimage)
|
if (!d->cachedimage)
|
||||||
d->cachedimage = new QImage(d->pixmap->toImage());
|
d->cachedimage = new QImage(d->pixmap->toImage());
|
||||||
@ -1138,7 +1138,7 @@ void QLabel::paintEvent(QPaintEvent *)
|
|||||||
d->cachedimage->scaled(scaledSize,
|
d->cachedimage->scaled(scaledSize,
|
||||||
Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||||
d->scaledpixmap = new QPixmap(QPixmap::fromImage(std::move(scaledImage)));
|
d->scaledpixmap = new QPixmap(QPixmap::fromImage(std::move(scaledImage)));
|
||||||
d->scaledpixmap->setDevicePixelRatio(devicePixelRatioF());
|
d->scaledpixmap->setDevicePixelRatio(devicePixelRatio());
|
||||||
}
|
}
|
||||||
pix = *d->scaledpixmap;
|
pix = *d->scaledpixmap;
|
||||||
} else
|
} else
|
||||||
|
@ -2226,8 +2226,8 @@ void QTabBarPrivate::setupMovableTab()
|
|||||||
else
|
else
|
||||||
grabRect.adjust(-taboverlap, 0, taboverlap, 0);
|
grabRect.adjust(-taboverlap, 0, taboverlap, 0);
|
||||||
|
|
||||||
QPixmap grabImage(grabRect.size() * q->devicePixelRatioF());
|
QPixmap grabImage(grabRect.size() * q->devicePixelRatio());
|
||||||
grabImage.setDevicePixelRatio(q->devicePixelRatioF());
|
grabImage.setDevicePixelRatio(q->devicePixelRatio());
|
||||||
grabImage.fill(Qt::transparent);
|
grabImage.fill(Qt::transparent);
|
||||||
QStylePainter p(&grabImage, q);
|
QStylePainter p(&grabImage, q);
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ void tst_QScreen::grabWindow()
|
|||||||
void resizeEvent(QResizeEvent *e) override
|
void resizeEvent(QResizeEvent *e) override
|
||||||
{
|
{
|
||||||
const QSize sz = e->size();
|
const QSize sz = e->size();
|
||||||
image = image.scaled(sz * image.devicePixelRatioF());
|
image = image.scaled(sz * image.devicePixelRatio());
|
||||||
QPainter painter(&image);
|
QPainter painter(&image);
|
||||||
painter.fillRect(0, 0, sz.width(), sz.height(), Qt::black);
|
painter.fillRect(0, 0, sz.width(), sz.height(), Qt::black);
|
||||||
painter.setPen(QPen(Qt::red, 2));
|
painter.setPen(QPen(Qt::red, 2));
|
||||||
|
@ -2295,7 +2295,7 @@ void PaintCommands::command_pixmap_setDevicePixelRatio(QRegularExpressionMatch r
|
|||||||
|
|
||||||
if (m_verboseMode)
|
if (m_verboseMode)
|
||||||
printf(" -(lance) pixmap_setDevicePixelRatio(%s), %.1f -> %.1f\n",
|
printf(" -(lance) pixmap_setDevicePixelRatio(%s), %.1f -> %.1f\n",
|
||||||
qPrintable(name), m_pixmapMap[name].devicePixelRatioF(), dpr);
|
qPrintable(name), m_pixmapMap[name].devicePixelRatio(), dpr);
|
||||||
|
|
||||||
m_pixmapMap[name].setDevicePixelRatio(dpr);
|
m_pixmapMap[name].setDevicePixelRatio(dpr);
|
||||||
}
|
}
|
||||||
@ -2374,7 +2374,7 @@ void PaintCommands::command_image_setDevicePixelRatio(QRegularExpressionMatch re
|
|||||||
|
|
||||||
if (m_verboseMode)
|
if (m_verboseMode)
|
||||||
printf(" -(lance) image_setDevicePixelRatio(%s), %.1f -> %.1f\n",
|
printf(" -(lance) image_setDevicePixelRatio(%s), %.1f -> %.1f\n",
|
||||||
qPrintable(name), m_imageMap[name].devicePixelRatioF(), dpr);
|
qPrintable(name), m_imageMap[name].devicePixelRatio(), dpr);
|
||||||
|
|
||||||
m_imageMap[name].setDevicePixelRatio(dpr);
|
m_imageMap[name].setDevicePixelRatio(dpr);
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ void tst_QDialog::toolDialogPosition()
|
|||||||
dialog.move(QPoint(100,100));
|
dialog.move(QPoint(100,100));
|
||||||
const QPoint beforeShowPosition = dialog.pos();
|
const QPoint beforeShowPosition = dialog.pos();
|
||||||
dialog.show();
|
dialog.show();
|
||||||
const int fuzz = int(dialog.devicePixelRatioF());
|
const int fuzz = int(dialog.devicePixelRatio());
|
||||||
const QPoint afterShowPosition = dialog.pos();
|
const QPoint afterShowPosition = dialog.pos();
|
||||||
QVERIFY2(HighDpi::fuzzyCompare(afterShowPosition, beforeShowPosition, fuzz),
|
QVERIFY2(HighDpi::fuzzyCompare(afterShowPosition, beforeShowPosition, fuzz),
|
||||||
HighDpi::msgPointMismatch(afterShowPosition, beforeShowPosition).constData());
|
HighDpi::msgPointMismatch(afterShowPosition, beforeShowPosition).constData());
|
||||||
|
@ -400,13 +400,13 @@ void tst_QPixmapFilter::blurIndexed8()
|
|||||||
QImage original = img;
|
QImage original = img;
|
||||||
qt_blurImage(img, 10, true, false);
|
qt_blurImage(img, 10, true, false);
|
||||||
QCOMPARE(original.size(), img.size());
|
QCOMPARE(original.size(), img.size());
|
||||||
QVERIFY2(qFuzzyCompare(img.devicePixelRatioF(), qreal(2)),
|
QVERIFY2(qFuzzyCompare(img.devicePixelRatio(), qreal(2)),
|
||||||
QByteArray::number(img.devicePixelRatioF()).constData());
|
QByteArray::number(img.devicePixelRatio()).constData());
|
||||||
|
|
||||||
original = img;
|
original = img;
|
||||||
qt_blurImage(img, 10, true, true);
|
qt_blurImage(img, 10, true, true);
|
||||||
QVERIFY2(qFuzzyCompare(img.devicePixelRatioF(), qreal(2)),
|
QVERIFY2(qFuzzyCompare(img.devicePixelRatio(), qreal(2)),
|
||||||
QByteArray::number(img.devicePixelRatioF()).constData());
|
QByteArray::number(img.devicePixelRatio()).constData());
|
||||||
QCOMPARE(original.size(), QSize(img.height(), img.width()));
|
QCOMPARE(original.size(), QSize(img.height(), img.width()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3602,7 +3602,7 @@ protected:
|
|||||||
static QPixmap grabFromWidget(QWidget *w, const QRect &rect)
|
static QPixmap grabFromWidget(QWidget *w, const QRect &rect)
|
||||||
{
|
{
|
||||||
QPixmap pixmap = w->grab(rect);
|
QPixmap pixmap = w->grab(rect);
|
||||||
const qreal devicePixelRatio = pixmap.devicePixelRatioF();
|
const qreal devicePixelRatio = pixmap.devicePixelRatio();
|
||||||
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {
|
||||||
pixmap = pixmap.scaled((QSizeF(pixmap.size()) / devicePixelRatio).toSize(),
|
pixmap = pixmap.scaled((QSizeF(pixmap.size()) / devicePixelRatio).toSize(),
|
||||||
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
@ -5638,7 +5638,7 @@ bool verifyColor(QWidget &child, const QRegion ®ion, const QColor &color, int
|
|||||||
const QPixmap pixmap = grabBackingStore
|
const QPixmap pixmap = grabBackingStore
|
||||||
? child.grab(rect)
|
? child.grab(rect)
|
||||||
: grabWindow(window, rect.left(), rect.top(), rect.width(), rect.height());
|
: grabWindow(window, rect.left(), rect.top(), rect.width(), rect.height());
|
||||||
const QSize actualSize = pixmap.size() / pixmap.devicePixelRatioF();
|
const QSize actualSize = pixmap.size() / pixmap.devicePixelRatio();
|
||||||
if (!QTest::qCompare(actualSize, rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine))
|
if (!QTest::qCompare(actualSize, rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine))
|
||||||
return false;
|
return false;
|
||||||
QPixmap expectedPixmap(pixmap); /* ensure equal formats */
|
QPixmap expectedPixmap(pixmap); /* ensure equal formats */
|
||||||
@ -9270,8 +9270,8 @@ void tst_QWidget::translucentWidget()
|
|||||||
widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));
|
widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));
|
||||||
#endif
|
#endif
|
||||||
const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
|
const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
|
||||||
QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size());
|
QImage expected = pm.toImage().scaled(label.devicePixelRatio() * pm.size());
|
||||||
expected.setDevicePixelRatio(label.devicePixelRatioF());
|
expected.setDevicePixelRatio(label.devicePixelRatio());
|
||||||
QCOMPARE(actual.size(),expected.size());
|
QCOMPARE(actual.size(),expected.size());
|
||||||
QCOMPARE(actual,expected);
|
QCOMPARE(actual,expected);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w,
|
|||||||
if (w->isWindow()) {
|
if (w->isWindow()) {
|
||||||
str << ' ' << w->logicalDpiX() << "DPI";
|
str << ' ' << w->logicalDpiX() << "DPI";
|
||||||
#if QT_VERSION > 0x050600
|
#if QT_VERSION > 0x050600
|
||||||
const qreal dpr = w->devicePixelRatioF();
|
const qreal dpr = w->devicePixelRatio();
|
||||||
if (!qFuzzyCompare(dpr, qreal(1)))
|
if (!qFuzzyCompare(dpr, qreal(1)))
|
||||||
str << " dpr=" << dpr;
|
str << " dpr=" << dpr;
|
||||||
#endif // Qt 5.6
|
#endif // Qt 5.6
|
||||||
|
@ -162,8 +162,8 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
|
|||||||
mimeData->setData("application/x-hotspot",
|
mimeData->setData("application/x-hotspot",
|
||||||
QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
|
QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
|
||||||
|
|
||||||
const qreal dpr = devicePixelRatioF() > 1 && !(QGuiApplication::keyboardModifiers() & Qt::ShiftModifier)
|
const qreal dpr = devicePixelRatio() > 1 && !(QGuiApplication::keyboardModifiers() & Qt::ShiftModifier)
|
||||||
? devicePixelRatioF() : 1;
|
? devicePixelRatio() : 1;
|
||||||
|
|
||||||
QPixmap pixmap(child->size() * dpr);
|
QPixmap pixmap(child->size() * dpr);
|
||||||
pixmap.setDevicePixelRatio(dpr);
|
pixmap.setDevicePixelRatio(dpr);
|
||||||
|
@ -1293,7 +1293,7 @@ QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly)";
|
|||||||
<< "\n\n";
|
<< "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
str << "widget devicePixelRatio: " << this->devicePixelRatioF()
|
str << "widget devicePixelRatio: " << this->devicePixelRatio()
|
||||||
<< "\nwidget logicalDpi: " << this->logicalDpiX()
|
<< "\nwidget logicalDpi: " << this->logicalDpiX()
|
||||||
<< "\n\nQT_FONT_DPI: " << qgetenv("QT_FONT_DPI")
|
<< "\n\nQT_FONT_DPI: " << qgetenv("QT_FONT_DPI")
|
||||||
<< "\nQT_SCALE_FACTOR: " << qgetenv("QT_SCALE_FACTOR")
|
<< "\nQT_SCALE_FACTOR: " << qgetenv("QT_SCALE_FACTOR")
|
||||||
|
@ -286,7 +286,7 @@ void MainWindow::updateDescription()
|
|||||||
QString text;
|
QString text;
|
||||||
QTextStream str(&text);
|
QTextStream str(&text);
|
||||||
str << "Qt " << QT_VERSION_STR << ", platform: " << QGuiApplication::platformName()
|
str << "Qt " << QT_VERSION_STR << ", platform: " << QGuiApplication::platformName()
|
||||||
<< ", Style: \"" << style()->objectName() << "\", DPR=" << devicePixelRatioF()
|
<< ", Style: \"" << style()->objectName() << "\", DPR=" << devicePixelRatio()
|
||||||
<< ' ' << logicalDpiX() << ',' << logicalDpiY() << "DPI";
|
<< ' ' << logicalDpiX() << ',' << logicalDpiY() << "DPI";
|
||||||
if (const QWindow *w = windowHandle())
|
if (const QWindow *w = windowHandle())
|
||||||
str << ", Screen: \"" << w->screen()->name() << '"';
|
str << ", Screen: \"" << w->screen()->name() << '"';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user