diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-07-29 06:26:31 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-07-29 06:26:31 (GMT) |
commit | 26cd689a2356973020b7f4c9d86b2ee71b3ef8fe (patch) | |
tree | 96f66ce2a10032cb057b667bc0720b3b8ec72174 /src | |
parent | 10f3d112fb61f249fc7736da85ee90ef42583fb1 (diff) | |
parent | da0b71b85dd3142d77a9e769327e55687ce9a7ae (diff) | |
download | Qt-26cd689a2356973020b7f4c9d86b2ee71b3ef8fe.zip Qt-26cd689a2356973020b7f4c9d86b2ee71b3ef8fe.tar.gz Qt-26cd689a2356973020b7f4c9d86b2ee71b3ef8fe.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.h | 7 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 11 | ||||
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 9 | ||||
-rw-r--r-- | src/qt3support/sql/q3sqlcursor.cpp | 2 | ||||
-rw-r--r-- | src/sql/drivers/db2/qsql_db2.cpp | 4 |
5 files changed, 29 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index c6bd0cd..c9a581c 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -517,6 +517,13 @@ class Q_GUI_EXPORT QGraphicsObject : public QObject, public QGraphicsItem public: QGraphicsObject(QGraphicsItem *parent = 0); + // ### Qt 5: Disambiguate +#ifdef Q_NO_USING_KEYWORD + const QObjectList &children() const { return QObject::children(); } +#else + using QObject::children; +#endif + Q_SIGNALS: void parentChanged(); void opacityChanged(); diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 9d8781b..d35ecb6 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2356,6 +2356,10 @@ void QGraphicsScene::addItem(QGraphicsItem *item) // Deliver post-change notification item->itemChange(QGraphicsItem::ItemSceneHasChanged, newSceneVariant); + // Auto-activate the first inactive window if the scene is active. + if (d->activationRefCount > 0 && !d->activeWindow && item->isWindow()) + setActiveWindow(static_cast<QGraphicsWidget *>(item)); + // Ensure that newly added items that have subfocus set, gain // focus automatically if there isn't a focus item already. if (!d->focusItem && item->focusItem()) @@ -3693,6 +3697,13 @@ void QGraphicsScene::keyReleaseEvent(QKeyEvent *keyEvent) void QGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { Q_D(QGraphicsScene); + if (d->mouseGrabberItems.isEmpty()) { + // Dispatch hover events + QGraphicsSceneHoverEvent hover; + _q_hoverFromMouseEvent(&hover, mouseEvent); + d->dispatchHoverEvent(&hover); + } + d->mousePressEventHandler(mouseEvent); } diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 1c4177e..3104083 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1211,7 +1211,10 @@ void qt_mac_menu_collapseSeparators(void */*NSMenu **/ theMenu, bool collapse) if (collapse) { bool previousIsSeparator = true; // setting to true kills all the separators placed at the top. NSMenuItem *previousItem = nil; - for (NSMenuItem *item in [menu itemArray]) { + + NSArray *itemArray = [menu itemArray]; + for (unsigned int i = 0; i < [itemArray count]; ++i) { + NSMenuItem *item = reinterpret_cast<NSMenuItem *>([itemArray objectAtIndex:i]); if ([item isSeparatorItem]) { [item setHidden:previousIsSeparator]; } @@ -1226,7 +1229,9 @@ void qt_mac_menu_collapseSeparators(void */*NSMenu **/ theMenu, bool collapse) if (previousItem && previousIsSeparator) [previousItem setHidden:YES]; } else { - for (NSMenuItem *item in [menu itemArray]) { + NSArray *itemArray = [menu itemArray]; + for (unsigned int i = 0; i < [itemArray count]; ++i) { + NSMenuItem *item = reinterpret_cast<NSMenuItem *>([itemArray objectAtIndex:i]); if (QAction *action = reinterpret_cast<QAction *>([item tag])) [item setHidden:!action->isVisible()]; } diff --git a/src/qt3support/sql/q3sqlcursor.cpp b/src/qt3support/sql/q3sqlcursor.cpp index 6b0c69f..aa6aae2 100644 --- a/src/qt3support/sql/q3sqlcursor.cpp +++ b/src/qt3support/sql/q3sqlcursor.cpp @@ -879,7 +879,7 @@ QString Q3SqlCursor::toString(const QString& prefix, QSqlField* field, const QSt { QString f; if (field && driver()) { - f = (prefix.length() > 0 ? prefix + QLatin1Char('.') : QString()) + field->name(); + f = (prefix.length() > 0 ? prefix + QLatin1Char('.') : QString()) + driver()->escapeIdentifier(field->name(), QSqlDriver::FieldName); f += QLatin1Char(' ') + fieldSep + QLatin1Char(' '); if (field->isNull()) { f += QLatin1String("NULL"); diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp index 474c53d..a32b3aa 100644 --- a/src/sql/drivers/db2/qsql_db2.cpp +++ b/src/sql/drivers/db2/qsql_db2.cpp @@ -868,11 +868,13 @@ bool QDB2Result::fetch(int i) SQL_FETCH_ABSOLUTE, actualIdx); } - if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) { + if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r != SQL_NO_DATA) { setLastError(qMakeError(QCoreApplication::translate("QDB2Result", "Unable to fetch record %1").arg(i), QSqlError::StatementError, d)); return false; } + else if (r == SQL_NO_DATA) + return false; setAt(i); return true; } |