From 8d15fffc4d57c55949f799e52f2f52d3b0b66321 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 21 Jul 2010 13:44:25 +0200 Subject: Ensure that font sizes that are > 0 and < 1 are still respected What was happening was that when a font size of 0.5 was used then it would end up being set to be point size 0. This now respects the setting used. Autotest is included in this patch for this case. Reviewed-by: Kim --- src/svg/qsvgstyle_p.h | 2 +- tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h index af3b4e5..dfea12c 100644 --- a/src/svg/qsvgstyle_p.h +++ b/src/svg/qsvgstyle_p.h @@ -338,7 +338,7 @@ public: { // Store the _pixel_ size in the font. Since QFont::setPixelSize() only takes an int, call // QFont::SetPointSize() instead. Set proper font size just before rendering. - m_qfont.setPointSize(size); + m_qfont.setPointSizeF(size); m_sizeSet = 1; } diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp index 106fd8c..519f4f5 100644 --- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp +++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp @@ -85,6 +85,7 @@ private slots: void testFillInheritance(); void testStopOffsetOpacity(); void testUseElement(); + void smallFont(); #ifndef QT_NO_COMPRESS void testGzLoading(); @@ -1342,5 +1343,30 @@ void tst_QSvgRenderer::testUseElement() } } +void tst_QSvgRenderer::smallFont() +{ + static const char *svgs[] = { "Hello world", + "Hello world" + }; + const int COUNT = sizeof(svgs) / sizeof(svgs[0]); + QImage images[COUNT]; + QPainter p; + + for (int i = 0; i < COUNT; ++i) { + QByteArray data(svgs[i]); + if (i == 0) { + QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0"); + QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSize: Point size <= 0 (0), must be greater than 0"); + } + QSvgRenderer renderer(data); + images[i] = QImage(50, 50, QImage::Format_ARGB32_Premultiplied); + images[i].fill(-1); + p.begin(&images[i]); + renderer.render(&p); + p.end(); + } + QVERIFY(images[0] != images[1]); +} + QTEST_MAIN(tst_QSvgRenderer) #include "tst_qsvgrenderer.moc" -- cgit v0.12 From 55c818b8f3fdb50087d1f5553662cd4db302f495 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 21 Jul 2010 15:18:20 +0200 Subject: Fix a typo in harfbuzz thai line breaking. Reviewed-by: Lars Knoll --- src/3rdparty/harfbuzz/src/harfbuzz-thai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c index e153ba9..e80e2c5 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c @@ -91,7 +91,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri for (i = 0; i < numbreaks; ++i) { if (break_positions[i] > 0) { attributes[break_positions[i]-1].lineBreakType = HB_Break; - attributes[i].wordBoundary = TRUE; + attributes[break_positions[i]-1].wordBoundary = TRUE; } } -- cgit v0.12 From d8fbc4e0264f8bfabc12bc49ed7724eb2c96c93e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 21 Jul 2010 15:52:40 +0200 Subject: make "configure -qt-gif" work again on Windows The value for GIF must be "plugin" and not "yes". Reviewed-by: danimo --- tools/configure/configureapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c3498e3..f7dac93 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -581,8 +581,8 @@ void Configure::parseCmdLine() // Image formats -------------------------------------------- else if (configCmdLine.at(i) == "-no-gif") dictionary[ "GIF" ] = "no"; - else if (configCmdLine.at(i) == "-qt-gif") - dictionary[ "GIF" ] = "yes"; + else if (configCmdLine.at(i) == "-qt-gif") + dictionary[ "GIF" ] = "plugin"; else if (configCmdLine.at(i) == "-no-libtiff") { dictionary[ "TIFF"] = "no"; -- cgit v0.12 From 9c2b396b2b1fefc10b0ff24c9e33b41278c84ca8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 21 Jul 2010 15:56:21 +0200 Subject: rebuild configure.exe --- configure.exe | Bin 1317888 -> 1317888 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index eea40f9..6dfd14e48 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From f1d7cbd9efbdade9df5496dc684c2f7d22db7378 Mon Sep 17 00:00:00 2001 From: Romain Pokrzywka Date: Wed, 21 Jul 2010 16:34:21 +0200 Subject: fix the export macros for the QtDBus module Merge-request: 2439 Reviewed-by: Harald Fernengel --- src/corelib/global/qglobal.h | 8 ++++++ src/dbus/dbus.pro | 2 +- src/dbus/qdbusabstractadaptor.h | 2 +- src/dbus/qdbusabstractinterface.h | 4 +-- src/dbus/qdbusargument.h | 48 +++++++++++++++---------------- src/dbus/qdbusconnection.cpp | 2 +- src/dbus/qdbusconnection.h | 2 +- src/dbus/qdbusconnectioninterface.h | 2 +- src/dbus/qdbuscontext.h | 2 +- src/dbus/qdbuserror.h | 4 +-- src/dbus/qdbusextratypes.h | 4 +-- src/dbus/qdbusintegrator.cpp | 2 +- src/dbus/qdbusinterface.h | 2 +- src/dbus/qdbusintrospection_p.h | 2 +- src/dbus/qdbusmacros.h | 8 ------ src/dbus/qdbusmessage.h | 4 +-- src/dbus/qdbusmetaobject_p.h | 2 +- src/dbus/qdbusmetatype.h | 2 +- src/dbus/qdbuspendingcall.h | 4 +-- src/dbus/qdbuspendingreply.h | 2 +- src/dbus/qdbusreply.h | 2 +- src/dbus/qdbusserver.h | 2 +- src/dbus/qdbusservicewatcher.h | 2 +- src/dbus/qdbusthreaddebug_p.h | 4 +-- src/dbus/qdbusutil_p.h | 20 ++++++------- src/dbus/qdbusxmlgenerator.cpp | 2 +- tools/qdbus/qdbuscpp2xml/qdbuscpp2xml.cpp | 2 +- 27 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 8a3166d..7b915cd 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1277,6 +1277,11 @@ class QDataStream; # else # define Q_COMPAT_EXPORT Q_DECL_IMPORT # endif +# if defined(QT_BUILD_DBUS_LIB) +# define Q_DBUS_EXPORT Q_DECL_EXPORT +# else +# define Q_DBUS_EXPORT Q_DECL_IMPORT +# endif # define Q_TEMPLATEDLL # elif defined(QT_DLL) /* use a Qt DLL library */ # define Q_CORE_EXPORT Q_DECL_IMPORT @@ -1294,6 +1299,7 @@ class QDataStream; # define Q_SCRIPT_EXPORT Q_DECL_IMPORT # define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT # define Q_COMPAT_EXPORT Q_DECL_IMPORT +# define Q_DBUS_EXPORT Q_DECL_IMPORT # define Q_TEMPLATEDLL # endif # define Q_NO_DECLARED_NOT_DEFINED @@ -1322,6 +1328,7 @@ class QDataStream; # define Q_SCRIPT_EXPORT Q_DECL_EXPORT # define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT # define Q_COMPAT_EXPORT Q_DECL_EXPORT +# define Q_DBUS_EXPORT Q_DECL_EXPORT # else # define Q_CORE_EXPORT # define Q_GUI_EXPORT @@ -1336,6 +1343,7 @@ class QDataStream; # define Q_SCRIPT_EXPORT # define Q_SCRIPTTOOLS_EXPORT # define Q_COMPAT_EXPORT +# define Q_DBUS_EXPORT # endif #endif diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 7c59808..46a723a 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -3,7 +3,7 @@ QPRO_PWD = $$PWD QT = core \ xml CONFIG += link_pkgconfig -DEFINES += QDBUS_MAKEDLL \ +DEFINES += QT_BUILD_DBUS_LIB \ DBUS_API_SUBJECT_TO_CHANGE QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS contains(QT_CONFIG, dbus-linked) { diff --git a/src/dbus/qdbusabstractadaptor.h b/src/dbus/qdbusabstractadaptor.h index fa64aef..af5a3ce 100644 --- a/src/dbus/qdbusabstractadaptor.h +++ b/src/dbus/qdbusabstractadaptor.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(DBus) class QDBusAbstractAdaptorPrivate; -class QDBUS_EXPORT QDBusAbstractAdaptor: public QObject +class Q_DBUS_EXPORT QDBusAbstractAdaptor: public QObject { Q_OBJECT protected: diff --git a/src/dbus/qdbusabstractinterface.h b/src/dbus/qdbusabstractinterface.h index 44f79a1..177af67 100644 --- a/src/dbus/qdbusabstractinterface.h +++ b/src/dbus/qdbusabstractinterface.h @@ -64,7 +64,7 @@ class QDBusPendingCall; class QDBusAbstractInterfacePrivate; -class QDBUS_EXPORT QDBusAbstractInterfaceBase: public QObject +class Q_DBUS_EXPORT QDBusAbstractInterfaceBase: public QObject { public: int qt_metacall(QMetaObject::Call, int, void**); @@ -74,7 +74,7 @@ private: Q_DECLARE_PRIVATE(QDBusAbstractInterface) }; -class QDBUS_EXPORT QDBusAbstractInterface: +class Q_DBUS_EXPORT QDBusAbstractInterface: #ifdef Q_QDOC public QObject #else diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index 73558b6..30f2cda 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -64,7 +64,7 @@ QT_MODULE(DBus) class QDBusArgumentPrivate; class QDBusDemarshaller; class QDBusMarshaller; -class QDBUS_EXPORT QDBusArgument +class Q_DBUS_EXPORT QDBusArgument { public: enum ElementType { @@ -184,43 +184,43 @@ template<> inline QVariant qdbus_cast(const QVariant &v, QVariant *) return qdbus_cast(v).variant(); } -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v); // QVariant types #ifndef QDBUS_NO_SPECIALTYPES -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line); -QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line); -QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line); +Q_DBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line); +Q_DBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line); #endif template