From 55cf7c577da015bd6d48a034902477b83cf73be7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 27 Feb 2013 17:21:11 +0100 Subject: 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(-) (limited to 'src') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index d1d80f5af0..4b6ba17595 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(); -- cgit v1.2.3 From 9fbecf11c7c5f7c059d6ba84c3da1458eaee608d Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Tue, 11 Dec 2012 16:10:01 -0200 Subject: 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 (limited to 'src') diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro index 8367513fc5..203cdebda9 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 0000000000..4fdff666d7 --- /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 0000000000..5d6a8b2c30 --- /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 1e58f047ab..fc8b3bb167 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 2851c13c52..39cd4159d1 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 4412bb34bd..2d3c7608bf 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]; -- cgit v1.2.3 From 84a1493b509994901cb336c93378b80ed82b6a2a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 16 Apr 2012 08:25:23 +0200 Subject: 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(-) (limited to 'src') diff --git a/src/corelib/doc/src/objectmodel/object.qdoc b/src/corelib/doc/src/objectmodel/object.qdoc index 281c1a30cb..1d33c14d0f 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 -- cgit v1.2.3 From c82b0815ec80b3750a110d47c68142bb448ddf56 Mon Sep 17 00:00:00 2001 From: Matt Fischer Date: Thu, 28 Feb 2013 10:52:12 -0600 Subject: 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(-) (limited to 'src') diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 5ad77ddf95..2e4119ba93 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 -- cgit v1.2.3 From 3ef2daf6ceb0b6736081b8b72f482e5228d44bc1 Mon Sep 17 00:00:00 2001 From: Irfan Omair Date: Tue, 26 Feb 2013 12:08:52 -0800 Subject: 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(+) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.h b/src/plugins/platforms/windows/qwindowsmousehandler.h index b3bfa03380..caf30e6b1a 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; } -- cgit v1.2.3 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: 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(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 2adf0d24a1..0091028896 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 -- cgit v1.2.3 From f2e8a81227b3ee09afe1bf8a5d292e8c5f2ee67f Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 21 Feb 2013 12:11:35 +0100 Subject: 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp index d8b7a02a1b..a5f5a326d4 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); } } -- cgit v1.2.3 From a496b5dc38c96465e6ea4750ef293d8f2c3b6fc5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Jan 2013 17:44:54 -0800 Subject: 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(-) (limited to 'src') diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index a0a2e51198..e20e85028f 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 95ba6d28bf..47ebded1b1 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; -- cgit v1.2.3 From 8c8e9f59bcbf6ce394b9ae081988f3d294438acd Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 24 Jan 2013 16:41:24 +0100 Subject: 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(-) (limited to 'src') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 2a2e30634a..f4a2059d74 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 5ec713140e..f82d33f283 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); -- cgit v1.2.3 From 7ed41b0e542b725c06405d837a8d6b8c10269645 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 28 Feb 2013 13:42:58 +0100 Subject: 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(-) (limited to 'src') diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index f2babe41a4..6e40bbfa15 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: -- cgit v1.2.3 From c0c38912ebf0640ddae71f507bed6cc0b8c82fe6 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 4 Mar 2013 12:37:44 +0100 Subject: 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(-) (limited to 'src') diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index 58c674de7a..191da5caf8 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; } -- cgit v1.2.3 From bc741b867cbff58f59c2698d22a37121ebcc6c50 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 1 Mar 2013 13:37:51 +0100 Subject: 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(+) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 7a68cdeb47..60b455bac9 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 } -- cgit v1.2.3 From f9497b1a541627a6e2239a0c00b37307da6a93f2 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 4 Mar 2013 15:22:47 +0100 Subject: 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(-) (limited to 'src') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a82242939d..36db55d25a 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 68d8fdf961..1452e720ad 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 -- cgit v1.2.3 From 342c99ff45c1e6ef524b6045571900fd7408d635 Mon Sep 17 00:00:00 2001 From: Roman Pasechnik Date: Mon, 18 Feb 2013 16:08:28 +0200 Subject: 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(+) (limited to 'src') diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 4be4593e95..372b1d91fe 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 68b7ff7af3..448764ab58 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) { -- cgit v1.2.3 From d903b2aac45652b015edcfaf9852b29c6c426c51 Mon Sep 17 00:00:00 2001 From: Irfan Omair Date: Fri, 1 Mar 2013 14:54:21 -0800 Subject: Avoid setting initialNameFilter when mode is Directory Task-number: QTBUG-30001 Change-Id: I5e854ce99137bd9d718cb2052f2c8dc1fb92b78f Reviewed-by: Andy Shaw Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 74193c47a3..28438dd53d 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); -- cgit v1.2.3 From 80af20429715228a69122ee824a64108dfb53809 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Tue, 5 Mar 2013 02:33:29 +0000 Subject: 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 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 6dbc25db4c..02f78aeaed 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); } -- cgit v1.2.3 From 8b10e8c198baa53f892c65d2e41c56df751ff7b8 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 5 Mar 2013 10:52:16 +0100 Subject: 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(-) (limited to 'src') diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index 8b6f81de3e..058ab9a725 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 bfec61eb34..cc00ccbe6c 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 *); -- cgit v1.2.3 From f2162d04d23acd27ee641a07286f30f5581fe6bf Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 5 Mar 2013 12:37:37 +0100 Subject: 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 --- src/widgets/doc/images/customcompleter-example.png | Bin 0 -> 11636 bytes .../doc/images/customcompleter-insertcompletion.png | Bin 0 -> 1371 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/widgets/doc/images/customcompleter-example.png create mode 100644 src/widgets/doc/images/customcompleter-insertcompletion.png (limited to 'src') diff --git a/src/widgets/doc/images/customcompleter-example.png b/src/widgets/doc/images/customcompleter-example.png new file mode 100644 index 0000000000..a525208118 Binary files /dev/null and b/src/widgets/doc/images/customcompleter-example.png differ diff --git a/src/widgets/doc/images/customcompleter-insertcompletion.png b/src/widgets/doc/images/customcompleter-insertcompletion.png new file mode 100644 index 0000000000..0bb2c25c39 Binary files /dev/null and b/src/widgets/doc/images/customcompleter-insertcompletion.png differ -- cgit v1.2.3 From 15768381ad5f6b7f094e8a90dabeff97a9d62b88 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Tue, 5 Mar 2013 17:58:24 +0100 Subject: 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(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index fc8b3bb167..dfd7ccf0cc 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 43e24034c9..cabbd405e5 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); } } -- cgit v1.2.3 From 56820382f26069ea81444da075e6cbefc8f03765 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Sun, 3 Mar 2013 15:06:40 +0100 Subject: 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(+) (limited to 'src') diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 4b6e739759..88f22daad5 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) -- cgit v1.2.3 From d8e784f47e2d6e85680455e088e7348b9f6b376c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 4 Mar 2013 23:55:52 +0100 Subject: 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 --- src/platformsupport/linuxaccessibility/application.cpp | 14 ++++++++------ src/platformsupport/linuxaccessibility/application_p.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/platformsupport/linuxaccessibility/application.cpp b/src/platformsupport/linuxaccessibility/application.cpp index 6e826e4432..5c8f2e5fe2 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 9b6763f111..754d98495a 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; }; -- cgit v1.2.3 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: 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(+) (limited to 'src') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index d062ea0d15..15229e03a0 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 -- cgit v1.2.3