summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJani Heikkinen <jani.heikkinen@digia.com>2014-02-17 20:43:28 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-17 20:43:28 +0100
commit072f9cf8887043a9c69365abc98d72b5f5beb6b8 (patch)
treea916c039ddcb4169087ce2030f63318c7ba15115 /src/widgets
parent2e20d82de4ee26e862a541e3a7cf85ea54942a66 (diff)
parentdbafabb019eac6ab21b43279b3a348e4afbd065e (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/styles/qgtkstyle.cpp4
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index b981aef98b..105aefb14c 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -2499,7 +2499,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
if ((option->subControls & SC_SliderGroove) && groove.isValid()) {
GtkRange *range = (GtkRange*)scaleWidget;
- GtkAdjustment *adjustment = d->gtk_range_get_adjustment(range);
+ GtkAdjustment *adjustment = 0;
+ if (d->gtk_adjustment_configure)
+ adjustment = d->gtk_range_get_adjustment(range);
if (adjustment) {
d->gtk_adjustment_configure(adjustment,
slider->sliderPosition,
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index d180122ab2..d8530bca1e 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1717,8 +1717,9 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
}
- int width = int(macRect.size.width) + extraWidth;
- int height = int(macRect.size.height) + extraHeight;
+ int devicePixelRatio = p->device()->devicePixelRatio();
+ int width = devicePixelRatio * (int(macRect.size.width) + extraWidth);
+ int height = devicePixelRatio * (int(macRect.size.height) + extraHeight);
if (width <= 0 || height <= 0)
return; // nothing to draw
@@ -1730,6 +1731,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
QPixmap pm;
if (!QPixmapCache::find(key, pm)) {
QPixmap activePixmap(width, height);
+ activePixmap.setDevicePixelRatio(devicePixelRatio);
activePixmap.fill(Qt::transparent);
{
if (combo){
@@ -1780,6 +1782,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
QImage colorlessImage;
{
QPixmap colorlessPixmap(width, height);
+ colorlessPixmap.setDevicePixelRatio(devicePixelRatio);
colorlessPixmap.fill(Qt::transparent);
QMacCGContext cg(&colorlessPixmap);
@@ -1813,7 +1816,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
}
QPixmapCache::insert(key, pm);
}
- p->drawPixmap(int(macRect.origin.x) - xoff, int(macRect.origin.y) + finalyoff, width, height, pm);
+ p->drawPixmap(int(macRect.origin.x) - xoff, int(macRect.origin.y) + finalyoff, width / devicePixelRatio, height / devicePixelRatio , pm);
}
QMacStyle::QMacStyle()
@@ -6715,6 +6718,8 @@ CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
}
CGContextTranslateCTM(ret, 0, pm->height());
+ int devicePixelRatio = pdev->devicePixelRatio();
+ CGContextScaleCTM(ret, devicePixelRatio, devicePixelRatio);
CGContextScaleCTM(ret, 1, -1);
return ret;
} else if (pdev->devType() == QInternal::Widget) {