From 72fc24222ab7f89dc9e606e315ebfb134ba157a8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 15 Sep 2009 15:22:10 +0200 Subject: Fix drawing text in QPicture and printing in right-to-left mode Change 979d1d3bbc0c68789edbe93f03464d41d7a8469a requires qt_format_text() to honor the Qt::TextForceLeftToRight flag. Without this, the text will be laid out RTL twice, and the output will be broken. Since printing is done through QPicture, this fixes printing when the UI is reversed. Task-number: 261033 Reviewed-by: Trond --- src/gui/painting/qpainter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 358e856..97f3dd4 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7469,7 +7469,11 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, bool hidemnmemonic = (tf & Qt::TextHideMnemonic); Qt::LayoutDirection layout_direction; - if(option) + if (tf & Qt::TextForceLeftToRight) + layout_direction = Qt::LeftToRight; + else if (tf & Qt::TextForceRightToLeft) + layout_direction = Qt::RightToLeft; + else if (option) layout_direction = option->textDirection(); else if (painter) layout_direction = painter->layoutDirection(); -- cgit v0.12 From e7042dea2431b8f64574d4e97eb896285b328c8b Mon Sep 17 00:00:00 2001 From: andyc Date: Fri, 3 Jul 2009 17:25:25 -0400 Subject: Added autotest to demonstrate clipping path problem --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index d6605db..391ccf8 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -194,6 +194,7 @@ private slots: void itemClipsToShape(); void itemClipsChildrenToShape(); void itemClipsChildrenToShape2(); + void itemClipsChildrenToShape3(); void itemClipsTextChildToShape(); void itemClippingDiscovery(); void ancestorFlags(); @@ -4691,6 +4692,37 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2() #endif } +void tst_QGraphicsItem::itemClipsChildrenToShape3() +{ + // Construct a scene with nested children, each 50 pixels offset from the elder. + // Set a top-level clipping flag + QGraphicsScene scene; + QGraphicsRectItem *parent = scene.addRect( 0, 0, 150, 150 ); + QGraphicsRectItem *child = scene.addRect( 0, 0, 150, 150 ); + QGraphicsRectItem *grandchild = scene.addRect( 0, 0, 150, 150 ); + child->setParentItem(parent); + grandchild->setParentItem(child); + child->setPos( 50, 50 ); + grandchild->setPos( 50, 50 ); + parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape); + + QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)parent); + QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)child); + QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild); + QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0); + + // Move child to fully overlap the parent. The grandchild should + // now occupy two-thirds of the scene + child->prepareGeometryChange(); + child->setPos( 0, 0 ); + + QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)child); + QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)grandchild); + QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild); + QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0); +} + + void tst_QGraphicsItem::itemClipsTextChildToShape() { // Construct a scene with a rect that clips its children, with one text -- cgit v0.12 From 6a0ccd3477b0ddb0a550b56bdc41e8ae1cf740a6 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Wed, 16 Sep 2009 16:55:29 +1000 Subject: Fixes: Fixed incorrect tracks number calculation with phonon/gst RevBy: Andrew den Exter Details: gst_element_query_duration(element,format,duration) doesn't always return duration in format being asked for (tracks in this case), it can also return duration in format it can (Time) and modify format parameter, so check the format is still the same as requested is necessary. This bug prevented Phonon to emit finished() signal with some files, since it expected next tracks to exist. --- src/3rdparty/phonon/gstreamer/mediaobject.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 74fc1b4..13f9734 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -965,11 +965,15 @@ void MediaObject::getStreamInfo() gint64 titleCount; GstFormat format = gst_format_get_by_nick("track"); if (gst_element_query_duration (m_pipeline, &format, &titleCount)) { - int oldAvailableTitles = m_availableTitles; - m_availableTitles = (int)titleCount; - if (m_availableTitles != oldAvailableTitles) { - emit availableTitlesChanged(m_availableTitles); - m_backend->logMessage(QString("Available titles changed: %0").arg(m_availableTitles), Backend::Info, this); + //check if returned format is still "track", + //gstreamer sometimes returns the total time, if tracks information is not available. + if (qstrcmp(gst_format_get_name(format), "track") == 0) { + int oldAvailableTitles = m_availableTitles; + m_availableTitles = (int)titleCount; + if (m_availableTitles != oldAvailableTitles) { + emit availableTitlesChanged(m_availableTitles); + m_backend->logMessage(QString("Available titles changed: %0").arg(m_availableTitles), Backend::Info, this); + } } } -- cgit v0.12 From d851010a10c9a75fd8fb165bc239d5d3b805c0b8 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Wed, 16 Sep 2009 13:08:51 +0200 Subject: Fixed QImageReader autotests. Reviewed-by: Kim --- tests/auto/qimagereader/tst_qimagereader.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index 8d5cd34..fdc9c86 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -642,7 +642,7 @@ void tst_QImageReader::imageFormatBeforeRead() void tst_QImageReader::gifHandlerBugs() { { - QImageReader io("images/trolltech.gif"); + QImageReader io(":images/trolltech.gif"); QVERIFY(io.loopCount() != 1); int count=0; for (; io.canRead(); io.read(), ++count) ; @@ -651,8 +651,8 @@ void tst_QImageReader::gifHandlerBugs() // Task 95166 { - QImageReader io1("images/bat1.gif"); - QImageReader io2("images/bat2.gif"); + QImageReader io1(":images/bat1.gif"); + QImageReader io2(":images/bat2.gif"); QVERIFY(io1.canRead()); QVERIFY(io2.canRead()); QImage im1 = io1.read(); @@ -664,8 +664,8 @@ void tst_QImageReader::gifHandlerBugs() // Task 9994 { - QImageReader io1("images/noclearcode.gif"); - QImageReader io2("images/noclearcode.bmp"); + QImageReader io1(":images/noclearcode.gif"); + QImageReader io2(":images/noclearcode.bmp"); QVERIFY(io1.canRead()); QVERIFY(io2.canRead()); QImage im1 = io1.read(); QImage im2 = io2.read(); QVERIFY(!im1.isNull()); QVERIFY(!im2.isNull()); @@ -675,13 +675,14 @@ void tst_QImageReader::gifHandlerBugs() void tst_QImageReader::animatedGif() { - QImageReader io(prefix + "qt.gif"); - QImage image= io.read(); - int i=0; + QImageReader io(":images/qt.gif"); + QImage image = io.read(); + QVERIFY(!image.isNull()); + int i = 0; while(!image.isNull()){ - QString frameName = QString(prefix + "qt%1.gif").arg(++i); + QString frameName = QString(":images/qt%1.gif").arg(++i); QCOMPARE(image, QImage(frameName)); - image=io.read(); + image = io.read(); } } #endif -- cgit v0.12 From 706028b5684de47addcf580599df5fad1b0cd6a3 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Wed, 16 Sep 2009 13:22:25 +0200 Subject: Fixed the QThread tests for Windows. Backported d04d67e146bce3d407f992c283d7ab3d0c25d428 and 08b54f274d57e4735d0042e295237f176506433d from 4.6. --- tests/auto/qthread/tst_qthread.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/auto/qthread/tst_qthread.cpp b/tests/auto/qthread/tst_qthread.cpp index 34b74d8..587622e 100644 --- a/tests/auto/qthread/tst_qthread.cpp +++ b/tests/auto/qthread/tst_qthread.cpp @@ -629,6 +629,12 @@ void noop(void*) { } typedef HANDLE ThreadHandle; #endif +#ifdef Q_OS_WIN +#define WIN_FIX_STDCALL __stdcall +#else +#define WIN_FIX_STDCALL +#endif + class NativeThreadWrapper { public: @@ -639,7 +645,7 @@ public: void setWaitForStop() { waitForStop = true; } void stop(); - ThreadHandle nativeThread; + ThreadHandle nativeThreadHandle; QThread *qthread; QWaitCondition startCondition; QMutex mutex; @@ -647,7 +653,7 @@ public: QWaitCondition stopCondition; protected: static void *runUnix(void *data); - static void runWin(void *data); + static unsigned WIN_FIX_STDCALL runWin(void *data); FunctionPointer functionPointer; void *data; @@ -658,12 +664,13 @@ void NativeThreadWrapper::start(FunctionPointer functionPointer, void *data) this->functionPointer = functionPointer; this->data = data; #ifdef Q_OS_UNIX - const int state = pthread_create(&nativeThread, 0, NativeThreadWrapper::runUnix, this); + const int state = pthread_create(&nativeThreadHandle, 0, NativeThreadWrapper::runUnix, this); Q_UNUSED(state); #elif defined(Q_OS_WINCE) - nativeThread = CreateThread(NULL, 0 , (LPTHREAD_START_ROUTINE)NativeThreadWrapper::runWin , this, 0, NULL); + nativeThreadHandle = CreateThread(NULL, 0 , (LPTHREAD_START_ROUTINE)NativeThreadWrapper::runWin , this, 0, NULL); #elif defined Q_OS_WIN - nativeThread = (HANDLE)_beginthread(NativeThreadWrapper::runWin, 0, this); + unsigned thrdid = 0; + nativeThreadHandle = (Qt::HANDLE) _beginthreadex(NULL, 0, NativeThreadWrapper::runWin, this, 0, &thrdid); #endif } @@ -677,9 +684,10 @@ void NativeThreadWrapper::startAndWait(FunctionPointer functionPointer, void *da void NativeThreadWrapper::join() { #ifdef Q_OS_UNIX - pthread_join(nativeThread, 0); + pthread_join(nativeThreadHandle, 0); #elif defined Q_OS_WIN - WaitForSingleObject(nativeThread, INFINITE); + WaitForSingleObject(nativeThreadHandle, INFINITE); + CloseHandle(nativeThreadHandle); #endif } @@ -687,7 +695,7 @@ void *NativeThreadWrapper::runUnix(void *that) { NativeThreadWrapper *nativeThreadWrapper = reinterpret_cast(that); - // Adoppt thread, create QThread object. + // Adopt thread, create QThread object. nativeThreadWrapper->qthread = QThread::currentThread(); // Release main thread. @@ -709,9 +717,10 @@ void *NativeThreadWrapper::runUnix(void *that) return 0; } -void NativeThreadWrapper::runWin(void *data) +unsigned WIN_FIX_STDCALL NativeThreadWrapper::runWin(void *data) { runUnix(data); + return 0; } void NativeThreadWrapper::stop() -- cgit v0.12 From 93df7f3b8e0e29ee7ed75a5f54222f26387cc793 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Wed, 16 Sep 2009 13:39:06 +0200 Subject: Disabled the qtwidgets test for the times being. Reviewed-by: Jesper --- tests/auto/qtwidgets/tst_qtwidgets.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qtwidgets/tst_qtwidgets.cpp b/tests/auto/qtwidgets/tst_qtwidgets.cpp index f5f638e..237c3f3 100644 --- a/tests/auto/qtwidgets/tst_qtwidgets.cpp +++ b/tests/auto/qtwidgets/tst_qtwidgets.cpp @@ -59,6 +59,8 @@ private slots: void tst_QtWidgets::snapshot() { + QSKIP("This test doesn't do anything useful at the moment.", SkipAll); + StyleWidget widget(0, Qt::X11BypassWindowManagerHint); widget.show(); -- cgit v0.12 From 59dbb1b7e737713fc650c25a20967ec26cc3ff3d Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 16 Sep 2009 16:00:19 +0200 Subject: Fixed the qkeysequence::translated autotest. The test failed because it tried to open a .qm file which didn't exist in Qt's translations directory. Fixed by running lrelease on the .ts file and copying the resulting .qm into the test directory. Reviewed-by: Trond --- tests/auto/qkeysequence/qkeysequence.pro | 4 +--- tests/auto/qkeysequence/qkeysequence.qrc | 6 ++++++ tests/auto/qkeysequence/qt_de.qm | Bin 0 -> 186240 bytes tests/auto/qkeysequence/tst_qkeysequence.cpp | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 tests/auto/qkeysequence/qkeysequence.qrc create mode 100644 tests/auto/qkeysequence/qt_de.qm diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro index 6566340..bd85402 100644 --- a/tests/auto/qkeysequence/qkeysequence.pro +++ b/tests/auto/qkeysequence/qkeysequence.pro @@ -1,6 +1,4 @@ load(qttest_p4) SOURCES += tst_qkeysequence.cpp -TRANSLATIONS += keys_de.ts - - +RESOURCES += qkeysequence.qrc \ No newline at end of file diff --git a/tests/auto/qkeysequence/qkeysequence.qrc b/tests/auto/qkeysequence/qkeysequence.qrc new file mode 100644 index 0000000..e224faa --- /dev/null +++ b/tests/auto/qkeysequence/qkeysequence.qrc @@ -0,0 +1,6 @@ + + + keys_de.qm + qt_de.qm + + diff --git a/tests/auto/qkeysequence/qt_de.qm b/tests/auto/qkeysequence/qt_de.qm new file mode 100644 index 0000000..595e4d7 Binary files /dev/null and b/tests/auto/qkeysequence/qt_de.qm differ diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index 9da0671..868f843 100644 --- a/tests/auto/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp @@ -166,9 +166,9 @@ tst_QKeySequence::~tst_QKeySequence() void tst_QKeySequence::initTestCase() { ourTranslator = new QTranslator(this); - ourTranslator->load(QLatin1String("keys_de"), "."); + ourTranslator->load(":/keys_de"); qtTranslator = new QTranslator(this); - qtTranslator->load(QLatin1String("qt_de"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + qtTranslator->load(":/qt_de"); } void tst_QKeySequence::operatorQString_data() -- cgit v0.12 From 18c0fec3afba909faa341c766f31d679892021db Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 17 Sep 2009 13:15:40 +1000 Subject: Fixes issue of forward only datasets failing when not set so. Previously you had to set forward only on non-scrollable datasets explicitly. This queries ODBC, to determine if it's a scrollable dataset, and sets forwardOnly to false if it isn't. Task-number: QT-353 Reviewed-by: Justin McPherson --- src/sql/drivers/odbc/qsql_odbc.cpp | 10 +++++++++ tests/auto/qsqlquery/tst_qsqlquery.cpp | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index a5c713d..6a33d1e 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -781,6 +781,11 @@ bool QODBCResult::reset (const QString& query) return false; } + SQLINTEGER isScrollable, bufferLength; + r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength); + if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) + setForwardOnly(isScrollable==SQL_NONSCROLLABLE); + SQLSMALLINT count; SQLNumResultCols(d->hStmt, &count); if (count) { @@ -1407,6 +1412,11 @@ bool QODBCResult::exec() return false; } + SQLINTEGER isScrollable, bufferLength; + r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength); + if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) + setForwardOnly(isScrollable==SQL_NONSCROLLABLE); + SQLSMALLINT count; SQLNumResultCols(d->hStmt, &count); if (count) { diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 1595f33..3463153 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -191,6 +191,9 @@ private slots: void task_233829_data() { generic_data("QPSQL"); } void task_233829(); + void sqlServerReturn0_data() { generic_data(); } + void sqlServerReturn0(); + private: // returns all database connections @@ -310,6 +313,13 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) tablenames << qTableName( "task_250026" ); + if (tst_Databases::isSqlServer( db )) { + QSqlQuery q( db ); + q.exec("DROP PROCEDURE " + qTableName("test141895_proc")); + } + + tablenames << qTableName("test141895"); + tst_Databases::safeDropTables( db, tablenames ); } @@ -2842,5 +2852,33 @@ void tst_QSqlQuery::task_233829() QVERIFY_SQL(q,exec()); } +void tst_QSqlQuery::sqlServerReturn0() +{ + QFETCH( QString, dbName ); + QSqlDatabase db = QSqlDatabase::database( dbName ); + CHECK_DATABASE( db ); + if (!tst_Databases::isSqlServer( db )) + QSKIP("SQL Server specific test", SkipSingle); + + QString tableName(qTableName("test141895")), procName(qTableName("test141895_proc")); + QSqlQuery q( db ); + q.exec("DROP TABLE " + tableName); + q.exec("DROP PROCEDURE " + procName); + QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+" (id integer)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (3)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)")); + QVERIFY_SQL(q, exec("CREATE PROCEDURE "+procName+ + " AS " + "SELECT * FROM "+tableName+" WHERE ID = 2 " + "RETURN 0")); + + QVERIFY_SQL(q, exec("{CALL "+procName+"}")); + + QVERIFY_SQL(q, next()); +} + QTEST_MAIN( tst_QSqlQuery ) #include "tst_qsqlquery.moc" -- cgit v0.12 From 9cef27f506e15681f9935a1c00c9df3c6271d5f2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 17 Sep 2009 09:56:01 +0200 Subject: Update qt eclipse integration version number in docs, fix paths. --- tools/qdoc3/test/eclipse-integration.qdocconf | 6 +++--- tools/qdoc3/test/standalone-eclipse-integration.qdocconf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/test/eclipse-integration.qdocconf b/tools/qdoc3/test/eclipse-integration.qdocconf index aadaae6..13d8ab9 100644 --- a/tools/qdoc3/test/eclipse-integration.qdocconf +++ b/tools/qdoc3/test/eclipse-integration.qdocconf @@ -2,9 +2,9 @@ include(qt.qdocconf) headerdirs = sourcedirs = -sourcedirs = $QTDIR/../qteclipsetools/main/doc -imagedirs = $QTDIR/../qteclipsetools/main/doc -outputdir = $QTDIR/../qteclipsetools/main/doc/html +sourcedirs = $QTDIR/../qteclipsetools/eclipse_patched/doc +imagedirs = $QTDIR/../qteclipsetools/eclipse_patched/doc +outputdir = $QTDIR/../qteclipsetools/eclipse_patched/doc/html project = Qt Eclipse Integration description = "Qt Eclipse Integration" diff --git a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf index d61db54..b96c541 100644 --- a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf +++ b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf @@ -7,5 +7,5 @@ HTML.footer = "


