diff options
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qrasterizer.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 15 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c | 11 | ||||
-rw-r--r-- | src/sql/drivers/odbc/qsql_odbc.cpp | 10 | ||||
-rw-r--r-- | src/testlib/qtestcase.h | 2 | ||||
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 32 | ||||
-rw-r--r-- | tests/auto/qpainter/tst_qpainter.cpp | 25 | ||||
-rw-r--r-- | tests/auto/qsqlquery/tst_qsqlquery.cpp | 38 | ||||
-rw-r--r-- | tools/designer/src/components/formeditor/deviceprofiledialog.ui | 82 | ||||
-rw-r--r-- | tools/qdoc3/test/eclipse-integration.qdocconf | 6 | ||||
-rw-r--r-- | tools/qdoc3/test/standalone-eclipse-integration.qdocconf | 2 |
13 files changed, 154 insertions, 80 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/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 5acf134..f329555 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1302,6 +1302,11 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) do not support the signals: aboutToHide (), aboutToShow () and hovered (). It is not possible to display an icon in a native menu on Windows Mobile. + \section1 QMenu on Mac OS X with Qt build against Cocoa + + QMenu can be inserted only once in a menu/menubar. Subsequent insertions will + have no effect or will result in a disabled menu item. + See the \l{mainwindows/menus}{Menus} example for an example of how to use QMenuBar and QMenu in your application. diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 264d6d3..354161d 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -1412,7 +1412,15 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action) GetMenuItemProperty(action->menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(caused), 0, &caused); SetMenuItemProperty(data.submenuHandle, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), &caused); #else - [item setSubmenu:static_cast<NSMenu *>(action->action->menu()->macMenu())]; + NSMenu *subMenu = static_cast<NSMenu *>(action->action->menu()->macMenu()); + if ([subMenu supermenu] != nil) { + // The menu is already a sub-menu of another one. Cocoa will throw an exception, + // in such cases. For the time being, a new QMenu with same set of actions is the + // only workaround. + action->action->setEnabled(false); + } else { + [item setSubmenu:subMenu]; + } #endif } else { //respect some other items #ifndef QT_MAC_USE_COCOA @@ -1678,7 +1686,10 @@ QMenuBarPrivate::QMacMenuBarPrivate::syncAction(QMacMenuAction *action) GetMenuItemProperty(action->menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(caused), 0, &caused); SetMenuItemProperty(submenu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), &caused); #else - [item setSubmenu:submenu]; + if ([submenu supermenu] != nil) + return; + else + [item setSubmenu:submenu]; #endif } #ifndef QT_MAC_USE_COCOA diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c index cc180f9..253f39f 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c @@ -48,10 +48,17 @@ #define WSEGL_UNUSED(x) (void)x; +// If the PVR2D version is not specified, then assume MBX-style headers. +// If the version is defined, then we assume that we have SGX-style headers. +#if !defined(PVR2D_REV_MAJOR) +#define WSEGL_CAP_WINDOWS_USE_HW_SYNC WSEGL_CAP_WINDOWS_USE_MBX_SYNC +#define WSEGL_CAP_PIXMAPS_USE_HW_SYNC WSEGL_CAP_PIXMAPS_USE_MBX_SYNC +#endif + /* 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} }; 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/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 <typename T1, typename T2> 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, float>(qreal const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) 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 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" 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" diff --git a/tools/designer/src/components/formeditor/deviceprofiledialog.ui b/tools/designer/src/components/formeditor/deviceprofiledialog.ui index 3186c57..d7a298c 100644 --- a/tools/designer/src/components/formeditor/deviceprofiledialog.ui +++ b/tools/designer/src/components/formeditor/deviceprofiledialog.ui @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>DeviceProfileDialog</class> - <widget class="QDialog" name="dialog" > - <property name="geometry" > + <widget class="QDialog" name="dialog"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,78 +10,78 @@ <height>209</height> </rect> </property> - <layout class="QVBoxLayout" name="verticalLayout" > + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QWidget" native="1" name="SystemSettingsWidget" > - <layout class="QFormLayout" name="formLayout" > - <item row="1" column="0" > - <widget class="QLabel" name="m_systemFontFamilyLabel" > - <property name="text" > + <widget class="QWidget" name="SystemSettingsWidget" native="true"> + <layout class="QFormLayout" name="formLayout"> + <item row="1" column="0"> + <widget class="QLabel" name="m_systemFontFamilyLabel"> + <property name="text"> <string>&Family</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>m_systemFontComboBox</cstring> </property> </widget> </item> - <item row="1" column="1" > - <widget class="QFontComboBox" name="m_systemFontComboBox" /> + <item row="1" column="1"> + <widget class="QFontComboBox" name="m_systemFontComboBox"/> </item> - <item row="2" column="0" > - <widget class="QLabel" name="m_systemFontSizeLabel" > - <property name="text" > + <item row="2" column="0"> + <widget class="QLabel" name="m_systemFontSizeLabel"> + <property name="text"> <string>&Point Size</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>m_systemFontSizeCombo</cstring> </property> </widget> </item> - <item row="2" column="1" > - <widget class="QComboBox" name="m_systemFontSizeCombo" /> + <item row="2" column="1"> + <widget class="QComboBox" name="m_systemFontSizeCombo"/> </item> - <item row="3" column="0" > - <widget class="QLabel" name="m_styleLabel" > - <property name="text" > + <item row="3" column="0"> + <widget class="QLabel" name="m_styleLabel"> + <property name="text"> <string>Style</string> </property> - <property name="buddy" > + <property name="buddy"> <cstring>m_styleCombo</cstring> </property> </widget> </item> - <item row="3" column="1" > - <widget class="QComboBox" name="m_styleCombo" /> + <item row="3" column="1"> + <widget class="QComboBox" name="m_styleCombo"/> </item> - <item row="4" column="0" > - <widget class="QLabel" name="m_systemDPILabel" > - <property name="text" > + <item row="4" column="0"> + <widget class="QLabel" name="m_systemDPILabel"> + <property name="text"> <string>Device DPI</string> </property> </widget> </item> - <item row="4" column="1" > - <widget class="qdesigner_internal::DPI_Chooser" native="1" name="m_dpiChooser" /> + <item row="4" column="1"> + <widget class="qdesigner_internal::DPI_Chooser" name="m_dpiChooser" native="true"/> </item> - <item row="0" column="0" > - <widget class="QLabel" name="m_nameLabel" > - <property name="text" > + <item row="0" column="0"> + <widget class="QLabel" name="m_nameLabel"> + <property name="text"> <string>Name</string> </property> </widget> </item> - <item row="0" column="1" > - <widget class="QLineEdit" name="m_nameLineEdit" /> + <item row="0" column="1"> + <widget class="QLineEdit" name="m_nameLineEdit"/> </item> </layout> </widget> </item> <item> - <widget class="QDialogButtonBox" name="buttonBox" > - <property name="orientation" > + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="standardButtons" > + <property name="standardButtons"> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Open|QDialogButtonBox::Save</set> </property> </widget> @@ -95,6 +96,13 @@ <container>1</container> </customwidget> </customwidgets> + <tabstops> + <tabstop>m_nameLineEdit</tabstop> + <tabstop>m_systemFontComboBox</tabstop> + <tabstop>m_systemFontSizeCombo</tabstop> + <tabstop>m_styleCombo</tabstop> + <tabstop>buttonBox</tabstop> + </tabstops> <resources/> <connections/> </ui> 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 = "<p /><address><hr /><div align=\"center\">\n" \ "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ "<td width=\"30%\" align=\"left\">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ "<td width=\"40%\" align=\"center\"><a href=\"http://qt.nokia.com/doc/trademarks.html\">Trademarks</a></td>\n" \ - "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Eclipse Integration 1.5.2</div></td>\n" \ + "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt Eclipse Integration 1.5.3</div></td>\n" \ "</tr></table></div></address>" |