diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-17 07:05:18 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-17 07:05:18 (GMT) |
commit | dfcf988a3f0c88f96e202482e5d363d880b9d6d2 (patch) | |
tree | 42ee9ccb99945e64956abc7d1a6f1259e10a006e | |
parent | 4bf2d055aa31a7d2768538368d2984a3d594650e (diff) | |
parent | 18c0fec3afba909faa341c766f31d679892021db (diff) | |
download | Qt-dfcf988a3f0c88f96e202482e5d363d880b9d6d2.zip Qt-dfcf988a3f0c88f96e202482e5d363d880b9d6d2.tar.gz Qt-dfcf988a3f0c88f96e202482e5d363d880b9d6d2.tar.bz2 |
Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts:
tests/auto/qimagereader/tst_qimagereader.cpp
tests/auto/qtwidgets/tst_qtwidgets.cpp
-rw-r--r-- | src/3rdparty/phonon/gstreamer/mediaobject.cpp | 14 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 6 | ||||
-rw-r--r-- | src/sql/drivers/odbc/qsql_odbc.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 32 | ||||
-rw-r--r-- | tests/auto/qimagereader/tst_qimagereader.cpp | 11 | ||||
-rw-r--r-- | tests/auto/qkeysequence/qkeysequence.pro | 4 | ||||
-rw-r--r-- | tests/auto/qkeysequence/qkeysequence.qrc | 6 | ||||
-rw-r--r-- | tests/auto/qkeysequence/qt_de.qm | bin | 0 -> 186240 bytes | |||
-rw-r--r-- | tests/auto/qkeysequence/tst_qkeysequence.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qsqlquery/tst_qsqlquery.cpp | 38 |
10 files changed, 109 insertions, 16 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); + } } } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b3aef71..53d2102 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7535,7 +7535,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(); diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 22f446d..7cf5e8b 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -882,6 +882,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) { @@ -1500,6 +1505,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/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 304330e..fa163d8 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -246,6 +246,7 @@ private slots: void itemClipsToShape(); void itemClipsChildrenToShape(); void itemClipsChildrenToShape2(); + void itemClipsChildrenToShape3(); void itemClipsTextChildToShape(); void itemClippingDiscovery(); void ancestorFlags(); @@ -5050,6 +5051,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 diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index cab8fda..c0d5051 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -719,13 +719,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 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 @@ +<RCC> + <qresource> + <file>keys_de.qm</file> + <file>qt_de.qm</file> + </qresource> +</RCC> diff --git a/tests/auto/qkeysequence/qt_de.qm b/tests/auto/qkeysequence/qt_de.qm Binary files differnew file mode 100644 index 0000000..595e4d7 --- /dev/null +++ b/tests/auto/qkeysequence/qt_de.qm diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index 88d1d55..1c257bf 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() diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 4bea26d..eb95d611c 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 @@ -312,6 +315,13 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) tablenames << qTableName( "task_250026" ); tablenames << qTableName( "task_234422" ); + if (tst_Databases::isSqlServer( db )) { + QSqlQuery q( db ); + q.exec("DROP PROCEDURE " + qTableName("test141895_proc")); + } + + tablenames << qTableName("test141895"); + tst_Databases::safeDropTables( db, tablenames ); } @@ -2808,5 +2818,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" |