\n" \ "\n" \ "\n" \ "\n" \ - "\n" \ + "\n" \ "
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Eclipse Integration 1.5.2
Qt Eclipse Integration 1.5.3
" -- cgit v0.12 From 603c423fc2ee2b9393e3c288e76354de0e0c1cc7 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 17 Sep 2009 10:21:49 +0200 Subject: Fix crash or painting error when drawing dashed lines with penWidth > 1 Since the width is multiplied into the dash, it needs to be divided out, otherwise you can get a dashOffset which is greater than the pattern at the index, and the dash can become negative. This will in turn lead to passing a negative width to the rasterizer, which at some point will get cast to an unsigned int and overflow. Depending on the position of the line and size of the buffer, this will either crash or produce garbled output. Task-number: QT-4444 Reviewed-by: Samuel --- src/gui/painting/qpaintengine_raster.cpp | 2 +- src/gui/painting/qrasterizer.cpp | 4 +++- tests/auto/qpainter/tst_qpainter.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index bd12fdb..bcea1ec 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3564,7 +3564,7 @@ void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line, if (dash >= length) { dash = length; - *dashOffset += dash; + *dashOffset += dash / width; length = 0; } else { *dashOffset = 0; diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 4500756..2b6791d 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -706,10 +706,12 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, if (a == b || width == 0 || d->clipRect.isEmpty()) return; + Q_ASSERT(width > 0.0); + QPointF pa = a; QPointF pb = b; - QPointF offs = QPointF(qAbs(b.y() - a.y()), qAbs(b.x() - a.x())) * width * 0.5; + QPointF offs = QPointF(qAbs(b.y() - a.y()), qAbs(b.x() - a.x())) * width * 0.5; if (squareCap) offs += QPointF(offs.y(), offs.x()); const QRectF clip(d->clipRect.topLeft() - offs, d->clipRect.bottomRight() + QPoint(1, 1) + offs); diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index e434ed6..c0eac21 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -230,6 +230,8 @@ private slots: void zeroOpacity(); void emptyClip(); + void taskQT4444_dontOverflowDashOffset(); + private: void fillData(); QColor baseColor( int k, int intensity=255 ); @@ -4239,5 +4241,28 @@ void tst_QPainter::emptyClip() p.fillPath(path, Qt::green); } +void tst_QPainter::taskQT4444_dontOverflowDashOffset() +{ + QPainter p; + + QPen pen; + pen.setWidth(2); + pen.setStyle(Qt::DashDotLine); + + QPointF point[4]; + point[0] = QPointF(182.50868749707968,347.78457234212630); + point[1] = QPointF(182.50868749707968,107.22501998401277); + point[2] = QPointF(182.50868749707968,107.22501998401277); + point[3] = QPointF(520.46600762283651,107.22501998401277); + + QImage crashImage(QSize(1000, 120), QImage::Format_ARGB32_Premultiplied); + p.begin(&crashImage); + p.setPen(pen); + p.drawLines(point, 2); + p.end(); + + QVERIFY(true); // Don't crash +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" -- cgit v0.12 From 36ec74d84b3403cc930a8296226ea921a62a277b Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 17 Sep 2009 11:30:36 +0200 Subject: Revert "Added autotest to demonstrate clipping path problem" This reverts commit e7042dea2431b8f64574d4e97eb896285b328c8b. Alexis : This should never have been here. E-mail is invalid. --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 32 -------------------------- 1 file changed, 32 deletions(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 391ccf8..d6605db 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -194,7 +194,6 @@ private slots: void itemClipsToShape(); void itemClipsChildrenToShape(); void itemClipsChildrenToShape2(); - void itemClipsChildrenToShape3(); void itemClipsTextChildToShape(); void itemClippingDiscovery(); void ancestorFlags(); @@ -4692,37 +4691,6 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2() #endif } -void tst_QGraphicsItem::itemClipsChildrenToShape3() -{ - // Construct a scene with nested children, each 50 pixels offset from the elder. - // Set a top-level clipping flag - QGraphicsScene scene; - QGraphicsRectItem *parent = scene.addRect( 0, 0, 150, 150 ); - QGraphicsRectItem *child = scene.addRect( 0, 0, 150, 150 ); - QGraphicsRectItem *grandchild = scene.addRect( 0, 0, 150, 150 ); - child->setParentItem(parent); - grandchild->setParentItem(child); - child->setPos( 50, 50 ); - grandchild->setPos( 50, 50 ); - parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape); - - QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)parent); - QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)child); - QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild); - QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0); - - // Move child to fully overlap the parent. The grandchild should - // now occupy two-thirds of the scene - child->prepareGeometryChange(); - child->setPos( 0, 0 ); - - QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)child); - QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)grandchild); - QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild); - QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0); -} - - void tst_QGraphicsItem::itemClipsTextChildToShape() { // Construct a scene with a rect that clips its children, with one text -- cgit v0.12 From ddf9e97d6700b78711632d352f84c469d000f97b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 17 Sep 2009 13:53:36 +0200 Subject: Designer: tab order in DeviceProfileDialog corrected Reviewed-by: Friedemann Kleint --- .../components/formeditor/deviceprofiledialog.ui | 84 ++++++++++++---------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/tools/designer/src/components/formeditor/deviceprofiledialog.ui b/tools/designer/src/components/formeditor/deviceprofiledialog.ui index 3186c57..17ee966 100644 --- a/tools/designer/src/components/formeditor/deviceprofiledialog.ui +++ b/tools/designer/src/components/formeditor/deviceprofiledialog.ui @@ -1,7 +1,8 @@ - - DeviceProfileDialog - - + + + dialog + + 0 0 @@ -9,78 +10,78 @@ 209 - + - - - - - + + + + + &Family - + m_systemFontComboBox - - + + - - - + + + &Point Size - + m_systemFontSizeCombo - - + + - - - + + + Style - + m_styleCombo - - + + - - - + + + Device DPI - - + + - - - + + + Name - - + + - - + + Qt::Horizontal - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Open|QDialogButtonBox::Save @@ -95,6 +96,13 @@ 1 + + m_nameLineEdit + m_systemFontComboBox + m_systemFontSizeCombo + m_styleCombo + buttonBox + -- cgit v0.12 From 5a29ceba42840add7a1dcf205c76e39065bee18d Mon Sep 17 00:00:00 2001 From: Takumi ASAKI Date: Thu, 17 Sep 2009 13:30:18 +0200 Subject: compile fix for embedded Linux and defined QT_COORD_TYPE If we define QT_COORD_TYPE, src/testlib doesn't compile for embedded Linux. Reviewed-By: joerg --- src/testlib/qtestcase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index edc6219..4f11f66 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -218,7 +218,7 @@ namespace QTest template bool qCompare(T1 const &, T2 const &, const char *, const char *, const char *, int); -#if defined(QT_ARCH_WINDOWSCE) && defined(QT_COORD_TYPE) +#if defined(QT_COORD_TYPE) && (defined(QT_ARCH_ARM) || defined(QT_NO_FPU) || defined(QT_ARCH_WINDOWSCE)) template <> inline bool qCompare(qreal const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) -- cgit v0.12 From a62506aae40ede3fd8030312321759f669458909 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 17 Sep 2009 15:39:59 +0200 Subject: Make the PowerVR screen driver for QWS compile against shipped headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pvr2d.h/wsegl.h headers we ship with Qt (in src/3rdparty/powervr) are meant for the PowerVR SGX. However, we use an MBX-specific define in the powervr driver. Reviewed-by: Jørgen Lind --- src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c index cc180f9..b26938b 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c @@ -50,8 +50,8 @@ /* Capability information for the display */ static WSEGLCaps const wseglDisplayCaps[] = { - {WSEGL_CAP_WINDOWS_USE_MBX_SYNC, 1}, - {WSEGL_CAP_PIXMAPS_USE_MBX_SYNC, 1}, + {WSEGL_CAP_WINDOWS_USE_HW_SYNC, 1}, + {WSEGL_CAP_PIXMAPS_USE_HW_SYNC, 1}, {WSEGL_NO_CAPS, 0} }; -- cgit v0.12