summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorPulse Build System <qt-info@nokia.com>2010-01-22 12:03:07 (GMT)
committerPulse Build System <qt-info@nokia.com>2010-01-22 12:03:07 (GMT)
commitd9532fb7185951ad34e2b11f008cc3ad0a62d5a4 (patch)
tree8f8a9e8facbb95ff299d2f28cc649757a14e10d8 /src/gui
parent178f722835ec0995fe211046579c50893659cc8e (diff)
parent1a13a3c48ddbe3998edda778df53f4b1e838536f (diff)
downloadQt-d9532fb7185951ad34e2b11f008cc3ad0a62d5a4.zip
Qt-d9532fb7185951ad34e2b11f008cc3ad0a62d5a4.tar.gz
Qt-d9532fb7185951ad34e2b11f008cc3ad0a62d5a4.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixed compile for wincewm60standard-msvc2008 (attempt 2) Fixed compile for wincewm60standard-msvc2008. Fixed compile. Fixed compile for wincewm60standard-msvc2008. Fixed compile when Qt is configured with -no-webkit build fix for mingw Build fix for MSVC2005 and older SDK QStyleSheetStyle: Fixed some text croped when having padding with native border. Remove obsolete code for unsupported platforms Character spacing when drawing a QPicture to a high DPI device.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp1
-rw-r--r--src/gui/image/qpicture.cpp49
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp2
3 files changed, 11 insertions, 41 deletions
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index f8c3b84..bc399d4 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -59,6 +59,7 @@
#endif
#ifdef Q_WS_WINCE
+#include <shlobj.h>
#include <commdlg.h>
bool qt_priv_ptr_valid = false;
#else
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index fb70e36..3220a67 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -440,36 +440,6 @@ bool QPicture::play(QPainter *painter)
return true; // no end-command
}
-
-//
-// QFakeDevice is used to create fonts with a custom DPI
-//
-class QFakeDevice : public QPaintDevice
-{
-public:
- QFakeDevice() { dpi_x = qt_defaultDpiX(); dpi_y = qt_defaultDpiY(); }
- void setDpiX(int dpi) { dpi_x = dpi; }
- void setDpiY(int dpi) { dpi_y = dpi; }
- QPaintEngine *paintEngine() const { return 0; }
- int metric(PaintDeviceMetric m) const
- {
- switch(m) {
- case PdmPhysicalDpiX:
- case PdmDpiX:
- return dpi_x;
- case PdmPhysicalDpiY:
- case PdmDpiY:
- return dpi_y;
- default:
- return QPaintDevice::metric(m);
- }
- }
-
-private:
- int dpi_x;
- int dpi_y;
-};
-
/*!
\internal
Iterates over the internal picture data and draws the picture using
@@ -679,30 +649,29 @@ bool QPicture::exec(QPainter *painter, QDataStream &s, int nrecords)
if (d->formatMajor >= 9) {
s >> dbl;
- QFont fnt(font);
- if (dbl != 1.0) {
- QFakeDevice fake;
- fake.setDpiX(qRound(dbl*qt_defaultDpiX()));
- fake.setDpiY(qRound(dbl*qt_defaultDpiY()));
- fnt = QFont(font, &fake);
- }
+ QFont fnt(font, painter->device());
+
+ qreal scale = painter->device()->logicalDpiY() / (dbl*qt_defaultDpiY());
+ painter->save();
+ painter->scale(1/scale, 1/scale);
qreal justificationWidth;
s >> justificationWidth;
int flags = Qt::TextSingleLine | Qt::TextDontClip | Qt::TextForceLeftToRight;
- QSizeF size(1, 1);
+ QSizeF size(scale, scale);
if (justificationWidth > 0) {
- size.setWidth(justificationWidth);
+ size.setWidth(justificationWidth*scale);
flags |= Qt::TextJustificationForced;
flags |= Qt::AlignJustify;
}
QFontMetrics fm(fnt);
- QPointF pt(p.x(), p.y() - fm.ascent());
+ QPointF pt(p.x()*scale, p.y()*scale - fm.ascent());
qt_format_text(fnt, QRectF(pt, size), flags, /*opt*/0,
str, /*brect=*/0, /*tabstops=*/0, /*...*/0, /*tabarraylen=*/0, painter);
+ painter->restore();
} else {
qt_format_text(font, QRectF(p, QSizeF(1, 1)), Qt::TextSingleLine | Qt::TextDontClip, /*opt*/0,
str, /*brect=*/0, /*tabstops=*/0, /*...*/0, /*tabarraylen=*/0, painter);
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index dab93a2..9002172 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1065,7 +1065,7 @@ QRect QRenderRule::boxRect(const QRect& cr, int flags) const
r.adjust(-p[LeftEdge], -p[TopEdge], p[RightEdge], p[BottomEdge]);
}
}
- if (!hasNativeBorder() && (flags & Border)) {
+ if (hasBorder() && (flags & Border)) {
const int *b = border()->borders;
r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]);
}