From 55cf7c577da015bd6d48a034902477b83cf73be7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 27 Feb 2013 17:21:11 +0100 Subject: [PATCH 01/25] Fix QCommonStyle::drawControl(CE_ShapedFrame) for QFrame::H/VLine Respect QStyleOption::rect, do not expect Y to be 0. Task-number: QTBUG-29926 Change-Id: I6304d20f629f89774c897d2c81c2c7816dff4718 Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index d1d80f5af05..4b6ba17595d 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -2265,11 +2265,11 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, case QFrame::VLine: { QPoint p1, p2; if (frameShape == QFrame::HLine) { - p1 = QPoint(opt->rect.x(), opt->rect.height() / 2); + p1 = QPoint(opt->rect.x(), opt->rect.y() + opt->rect.height() / 2); p2 = QPoint(opt->rect.x() + opt->rect.width(), p1.y()); } else { - p1 = QPoint(opt->rect.x()+opt->rect.width() / 2, 0); - p2 = QPoint(p1.x(), opt->rect.height()); + p1 = QPoint(opt->rect.x() + opt->rect.width() / 2, opt->rect.y()); + p2 = QPoint(p1.x(), p1.y() + opt->rect.height()); } if (frameShadow == QFrame::Plain) { QPen oldPen = p->pen(); From 9fbecf11c7c5f7c059d6ba84c3da1458eaee608d Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Tue, 11 Dec 2012 16:10:01 -0200 Subject: [PATCH 02/25] QNX: QQnxCursor implementation. Implementation of QQnxCursor, a QPlatformCursor subclass. Due to the lack of a proper cursor API from the underlying OS, this class only caches the current cursor position to make sure that the QCursor class works properly. This is a backport of 290ed7f8fafd67197f773454223410bbe57fc4d3. At the time there weren't any known bugs regarding this, so it was committed to "dev" branch as a feature. Now we needed it in "stable", otherwise menus don't work correctly, due to QCursor::pos() being bogus. Change-Id: I5a4217c92a0aaed0b22b45ca3c4e0fad882e810f Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qnx.pro | 7 +- src/plugins/platforms/qnx/qqnxcursor.cpp | 78 +++++++++++++++++++ src/plugins/platforms/qnx/qqnxcursor.h | 67 ++++++++++++++++ src/plugins/platforms/qnx/qqnxscreen.cpp | 11 ++- src/plugins/platforms/qnx/qqnxscreen.h | 4 + .../platforms/qnx/qqnxscreeneventhandler.cpp | 2 + 6 files changed, 166 insertions(+), 3 deletions(-) create mode 100644 src/plugins/platforms/qnx/qqnxcursor.cpp create mode 100644 src/plugins/platforms/qnx/qqnxcursor.h diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro index 8367513fc53..203cdebda91 100644 --- a/src/plugins/platforms/qnx/qnx.pro +++ b/src/plugins/platforms/qnx/qnx.pro @@ -39,6 +39,7 @@ CONFIG(blackberry) { #DEFINES += QQNXSCREEN_DEBUG #DEFINES += QQNXVIRTUALKEYBOARD_DEBUG #DEFINES += QQNXWINDOW_DEBUG +#DEFINES += QQNXCURSOR_DEBUG SOURCES = main.cpp \ @@ -54,7 +55,8 @@ SOURCES = main.cpp \ qqnxnavigatoreventhandler.cpp \ qqnxabstractnavigator.cpp \ qqnxabstractvirtualkeyboard.cpp \ - qqnxservices.cpp + qqnxservices.cpp \ + qqnxcursor.cpp HEADERS = main.h \ qqnxbuffer.h \ @@ -70,7 +72,8 @@ HEADERS = main.h \ qqnxnavigatoreventhandler.h \ qqnxabstractnavigator.h \ qqnxabstractvirtualkeyboard.h \ - qqnxservices.h + qqnxservices.h \ + qqnxcursor.h LIBS += -lscreen diff --git a/src/plugins/platforms/qnx/qqnxcursor.cpp b/src/plugins/platforms/qnx/qqnxcursor.cpp new file mode 100644 index 00000000000..4fdff666d74 --- /dev/null +++ b/src/plugins/platforms/qnx/qqnxcursor.cpp @@ -0,0 +1,78 @@ +/*************************************************************************** +** +** Copyright (C) 2011 - 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqnxcursor.h" + +#include + +#ifdef QQNXCURSOR_DEBUG +#define qCursorDebug qDebug +#else +#define qCursorDebug QT_NO_QDEBUG_MACRO +#endif + +QT_BEGIN_NAMESPACE + +QQnxCursor::QQnxCursor() +{ +} + +#ifndef QT_NO_CURSOR +void QQnxCursor::changeCursor(QCursor *windowCursor, QWindow *window) +{ + Q_UNUSED(windowCursor); + Q_UNUSED(window); +} +#endif + +void QQnxCursor::setPos(const QPoint &pos) +{ + qCursorDebug() << "QQnxCursor::setPos -" << pos; + m_pos = pos; +} + +QPoint QQnxCursor::pos() const +{ + qCursorDebug() << "QQnxCursor::pos -" << m_pos; + return m_pos; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxcursor.h b/src/plugins/platforms/qnx/qqnxcursor.h new file mode 100644 index 00000000000..5d6a8b2c309 --- /dev/null +++ b/src/plugins/platforms/qnx/qqnxcursor.h @@ -0,0 +1,67 @@ +/*************************************************************************** +** +** Copyright (C) 2011 - 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQNXCURSOR_H +#define QQNXCURSOR_H + +#include + +QT_BEGIN_NAMESPACE + +class QQnxCursor : public QPlatformCursor +{ +public: + QQnxCursor(); + +#ifndef QT_NO_CURSOR + void changeCursor(QCursor *windowCursor, QWindow *window); +#endif + void setPos(const QPoint &pos); + + QPoint pos() const; + +private: + QPoint m_pos; +}; + +QT_END_NAMESPACE + +#endif // QQNXCURSOR_H diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 1e58f047abf..fc8b3bb167a 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -41,6 +41,7 @@ #include "qqnxscreen.h" #include "qqnxwindow.h" +#include "qqnxcursor.h" #include #include @@ -110,7 +111,8 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, m_posted(false), m_keyboardHeight(0), m_nativeOrientation(Qt::PrimaryOrientation), - m_platformContext(0) + m_platformContext(0), + m_cursor(new QQnxCursor()) { qScreenDebug() << Q_FUNC_INFO; // Cache initial orientation of this display @@ -149,6 +151,8 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, QQnxScreen::~QQnxScreen() { qScreenDebug() << Q_FUNC_INFO; + + delete m_cursor; } static int defaultDepth() @@ -492,6 +496,11 @@ void QQnxScreen::onWindowPost(QQnxWindow *window) } } +QPlatformCursor * QQnxScreen::cursor() const +{ + return m_cursor; +} + void QQnxScreen::keyboardHeightChanged(int height) { if (height == m_keyboardHeight) diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index 2851c13c52c..39cd4159d15 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -95,6 +95,8 @@ public: QSharedPointer rootWindow() const; + QPlatformCursor *cursor() const; + public Q_SLOTS: void setRotation(int rotation); void newWindowCreated(void *window); @@ -130,6 +132,8 @@ private: QList m_childWindows; QList m_overlays; + + QPlatformCursor *m_cursor; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index 4412bb34bdc..2d3c7608bf8 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -347,6 +347,8 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType) qFatal("QQNX: failed to query event position, errno=%d", errno); } + QCursor::setPos(pos[0], pos[1]); + // get window coordinates of touch errno = 0; int windowPos[2]; From 84a1493b509994901cb336c93378b80ed82b6a2a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 16 Apr 2012 08:25:23 +0200 Subject: [PATCH 03/25] doc: remove link to obsolete doc Change-Id: Ie1a48a821764978a28e274c7eb52ee02aef391a6 Reviewed-by: Jerome Pasion --- src/corelib/doc/src/objectmodel/object.qdoc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/corelib/doc/src/objectmodel/object.qdoc b/src/corelib/doc/src/objectmodel/object.qdoc index 281c1a30cb6..1d33c14d0fa 100644 --- a/src/corelib/doc/src/objectmodel/object.qdoc +++ b/src/corelib/doc/src/objectmodel/object.qdoc @@ -66,11 +66,7 @@ by Qt's own \l{moc}{Meta-Object Compiler (moc)}. The meta-object system is a C++ extension that makes the language - better suited to true component GUI programming. Although - templates can be used to extend C++, the meta-object system - provides benefits using standard C++ that cannot be achieved with - templates; see \l{Why Doesn't Qt Use Templates for Signals and - Slots?} + better suited to true component GUI programming. \section1 Important Classes From c82b0815ec80b3750a110d47c68142bb448ddf56 Mon Sep 17 00:00:00 2001 From: Matt Fischer Date: Thu, 28 Feb 2013 10:52:12 -0600 Subject: [PATCH 04/25] Fixed -dbus-linked when cross-compiling from Windows Since Windows doesn't have pkg-config, it doesn't get -ldbus-1 added to the command line automatically like Linux does. Code was present to deal with this case, however it was only configured to work when native-compiling Qt. The flag was not added when cross-compiling, meaning that -dbus-linked did not work correctly in that case. This patch changes the code to add the flag properly in both cases. Change-Id: I67881643bd658161f4929f3932859ccf636ca7a9 Task-number: QTBUG-29984 Reviewed-by: Thiago Macieira --- src/dbus/dbus.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 5ad77ddf951..2e4119ba930 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -6,6 +6,8 @@ MODULE_CONFIG = dbusadaptors dbusinterfaces !isEmpty(DBUS_PATH) { INCLUDEPATH += $$DBUS_PATH/include QMAKE_LIBDIR += $$DBUS_PATH/lib + win32:CONFIG(debug, debug|release):QT_LIBS_DBUS += -ldbus-1d + else:QT_LIBS_DBUS += -ldbus-1 } DEFINES += DBUS_API_SUBJECT_TO_CHANGE @@ -21,8 +23,6 @@ win32 { -ladvapi32 \ -lnetapi32 \ -luser32 - CONFIG(debug, debug|release):LIBS_PRIVATE += -ldbus-1d - else:LIBS_PRIVATE += -ldbus-1 } QMAKE_DOCS = $$PWD/doc/qtdbus.qdocconf From 3ef2daf6ceb0b6736081b8b72f482e5228d44bc1 Mon Sep 17 00:00:00 2001 From: Irfan Omair Date: Tue, 26 Feb 2013 12:08:52 -0800 Subject: [PATCH 05/25] Fix Alt key capture issue with mouseWheel Task-number: QTBUG-29820 Change-Id: I8932b7bcadd6495debda6cdf0a576f83a0ccad47 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsmousehandler.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.h b/src/plugins/platforms/windows/qwindowsmousehandler.h index b3bfa033808..caf30e6b1a4 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.h +++ b/src/plugins/platforms/windows/qwindowsmousehandler.h @@ -109,6 +109,8 @@ Qt::KeyboardModifiers QWindowsMouseHandler::keyStateToModifiers(int wParam) mods |= Qt::ControlModifier; if (wParam & MK_SHIFT) mods |= Qt::ShiftModifier; + if (GetKeyState(VK_MENU) < 0) + mods |= Qt::AltModifier; return mods; } From dbe74582a6602b87012728369d56dec059cc449e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 28 Feb 2013 15:31:57 +0100 Subject: [PATCH 06/25] remove unused member Option::application_argv0 Use QMakeGlobals::qmake_abslocation instead. Change-Id: I1d0f39549b477ede674730937d879c492407fb28 Reviewed-by: Oswald Buddenhagen --- qmake/option.cpp | 3 --- qmake/option.h | 1 - 2 files changed, 4 deletions(-) diff --git a/qmake/option.cpp b/qmake/option.cpp index fdf11d92661..983d3490d81 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -57,7 +57,6 @@ ProFileCache *Option::proFileCache; QMakeParser *Option::parser; //convenience -const char *Option::application_argv0 = 0; QString Option::prf_ext; QString Option::prl_ext; QString Option::libtool_ext; @@ -318,13 +317,11 @@ Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state) int Option::init(int argc, char **argv) { - Option::application_argv0 = 0; Option::prf_ext = ".prf"; Option::pro_ext = ".pro"; Option::field_sep = ' '; if(argc && argv) { - Option::application_argv0 = argv[0]; QString argv0 = argv[0]; if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING) Option::qmake_mode = default_mode(argv0); diff --git a/qmake/option.h b/qmake/option.h index 541757b2640..6225f6b4d2f 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -109,7 +109,6 @@ struct Option static QString pro_ext; static QString res_ext; static char field_sep; - static const char *application_argv0; enum CmdLineFlags { QMAKE_CMDLINE_SUCCESS = 0x00, From 8238acccf028e4beaa8dadf19b768920cc1d45bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 27 Feb 2013 10:16:02 +0100 Subject: [PATCH 07/25] Cocoa: Don't send duplicate mouse move events. We now use tracking regions to generate move events, setAcceptsMouseMoveEvents will generate duplicates. See also commit b077e67f. Change-Id: I750e33766e66693ce899380c5cd9715baa9aa241 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 2adf0d24a1e..00910288968 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -754,7 +754,6 @@ void QCocoaWindow::setNSWindow(NSWindow *window) { m_nsWindowDelegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:this]; [window setDelegate:m_nsWindowDelegate]; - [window setAcceptsMouseMovedEvents:YES]; // Prevent Cocoa from releasing the window on close. Qt // handles the close event asynchronously and we want to From ebc4fb452ac268657023cb957c1b0ca0e315b9fc Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Mar 2013 10:54:45 +0100 Subject: [PATCH 08/25] define NDEBUG in MSVC/nmake release builds Some headers, like assert.h, check for the presence of NDEBUG. We already define NDEBUG for MSVC/vcproj release builds. Task-number: QTBUG-3389 Change-Id: I3b1510d47ff80611aa8072e66492ff2d648393eb Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_nmake.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 8b40d4e9359..01243defd37 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -304,6 +304,11 @@ void NmakeMakefileGenerator::init() project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".ilk"); project->values("QMAKE_CLEAN").append("vc*.pdb"); project->values("QMAKE_CLEAN").append("vc*.idb"); + project->values("DEFINES").removeAll("NDEBUG"); + } else { + ProStringList &defines = project->values("DEFINES"); + if (!defines.contains("NDEBUG")) + defines.append("NDEBUG"); } } From f2e8a81227b3ee09afe1bf8a5d292e8c5f2ee67f Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 21 Feb 2013 12:11:35 +0100 Subject: [PATCH 09/25] QMimeDatabase: pass MatchMode down, to fix MatchContent. Task-number: QTBUG-29702 Change-Id: I2f1538adbf8e7a5edfc4276585bf4ef04ce69874 Reviewed-by: Konstantin Ritt Reviewed-by: Thiago Macieira --- src/corelib/mimetypes/qmimedatabase.cpp | 2 +- .../corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp index d8b7a02a1b8..a5f5a326d41 100644 --- a/src/corelib/mimetypes/qmimedatabase.cpp +++ b/src/corelib/mimetypes/qmimedatabase.cpp @@ -418,7 +418,7 @@ QMimeType QMimeDatabase::mimeTypeForFile(const QString &fileName, MatchMode mode } else { // Implemented as a wrapper around mimeTypeForFile(QFileInfo), so no mutex. QFileInfo fileInfo(fileName); - return mimeTypeForFile(fileInfo); + return mimeTypeForFile(fileInfo, mode); } } diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 79d8b3dfe4d..a90bfadd737 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -442,6 +442,8 @@ void tst_QMimeDatabase::mimeTypeForFileWithContent() txtTempFile.close(); mime = db.mimeTypeForFile(txtTempFileName); QCOMPARE(mime.name(), QString::fromLatin1("text/plain")); + mime = db.mimeTypeForFile(txtTempFileName, QMimeDatabase::MatchContent); + QCOMPARE(mime.name(), QString::fromLatin1("application/smil")); } // Test what happens with an incorrect path @@ -714,6 +716,8 @@ void tst_QMimeDatabase::findByData() QFileInfo info(filePath); QString mimeForInfo = database.mimeTypeForFile(info, QMimeDatabase::MatchContent).name(); QCOMPARE(mimeForInfo, resultMimeTypeName); + QString mimeForFile = database.mimeTypeForFile(filePath, QMimeDatabase::MatchContent).name(); + QCOMPARE(mimeForFile, resultMimeTypeName); } void tst_QMimeDatabase::findByFile_data() From a496b5dc38c96465e6ea4750ef293d8f2c3b6fc5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Jan 2013 17:44:54 -0800 Subject: [PATCH 10/25] Fix warnings reported by ICC in qdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit doc.cpp(3292): error #68: integer conversion resulted in a change of sign generator.cpp(363): error #68: integer conversion resulted in a change of sign Change-Id: Ie714ffcb4098debc701ce3fb6fa444154ac02ae5 Reviewed-by: Jędrzej Nowacki --- src/tools/qdoc/doc.cpp | 2 +- src/tools/qdoc/generator.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index a0a2e511989..e20e85028f6 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -3291,7 +3291,7 @@ QString Doc::canonicalTitle(const QString &title) for (int i = 0; i != title.size(); ++i) { uint c = title.at(i).unicode(); if (c >= 'A' && c <= 'Z') - c -= 'A' - 'a'; + c += 'a' - 'A'; bool alnum = (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); if (alnum) { result += QLatin1Char(c); diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 95ba6d28bf6..47ebded1b1c 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -360,7 +360,7 @@ QString Generator::fileBase(const Node *node) const QChar c = base.at(i); uint u = c.unicode(); if (u >= 'A' && u <= 'Z') - u -= 'A' - 'a'; + u += 'a' - 'A'; if ((u >= 'a' && u <= 'z') || (u >= '0' && u <= '9')) { res += QLatin1Char(u); begun = true; From 8c8e9f59bcbf6ce394b9ae081988f3d294438acd Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 24 Jan 2013 16:41:24 +0100 Subject: [PATCH 11/25] showIsFullscreen: only respect this hint for windows and dialogs If the window or widget is a popup, ignore the hint. The intention of the flag should be to show main windows etc in fullscreen, and not all kinds of popups and tooltips. The user can always call showFullscreen explicit when necessary. This is a backport of 48c73540ad2a507963db0fba57484faf66462ad7. We need it in stable to fix menus on BlackBerry platform, they're appearing fullscreen. Task-number: QTBUG-29969 Change-Id: Id0d6cfc194916aa7f993cde54b5a0002f60399e1 Reviewed-by: Thomas McGuire --- src/gui/kernel/qwindow.cpp | 8 +++++--- src/widgets/kernel/qwidget.cpp | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 2a2e30634a9..f4a2059d746 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1449,13 +1449,15 @@ QObject *QWindow::focusObject() const Shows the window. This equivalent to calling showFullScreen() or showNormal(), depending - on whether the platform defaults to windows being fullscreen or not. + on whether the platform defaults to windows being fullscreen or not, and + whether the window is a popup. - \sa showFullScreen(), showNormal(), hide(), QStyleHints::showIsFullScreen() + \sa showFullScreen(), showNormal(), hide(), QStyleHints::showIsFullScreen(), flags() */ void QWindow::show() { - if (qApp->styleHints()->showIsFullScreen()) + bool isPopup = d_func()->windowFlags & Qt::Popup & ~Qt::Window; + if (!isPopup && qApp->styleHints()->showIsFullScreen()) showFullScreen(); else showNormal(); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 5ec713140e0..f82d33f2835 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6916,14 +6916,15 @@ void QWidget::setUpdatesEnabled(bool enable) Shows the widget and its child widgets. This function is equivalent to setVisible(true) in the normal case, and equivalent to showFullScreen() if the QStyleHints::showIsFullScreen() hint - is true. + is true and the window is not a popup. \sa raise(), showEvent(), hide(), setVisible(), showMinimized(), showMaximized(), - showNormal(), isVisible() + showNormal(), isVisible(), windowFlags() */ void QWidget::show() { - if (isWindow() && qApp->styleHints()->showIsFullScreen()) + bool isPopup = data->window_flags & Qt::Popup & ~Qt::Window; + if (isWindow() && !isPopup && qApp->styleHints()->showIsFullScreen()) showFullScreen(); else setVisible(true); From 7ed41b0e542b725c06405d837a8d6b8c10269645 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 28 Feb 2013 13:42:58 +0100 Subject: [PATCH 12/25] QGnomeTheme style names: replace cleanlooks with fusion Change-Id: I681b2124fda14c08bd7d58f9adcc76774fc984ad Reviewed-by: Jens Bache-Wiig --- src/platformsupport/themes/genericunix/qgenericunixthemes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index f2babe41a43..6e40bbfa15f 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -380,7 +380,7 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const return QVariant(QGenericUnixTheme::xdgIconThemePaths()); case QPlatformTheme::StyleNames: { QStringList styleNames; - styleNames << QStringLiteral("GTK+") << QStringLiteral("cleanlooks") << QStringLiteral("windows"); + styleNames << QStringLiteral("GTK+") << QStringLiteral("fusion") << QStringLiteral("windows"); return QVariant(styleNames); } case QPlatformTheme::KeyboardScheme: From c0c38912ebf0640ddae71f507bed6cc0b8c82fe6 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 4 Mar 2013 12:37:44 +0100 Subject: [PATCH 13/25] qdoc: Allow QML linking without version nr This change allows links of the form: \l{qml-module-name::qml-type}{name} i.e. no version number provided. This change does not handle collisions. There aren't any in Qt5 at the moment. If a collision occurs, qdoc will link to the name in one of the colliding QML modules, but not necessarily the most recent one. Hence, the link may go to the wrong page. A further update might be forthcoming that will handle this better. Task-number: QTBUG-29778 Change-Id: Ie2c2b117446ed02852593dd0273c390d39fed927 Reviewed-by: Venugopal Shivashankar Reviewed-by: Jerome Pasion --- src/tools/qdoc/qdocdatabase.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index 58c674de7ab..191da5caf84 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -291,29 +291,29 @@ DocNode* QDocDatabase::addToModule(const QString& name, Node* node) */ DocNode* QDocDatabase::addToQmlModule(const QString& name, Node* node) { - QString longQmid, shortQmid; + QStringList qmid; QStringList dotSplit; QStringList blankSplit = name.split(QLatin1Char(' ')); + qmid.append(blankSplit[0]); if (blankSplit.size() > 1) { - longQmid = blankSplit[0] + blankSplit[1]; + qmid.append(blankSplit[0] + blankSplit[1]); dotSplit = blankSplit[1].split(QLatin1Char('.')); - shortQmid = blankSplit[0] + dotSplit[0]; + qmid.append(blankSplit[0] + dotSplit[0]); } DocNode* dn = findQmlModule(name); dn->addMember(node); node->setQmlModuleInfo(name); if (node->subType() == Node::QmlClass) { QmlClassNode* n = static_cast(node); - QString key = longQmid + "::" + node->name(); - for (int i=0; i<2; ++i) { + for (int i=0; iname(); if (!qmlTypeMap_.contains(key)) qmlTypeMap_.insert(key,n); if (!masterMap_.contains(key)) masterMap_.insert(key,node); - if (!masterMap_.contains(node->name(),node)) - masterMap_.insert(node->name(),node); - key = shortQmid + "::" + node->name(); } + if (!masterMap_.contains(node->name(),node)) + masterMap_.insert(node->name(),node); } return dn; } From bc741b867cbff58f59c2698d22a37121ebcc6c50 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 1 Mar 2013 13:37:51 +0100 Subject: [PATCH 14/25] Windows: Repaint when switching off layered windows by opacity. Task-number: QTBUG-29010 Change-Id: I565a800e5a5b4870bd3ee2e3fb3f55523334425f Reviewed-by: Andy Shaw Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 7a68cdeb478..60b455bac9a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -257,6 +257,8 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qr } else { QWindowsContext::user32dll.setLayeredWindowAttributes(hwnd, 0, (int)(level * 255), LWA_ALPHA); } + } else if (IsWindowVisible(hwnd)) { // Repaint when switching from layered. + InvalidateRect(hwnd, NULL, TRUE); } #endif // !Q_OS_WINCE } From f9497b1a541627a6e2239a0c00b37307da6a93f2 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 4 Mar 2013 15:22:47 +0100 Subject: [PATCH 15/25] Fix spelling Change-Id: If3d5e09b2553d95caacd3e61a1bb108f1172111f Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qobject.cpp | 4 ++-- src/corelib/kernel/qobjectdefs_impl.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a82242939dd..36db55d25a6 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4194,7 +4194,7 @@ void qDeleteInEventHandler(QObject *o) connecting to a static function or a functor \a slot a pointer only used when using Qt::UniqueConnection \a type the Qt::ConnctionType passed as argument to connect - \a types an array of integer with the metatype id of the parametter of the signal + \a types an array of integer with the metatype id of the parameter of the signal to be used with queued connection must stay valid at least for the whole time of the connection, this function do not take ownership. typically static data. @@ -4209,7 +4209,7 @@ QMetaObject::Connection QObject::connectImpl(const QObject *sender, void **signa const int *types, const QMetaObject *senderMetaObject) { if (!sender || !signal || !slotObj || !senderMetaObject) { - qWarning("QObject::connect: invalid null parametter"); + qWarning("QObject::connect: invalid null parameter"); if (slotObj) slotObj->destroyIfLastRef(); return QMetaObject::Connection(); diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index 68d8fdf9612..1452e720ad0 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -59,7 +59,7 @@ namespace QtPrivate { /* The following List classes are used to help to handle the list of arguments. It follow the same principles as the lisp lists. - List_Left take a list and a number as a parametter and returns (via the Value typedef, + List_Left take a list and a number as a parameter and returns (via the Value typedef, the list composed of the first N element of the list */ #ifndef Q_COMPILER_VARIADIC_TEMPLATES @@ -113,7 +113,7 @@ namespace QtPrivate { - ArgumentCount is the number of argument, or -1 if it is unknown - the Object typedef is the Object of a pointer to member function - the Arguments typedef is the list of argument (in a QtPrivate::List) - - the Function typedef is an alias to the template parametter Func + - the Function typedef is an alias to the template parameter Func - the call(f,o,args) method is used to call that slot Args is the list of argument of the signal R is the return type of the signal From 342c99ff45c1e6ef524b6045571900fd7408d635 Mon Sep 17 00:00:00 2001 From: Roman Pasechnik Date: Mon, 18 Feb 2013 16:08:28 +0200 Subject: [PATCH 16/25] Fixed memory leak in QXmlStreamReader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed memory leak caused by repetitive usage of the same QXmlStreamReader instance. Task-number: QTBUG-27889 Change-Id: I673f4d26bae1503cb43e972f95b418dbf6d6fd89 Reviewed-by: Olivier Goffart Reviewed-by: Jędrzej Nowacki --- src/corelib/xml/qxmlstream.cpp | 2 ++ src/corelib/xml/qxmlstream_p.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 4be4593e95b..372b1d91fe2 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -784,6 +784,7 @@ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack() NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push(); namespaceDeclaration.prefix = addToStringStorage(QLatin1String("xml")); namespaceDeclaration.namespaceUri = addToStringStorage(QLatin1String("http://www.w3.org/XML/1998/namespace")); + initialTagStackStringStorageSize = tagStackStringStorageSize; } #ifndef QT_NO_XMLSTREAMREADER @@ -854,6 +855,7 @@ void QXmlStreamReaderPrivate::init() rawReadBuffer.clear(); dataBuffer.clear(); readBuffer.clear(); + tagStackStringStorageSize = initialTagStackStringStorageSize; type = QXmlStreamReader::NoToken; error = QXmlStreamReader::NoError; diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index 68b7ff7af34..448764ab58a 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -697,6 +697,7 @@ public: QXmlStreamSimpleStack namespaceDeclarations; QString tagStackStringStorage; int tagStackStringStorageSize; + int initialTagStackStringStorageSize; bool tagsDone; inline QStringRef addToStringStorage(const QStringRef &s) { From d903b2aac45652b015edcfaf9852b29c6c426c51 Mon Sep 17 00:00:00 2001 From: Irfan Omair Date: Fri, 1 Mar 2013 14:54:21 -0800 Subject: [PATCH 17/25] Avoid setting initialNameFilter when mode is Directory Task-number: QTBUG-30001 Change-Id: I5e854ce99137bd9d718cb2052f2c8dc1fb92b78f Reviewed-by: Andy Shaw Reviewed-by: Friedemann Kleint --- .../platforms/windows/qwindowsdialoghelpers.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 74193c47a33..28438dd53de 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1223,8 +1223,9 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog() // Apply settings. const QSharedPointer &opts = options(); + const QFileDialogOptions::FileMode mode = opts->fileMode(); result->setWindowTitle(opts->windowTitle()); - result->setMode(opts->fileMode(), opts->options()); + result->setMode(mode, opts->options()); result->setHideFiltersDetails(opts->testOption(QFileDialogOptions::HideNameFilterDetails)); const QStringList nameFilters = opts->nameFilters(); if (!nameFilters.isEmpty()) @@ -1242,9 +1243,12 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog() if (!info.isDir()) result->selectFile(info.fileName()); } - const QString initialNameFilter = opts->initiallySelectedNameFilter(); - if (!initialNameFilter.isEmpty()) - result->selectNameFilter(initialNameFilter); + // No need to select initialNameFilter if mode is Dir + if (mode != QFileDialogOptions::Directory && mode != QFileDialogOptions::DirectoryOnly) { + const QString initialNameFilter = opts->initiallySelectedNameFilter(); + if (!initialNameFilter.isEmpty()) + result->selectNameFilter(initialNameFilter); + } const QString defaultSuffix = opts->defaultSuffix(); if (!defaultSuffix.isEmpty()) result->setDefaultSuffix(defaultSuffix); From 80af20429715228a69122ee824a64108dfb53809 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Tue, 5 Mar 2013 02:33:29 +0000 Subject: [PATCH 18/25] Return -1 as the API documents it for socket issues Task-number: QTBUG-30024 Change-Id: I51498e6d74ab139134abfb94f35647e995319ee8 Reviewed-by: Thiago Macieira --- src/network/socket/qnativesocketengine.cpp | 10 +++++----- .../platformsocketengine/tst_platformsocketengine.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 6dbc25db4c5..02f78aeaed0 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -623,8 +623,8 @@ int QNativeSocketEngine::accept() { Q_D(QNativeSocketEngine); Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::accept(), -1); - Q_CHECK_STATE(QNativeSocketEngine::accept(), QAbstractSocket::ListeningState, false); - Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, false); + Q_CHECK_STATE(QNativeSocketEngine::accept(), QAbstractSocket::ListeningState, -1); + Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, -1); return d->nativeAccept(); } @@ -702,7 +702,7 @@ qint64 QNativeSocketEngine::bytesAvailable() const { Q_D(const QNativeSocketEngine); Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bytesAvailable(), -1); - Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, false); + Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, -1); return d->nativeBytesAvailable(); } @@ -732,7 +732,7 @@ qint64 QNativeSocketEngine::pendingDatagramSize() const { Q_D(const QNativeSocketEngine); Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::pendingDatagramSize(), -1); - Q_CHECK_TYPE(QNativeSocketEngine::pendingDatagramSize(), QAbstractSocket::UdpSocket, false); + Q_CHECK_TYPE(QNativeSocketEngine::pendingDatagramSize(), QAbstractSocket::UdpSocket, -1); return d->nativePendingDatagramSize(); } @@ -757,7 +757,7 @@ qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxSize, QHostAddres { Q_D(QNativeSocketEngine); Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::readDatagram(), -1); - Q_CHECK_TYPE(QNativeSocketEngine::readDatagram(), QAbstractSocket::UdpSocket, false); + Q_CHECK_TYPE(QNativeSocketEngine::readDatagram(), QAbstractSocket::UdpSocket, -1); return d->nativeReceiveDatagram(data, maxSize, address, port); } diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp index 50952237fac..40f22d6d1e4 100644 --- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp +++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp @@ -139,7 +139,7 @@ void tst_PlatformSocketEngine::construction() QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError); QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::bytesAvailable() was called in QAbstractSocket::UnconnectedState"); - QVERIFY(socketDevice.bytesAvailable() == 0); + QVERIFY(socketDevice.bytesAvailable() == -1); QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState"); QVERIFY(!socketDevice.hasPendingDatagrams()); From 8b10e8c198baa53f892c65d2e41c56df751ff7b8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 5 Mar 2013 10:52:16 +0100 Subject: [PATCH 19/25] qdoc: Maintain correct nesting level for QML parsing qdoc was not incrementing the nesting level when parsing a UiObjectBinding, which can contain a component definition. qdoc now increments the nesting level when starting to vidit a UiObjectBinding and decrements it when ending the visit. Note this fix does not stop qdoc from reporting that public signal handlers have not been documented. If that is to be changed, it will be done separately. Task-number: QTBUG-29993 Change-Id: Ibd5ef81082e989652b3a15dcc95080a2757e0077 Reviewed-by: J-P Nurmi --- src/tools/qdoc/qmlvisitor.cpp | 32 ++++++++++++++++++++++++++++---- src/tools/qdoc/qmlvisitor.h | 5 +++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index 8b6f81de3e9..058ab9a725b 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -424,8 +424,9 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition) */ void QmlDocVisitor::endVisit(QQmlJS::AST::UiObjectDefinition *definition) { - if (nestingLevel > 0) + if (nestingLevel > 0) { --nestingLevel; + } lastEndOffset = definition->lastSourceLocation().end(); } @@ -461,6 +462,26 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::UiImportList *definition) lastEndOffset = definition->lastSourceLocation().end(); } +bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectBinding *) +{ + ++nestingLevel; + return true; +} + +void QmlDocVisitor::endVisit(QQmlJS::AST::UiObjectBinding *) +{ + --nestingLevel; +} + +bool QmlDocVisitor::visit(QQmlJS::AST::UiArrayBinding *) +{ + return true; +} + +void QmlDocVisitor::endVisit(QQmlJS::AST::UiArrayBinding *) +{ +} + /*! Visits the public \a member declaration, which can be a signal or a property. It is a custom signal or property. @@ -468,8 +489,9 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::UiImportList *definition) */ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) { - if (nestingLevel > 1) + if (nestingLevel > 1) { return true; + } switch (member->type) { case QQmlJS::AST::UiPublicMember::Signal: { @@ -535,8 +557,9 @@ bool QmlDocVisitor::visit(QQmlJS::AST::IdentifierPropertyName *) */ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd) { - if (nestingLevel > 1) + if (nestingLevel > 1) { return true; + } if (current->type() == Node::Document) { QmlClassNode* qmlClass = static_cast(current); if (qmlClass) { @@ -581,8 +604,9 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::FunctionDeclaration* fd) */ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* sb) { - if (nestingLevel > 1) + if (nestingLevel > 1) { return true; + } if (current->type() == Node::Document) { QString handler = sb->qualifiedId->name.toString(); if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) { diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h index bfec61eb34c..cc00ccbe6ce 100644 --- a/src/tools/qdoc/qmlvisitor.h +++ b/src/tools/qdoc/qmlvisitor.h @@ -85,6 +85,11 @@ public: bool visit(QQmlJS::AST::UiPublicMember *member); void endVisit(QQmlJS::AST::UiPublicMember *definition); + virtual bool visit(QQmlJS::AST::UiObjectBinding *); + virtual void endVisit(QQmlJS::AST::UiObjectBinding *); + virtual void endVisit(QQmlJS::AST::UiArrayBinding *); + virtual bool visit(QQmlJS::AST::UiArrayBinding *); + bool visit(QQmlJS::AST::IdentifierPropertyName *idproperty); bool visit(QQmlJS::AST::FunctionDeclaration *); From f2162d04d23acd27ee641a07286f30f5581fe6bf Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 5 Mar 2013 12:37:37 +0100 Subject: [PATCH 20/25] Doc: fixed snippet issues with customcompleter.qdoc Edited customcompleter.qdoc (paths snippets + ingroup statement) Moved customcompleter.qdoc to widgets/tools/customcompleter/doc/src Moved png files to doc/qtwidgets/images Task-number: QTBUG-29101 Change-Id: Iab66f178b92321257c4eb0e4e9704bb1e3043ef6 Reviewed-by: Jerome Pasion Reviewed-by: Laszlo Papp --- .../doc/src/customcompleter.qdoc | 40 +++++++++--------- .../doc}/images/customcompleter-example.png | Bin .../customcompleter-insertcompletion.png | Bin 3 files changed, 21 insertions(+), 19 deletions(-) rename examples/{tools => widgets/tools/customcompleter}/doc/src/customcompleter.qdoc (86%) rename {doc/src => src/widgets/doc}/images/customcompleter-example.png (100%) rename {doc/src => src/widgets/doc}/images/customcompleter-insertcompletion.png (100%) diff --git a/examples/tools/doc/src/customcompleter.qdoc b/examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc similarity index 86% rename from examples/tools/doc/src/customcompleter.qdoc rename to examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc index f9ad3a43e9a..a6c425d4c8d 100644 --- a/examples/tools/doc/src/customcompleter.qdoc +++ b/examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. @@ -26,9 +26,11 @@ ****************************************************************************/ /*! - \example customcompleter + \example tools/customcompleter \title Custom Completer Example + \ingroup examples-widgets-tools + \brief The Custom Completer example shows how to provide string-completion facilities for an input widget based on data provided by a model. The completer pops up suggestions for possible words based on the first three @@ -43,7 +45,7 @@ that has a list of words to help QCompleter complete words. This file contains the following: - \quotefile customcompleter/customcompleter.qrc + \quotefile tools/customcompleter/customcompleter.qrc \section1 TextEdit Class Definition @@ -54,7 +56,7 @@ contains a private function \c textUnderCursor() and a private instance of QCompleter, \c c. - \snippet customcompleter/textedit.h 0 + \snippet tools/customcompleter/textedit.h 0 \section1 TextEdit Class Implementation @@ -63,11 +65,11 @@ the \c TextEdit object, using the \l{QTextEdit::setPlainText()}{setPlainText()} function. - \snippet customcompleter/textedit.cpp 0 + \snippet tools/customcompleter/textedit.cpp 0 In addition, \c TextEdit also includes a default destructor: - \snippet customcompleter/textedit.cpp 1 + \snippet tools/customcompleter/textedit.cpp 1 The \c setCompleter() function accepts a \a completer and sets it up. We use \c{if (c)} to check if \c c has been initialized. If it has been @@ -75,7 +77,7 @@ the signal from the slot. This is to ensure that no previous completer object is still connected to the slot. - \snippet customcompleter/textedit.cpp 2 + \snippet tools/customcompleter/textedit.cpp 2 We then instantiate \c c with \a completer and set it as \c{TextEdit}'s widget. The completion mode and case sensitivity are also set and then @@ -84,7 +86,7 @@ The \c completer() function is a getter function that returns \c c. - \snippet customcompleter/textedit.cpp 3 + \snippet tools/customcompleter/textedit.cpp 3 The completer pops up the options available, based on the contents of \e wordlist.txt, but the text cursor is responsible for filling in the @@ -99,7 +101,7 @@ completer's widget is \c TextEdit before using \c tc to insert the extra characters to complete the word. - \snippet customcompleter/textedit.cpp 4 + \snippet tools/customcompleter/textedit.cpp 4 The figure below illustrates this process: @@ -116,13 +118,13 @@ The \c textUnderCursor() function uses a QTextCursor, \c tc, to select a word under the cursor and return it. - \snippet customcompleter/textedit.cpp 5 + \snippet tools/customcompleter/textedit.cpp 5 The \c TextEdit class reimplements \l{QWidget::focusInEvent()} {focusInEvent()} function, which is an event handler used to receive keyboard focus events for the widget. - \snippet customcompleter/textedit.cpp 6 + \snippet tools/customcompleter/textedit.cpp 6 The \l{QAbstractScrollArea::keyPressEvent()}{keyPressEvent()} is reimplemented to ignore key events like Qt::Key_Enter, Qt::Key_Return, @@ -131,12 +133,12 @@ If there is an active completer, we cannot process the shortcut, Ctrl+E. - \snippet customcompleter/textedit.cpp 7 + \snippet tools/customcompleter/textedit.cpp 7 We also handle other modifiers and shortcuts for which we do not want the completer to respond to. - \snippet customcompleter/textedit.cpp 8 + \snippet tools/customcompleter/textedit.cpp 8 Finally, we pop up the completer. @@ -147,7 +149,7 @@ \c createMenu() and \c modelFromFile() as well as private instances of QCompleter and \c TextEdit. - \snippet customcompleter/mainwindow.h 0 + \snippet tools/customcompleter/mainwindow.h 0 \section1 MainWindow Class Implementation @@ -157,31 +159,31 @@ to populate the \c completer. The \c{MainWindow}'s central widget is set to \c TextEdit and its size is set to 500 x 300. - \snippet customcompleter/mainwindow.cpp 0 + \snippet tools/customcompleter/mainwindow.cpp 0 The \c createMenu() function creates the necessary QAction objects needed for the "File" and "Help" menu and their \l{QAction::triggered()} {triggered()} signals are connected to the \c quit(), \c about(), and \c aboutQt() slots respectively. - \snippet customcompleter/mainwindow.cpp 1 + \snippet tools/customcompleter/mainwindow.cpp 1 The \c modelFromFile() function accepts a \a fileName and attempts to extract the contents of this file into a QStringListModel. We display the Qt::WaitCursor when we are populating the QStringList, \c words, and restore the mouse cursor when we are done. - \snippet customcompleter/mainwindow.cpp 2 + \snippet tools/customcompleter/mainwindow.cpp 2 The \c about() function provides a brief description about the Custom Completer example. - \snippet customcompleter/mainwindow.cpp 3 + \snippet tools/customcompleter/mainwindow.cpp 3 \section1 \c main() Function The \c main() function instantiates \c MainWindow and invokes the \l{QWidget::show()}{show()} function. - \snippet customcompleter/main.cpp 0 + \snippet tools/customcompleter/main.cpp 0 */ diff --git a/doc/src/images/customcompleter-example.png b/src/widgets/doc/images/customcompleter-example.png similarity index 100% rename from doc/src/images/customcompleter-example.png rename to src/widgets/doc/images/customcompleter-example.png diff --git a/doc/src/images/customcompleter-insertcompletion.png b/src/widgets/doc/images/customcompleter-insertcompletion.png similarity index 100% rename from doc/src/images/customcompleter-insertcompletion.png rename to src/widgets/doc/images/customcompleter-insertcompletion.png From 15768381ad5f6b7f094e8a90dabeff97a9d62b88 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Tue, 5 Mar 2013 17:58:24 +0100 Subject: [PATCH 21/25] Delete the reference of the QNX screen in child windows on deletion Change-Id: Ic3e5deaeabe282ff44400aba80f8746067473030 Reviewed-by: Kevin Krammer Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxscreen.cpp | 2 ++ src/plugins/platforms/qnx/qqnxwindow.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index fc8b3bb167a..dfd7ccf0cc2 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -151,6 +151,8 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, QQnxScreen::~QQnxScreen() { qScreenDebug() << Q_FUNC_INFO; + Q_FOREACH (QQnxWindow *childWindow, m_childWindows) + childWindow->setScreen(0); delete m_cursor; } diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 43e24034c99..cabbd405e50 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -156,7 +156,8 @@ QQnxWindow::~QQnxWindow() // Remove from parent's Hierarchy. removeFromParent(); - m_screen->updateHierarchy(); + if (m_screen) + m_screen->updateHierarchy(); // Cleanup QNX window and its buffers screen_destroy_window(m_window); @@ -497,6 +498,11 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen) { qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "platformScreen =" << platformScreen; + if (platformScreen == 0) { // The screen has been destroyed + m_screen = 0; + return; + } + if (m_screen == platformScreen) return; @@ -539,7 +545,7 @@ void QQnxWindow::removeFromParent() m_parentWindow = 0; else qFatal("QQnxWindow: Window Hierarchy broken; window has parent, but parent hasn't got child."); - } else { + } else if (m_screen) { m_screen->removeWindow(this); } } From 4f60ff6ad3e89696cfe9550b0e05de779163d677 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Sun, 3 Mar 2013 15:54:58 +0100 Subject: [PATCH 22/25] Do not build qsharedmemory and qsystemsemaphore autotests on QNX QSharedMemory and QSystemSemaphore are not available on QNX so the autotests can not be built. Change-Id: Ibfb405f951d21342d64bf215cedc203a8cefe070 Reviewed-by: Wolfgang Bremer Reviewed-by: Thomas McGuire Reviewed-by: Thiago Macieira --- tests/auto/corelib/kernel/kernel.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro index 839d652be13..57d52117c79 100644 --- a/tests/auto/corelib/kernel/kernel.pro +++ b/tests/auto/corelib/kernel/kernel.pro @@ -28,3 +28,4 @@ SUBDIRS=\ # This test is only applicable on Windows !win32*:SUBDIRS -= qwineventnotifier +qnx: SUBDIRS -= qsharedmemory qsystemsemaphore From 56820382f26069ea81444da075e6cbefc8f03765 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Sun, 3 Mar 2013 15:06:40 +0100 Subject: [PATCH 23/25] Workaround a bug in mktime on QNX Under certain circumstances, mktime failes to convert the tm struct into secs since epoch. This is a workaround and fixes the qdatetime and qqmllocale autotests. Change-Id: If99385142a049c5315429dca177df7fc8e947d55 Reviewed-by: Thomas McGuire Reviewed-by: Wolfgang Bremer Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 4b6e7397598..88f22daad59 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4050,6 +4050,16 @@ static void localToUtc(QDate &date, QTime &time, int isdst) _tzset(); #endif time_t secsSince1Jan1970UTC = mktime(&localTM); +#ifdef Q_OS_QNX + //mktime sometimes fails on QNX. Following workaround converts the date and time then manually + if (secsSince1Jan1970UTC == (time_t)-1) { + QDateTime tempTime = QDateTime(date, time, Qt::UTC);; + tempTime = tempTime.addMSecs(timezone * 1000); + date = tempTime.date(); + time = tempTime.time(); + return; + } +#endif #endif tm *brokenDown = 0; #if defined(Q_OS_WINCE) From d8e784f47e2d6e85680455e088e7348b9f6b376c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 4 Mar 2013 23:55:52 +0100 Subject: [PATCH 24/25] Fix potential crash in accessibility key event handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id3eec6c83d7f8ece186e6b5bc02771c00893294b Reviewed-by: Jan Arve Sæther --- .../linuxaccessibility/application.cpp | 14 ++++++++------ .../linuxaccessibility/application_p.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/platformsupport/linuxaccessibility/application.cpp b/src/platformsupport/linuxaccessibility/application.cpp index 6e826e44328..5c8f2e5fe24 100644 --- a/src/platformsupport/linuxaccessibility/application.cpp +++ b/src/platformsupport/linuxaccessibility/application.cpp @@ -174,7 +174,7 @@ bool QSpiApplicationAdaptor::eventFilter(QObject *target, QEvent *event) SLOT(notifyKeyboardListenerError(QDBusError, QDBusMessage)), timeout); if (sent) { //queue the event and send it after callback - keyEvents.enqueue(QPair (target, copyKeyEvent(keyEvent))); + keyEvents.enqueue(QPair, QKeyEvent*> (QPointer(target), copyKeyEvent(keyEvent))); #ifdef KEYBOARD_DEBUG qDebug() << QStringLiteral("Sent key: ") << de.text; #endif @@ -200,11 +200,12 @@ void QSpiApplicationAdaptor::notifyKeyboardListenerCallback(const QDBusMessage& } Q_ASSERT(message.arguments().length() == 1); if (message.arguments().at(0).toBool() == true) { - QPair event = keyEvents.dequeue(); + QPair, QKeyEvent*> event = keyEvents.dequeue(); delete event.second; } else { - QPair event = keyEvents.dequeue(); - QCoreApplication::postEvent(event.first, event.second); + QPair, QKeyEvent*> event = keyEvents.dequeue(); + if (event.first) + QCoreApplication::postEvent(event.first.data(), event.second); } } @@ -212,8 +213,9 @@ void QSpiApplicationAdaptor::notifyKeyboardListenerError(const QDBusError& error { qWarning() << QStringLiteral("QSpiApplication::keyEventError ") << error.name() << error.message(); while (!keyEvents.isEmpty()) { - QPair event = keyEvents.dequeue(); - QCoreApplication::postEvent(event.first, event.second); + QPair, QKeyEvent*> event = keyEvents.dequeue(); + if (event.first) + QCoreApplication::postEvent(event.first.data(), event.second); } } diff --git a/src/platformsupport/linuxaccessibility/application_p.h b/src/platformsupport/linuxaccessibility/application_p.h index 9b6763f1118..754d98495a5 100644 --- a/src/platformsupport/linuxaccessibility/application_p.h +++ b/src/platformsupport/linuxaccessibility/application_p.h @@ -42,6 +42,7 @@ #ifndef Q_SPI_APPLICATION_H #define Q_SPI_APPLICATION_H +#include #include #include #include @@ -76,7 +77,7 @@ private Q_SLOTS: private: static QKeyEvent* copyKeyEvent(QKeyEvent*); - QQueue > keyEvents; + QQueue, QKeyEvent*> > keyEvents; QDBusConnection dbusConnection; }; From 31c5b34e808db102bfc5364405711ec94fe51f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Tue, 5 Mar 2013 14:30:26 +0100 Subject: [PATCH 25/25] Silence warning about an unused variable in Q_ASSUME. Change-Id: Ia7dd537d1f0dadb1dc41b8123fda0da82e83598b Reviewed-by: Olivier Goffart --- src/corelib/global/qcompilerdetection.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index d062ea0d158..15229e03a0f 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -862,6 +862,7 @@ const bool valueOfExpression = Expr;\ Q_ASSERT_X(valueOfExpression, "Q_ASSUME()", "Assumption in Q_ASSUME(\"" #Expr "\") was not correct");\ Q_ASSUME_IMPL(valueOfExpression);\ + Q_UNUSED(valueOfExpression); /* the value may not be used if Q_ASSERT_X and Q_ASSUME_IMPL are noop */\ } while (0) #endif // QCOMPILERDETECTION_H