From add4d83be92f332246adf851d89c27b60b4737dc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 4 Dec 2009 16:57:36 +0100 Subject: Doc: Added links to missing examples and placeholder documentation. Reviewed-by: Trust Me --- doc/src/examples/fademessage.qdoc | 10 +++++++++- doc/src/getting-started/examples.qdoc | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/doc/src/examples/fademessage.qdoc b/doc/src/examples/fademessage.qdoc index ecea095..6063fa7 100644 --- a/doc/src/examples/fademessage.qdoc +++ b/doc/src/examples/fademessage.qdoc @@ -43,5 +43,13 @@ \example effects/fademessage \title Fade Message Effect Example - \image fademessageeffect-example.png + \raw HTML +
+ \endraw + \inlineimage fademessageeffect-example.png + \inlineimage fademessageeffect-example-faded.png + \raw HTML +
+ \endraw + */ diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index f0a6799..2d4f5c9 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -546,6 +546,14 @@ \o \l{graphicsview/portedcanvas}{Ported Canvas} \endlist + Some examples demonstrate the use of graphics effects with canvas items. + + \list + \o \l{effects/blurpicker}{Blur Picker Effect} + \o \l{effects/fademessage}{Fade Message Effect} + \o \l{effects/lighting}{Lighting Effect} + \endlist + Examples marked with an asterisk (*) are fully documented. */ @@ -851,11 +859,13 @@ \section1 Multimedia - Qt provides low-level audio support on linux,windows and mac platforms by default and - an audio plugin API to allow developers to implement there own audio support for + Qt provides low-level audio support on Linux, Windows and Mac OS X by default and + an audio plugin API to allow developers to implement their own audio support for custom devices and platforms. - These examples demonstrate the basic techniques used to take advantage of + \section1 Audio Handling + + These examples demonstrate the basic techniques used to take advantage of the Audio API in Qt applications. \list -- cgit v0.12 From 4b09e47add266c44b15bd3748cf2ef948b8512fb Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 4 Dec 2009 16:58:55 +0100 Subject: Doc: Whitespace fix. Reviewed-by: Trust Me --- doc/src/modules.qdoc | 91 ++++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 3058b84..5e759db 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -409,59 +409,58 @@ */ /*! - \module QtSvg - \title QtSvg Module - \since 4.1 - \contentspage All Qt Modules - \previouspage QtSql - \nextpage QtWebKit - \ingroup modules + \module QtSvg + \title QtSvg Module + \since 4.1 + \contentspage All Qt Modules + \previouspage QtSql + \nextpage QtWebKit + \ingroup modules - \brief The QtSvg module provides classes for displaying the contents of SVG - files. + \brief The QtSvg module provides classes for displaying and creating SVG files. - To include the definitions of the module's classes, use the - following directive: + To include the definitions of the module's classes, use the + following directive: - \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 0 + \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 0 - To link against the module, add this line to your \l qmake \c - .pro file: + To link against the module, add this line to your \l qmake \c + .pro file: - \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 1 + \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 1 - The QtSvg module is part of the \l{Qt Full Framework Edition} and the - \l{Open Source Versions of Qt}. + The QtSvg module is part of the \l{Qt Full Framework Edition} and the + \l{Open Source Versions of Qt}. - \section1 License Information - - Some code for arc handling in this module is derived from code with - the following license: - - \legalese - Copyright 2002 USC/Information Sciences Institute - - Permission to use, copy, modify, distribute, and sell this software - and its documentation for any purpose is hereby granted without - fee, provided that the above copyright notice appear in all copies - and that both that copyright notice and this permission notice - appear in supporting documentation, and that the name of - Information Sciences Institute not be used in advertising or - publicity pertaining to distribution of the software without - specific, written prior permission. Information Sciences Institute - makes no representations about the suitability of this software for - any purpose. It is provided "as is" without express or implied - warranty. - - INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD - TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES - INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - \endlegalese + \section1 License Information + + Some code for arc handling in this module is derived from code with + the following license: + + \legalese + Copyright 2002 USC/Information Sciences Institute + + Permission to use, copy, modify, distribute, and sell this software + and its documentation for any purpose is hereby granted without + fee, provided that the above copyright notice appear in all copies + and that both that copyright notice and this permission notice + appear in supporting documentation, and that the name of + Information Sciences Institute not be used in advertising or + publicity pertaining to distribution of the software without + specific, written prior permission. Information Sciences Institute + makes no representations about the suitability of this software for + any purpose. It is provided "as is" without express or implied + warranty. + + INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD + TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES + INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + \endlegalese */ /*! -- cgit v0.12 From 8577da4a70be7400b1dc7d2265a31de46f8e8bb9 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 4 Dec 2009 16:59:25 +0100 Subject: Doc: Fixed license information as requested by Legal. Reviewed-by: Trust Me --- doc/src/frameworks-technologies/dnd.qdoc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/src/frameworks-technologies/dnd.qdoc b/doc/src/frameworks-technologies/dnd.qdoc index a7b1622..65fddfb 100644 --- a/doc/src/frameworks-technologies/dnd.qdoc +++ b/doc/src/frameworks-technologies/dnd.qdoc @@ -426,6 +426,7 @@ \legalese Copyright 1996 Daniel Dardailler. + Copyright 1999 Matt Koss Permission to use, copy, modify, distribute, and sell this software for any purpose is hereby granted without fee, provided that the above @@ -436,13 +437,11 @@ written prior permission. Daniel Dardailler makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. - - Modifications Copyright 1999 Matt Koss, under the same license as - above. \endlegalese - \omit NOTE: The copyright notice is from qmotifdnd_x11.cpp. \endomit + \omit NOTE: The original version of this copyright notice can be found + in qmotifdnd_x11.cpp. \endomit - Note: The Motif Drag \& Drop Protocol only allows receivers to + \note The Motif Drag \& Drop Protocol only allows receivers to request data in response to a QDropEvent. If you attempt to request data in response to e.g. a QDragMoveEvent, an empty QByteArray is returned. -- cgit v0.12 From 74b0c482b1edf606e1326c9053c612a7e514dee4 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 7 Dec 2009 15:59:20 +0100 Subject: Doc: Fixed references to "old" 2.x and "new" 3.x font name conventions. Reviewed-by: Trust Me As-reported-by: Eskil --- src/gui/text/qfontdatabase.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 7e93aa0..e9c7b89 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1482,13 +1482,13 @@ QString QFontDatabase::styleString(const QFontInfo &fontInfo) and style will look attractive. If the font family is available from two or more foundries the - foundry name is included in the family name, e.g. "Helvetica - [Adobe]" and "Helvetica [Cronyx]". When you specify a family you - can either use the old hyphenated Qt 2.x "foundry-family" format, - e.g. "Cronyx-Helvetica", or the new bracketed Qt 3.x "family - [foundry]" format e.g. "Helvetica [Cronyx]". If the family has a - foundry it is always returned, e.g. by families(), using the - bracketed format. + foundry name is included in the family name; for example: + "Helvetica [Adobe]" and "Helvetica [Cronyx]". When you specify a + family, you can either use the old hyphenated "foundry-family" + format or the bracketed "family [foundry]" format; for example: + "Cronyx-Helvetica" or "Helvetica [Cronyx]". If the family has a + foundry it is always returned using the bracketed format, as is + the case with the value returned by families(). The font() function returns a QFont given a family, style and point size. -- cgit v0.12 From 970f19bdb55cd559e9ef97228d30fd52b20e39cb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 8 Dec 2009 20:28:45 +0100 Subject: Fix crash in QDBusPendingReply/QDBusReply in case of unconnected calls. If we made calls on a QDBusConnection that isn't connected, the d pointer is 0. Ensure we don't crash. Task-number: QTBUG-6571 Reviewed-by: Bradley T. Hughes --- src/dbus/qdbuspendingcall.cpp | 2 +- src/dbus/qdbuspendingreply.h | 1 + .../qdbuspendingreply/tst_qdbuspendingreply.cpp | 25 ++++++++++++++++++++++ tests/auto/qdbusreply/tst_qdbusreply.cpp | 16 ++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index d10179e..d8eb53e 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -310,7 +310,7 @@ QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other) bool QDBusPendingCall::isFinished() const { - return d && (d->replyMessage.type() != QDBusMessage::InvalidMessage); + return !d || (d->replyMessage.type() != QDBusMessage::InvalidMessage); } void QDBusPendingCall::waitForFinished() diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index b7f54e4..4f90c98 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -188,6 +188,7 @@ public: private: inline void calculateMetaTypes() { + if (!d) return; int typeIds[Count > 0 ? Count : 1]; // use at least one since zero-sized arrays aren't valid ForEach::fillMetaTypes(typeIds); setMetaTypes(Count, typeIds); diff --git a/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp b/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp index 6398d9c..82e6389 100644 --- a/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp +++ b/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp @@ -93,6 +93,7 @@ private slots: } void init(); + void unconnected(); void simpleTypes(); void complexTypes(); void wrongTypes(); @@ -252,6 +253,30 @@ void tst_QDBusPendingReply::init() QVERIFY(iface->isValid()); } +void tst_QDBusPendingReply::unconnected() +{ + QDBusConnection con("invalid stored connection"); + QVERIFY(!con.isConnected()); + QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con); + QVERIFY(!iface.isValid()); + + QDBusPendingReply<> rvoid = iface.asyncCall("ReloadConfig"); + QVERIFY(rvoid.isFinished()); + QVERIFY(!rvoid.isValid()); + QVERIFY(rvoid.isError()); + rvoid.waitForFinished(); + QVERIFY(!rvoid.isValid()); + QVERIFY(rvoid.isError()); + + QDBusPendingReply rstring = iface.asyncCall("GetId"); + QVERIFY(rstring.isFinished()); + QVERIFY(!rstring.isValid()); + QVERIFY(rstring.isError()); + rstring.waitForFinished(); + QVERIFY(!rstring.isValid()); + QVERIFY(rstring.isError()); +} + void tst_QDBusPendingReply::simpleTypes() { QDBusPendingReply<> rvoid = iface->asyncCall("retrieveVoid"); diff --git a/tests/auto/qdbusreply/tst_qdbusreply.cpp b/tests/auto/qdbusreply/tst_qdbusreply.cpp index 9866302..e36d288 100644 --- a/tests/auto/qdbusreply/tst_qdbusreply.cpp +++ b/tests/auto/qdbusreply/tst_qdbusreply.cpp @@ -93,6 +93,7 @@ private slots: } void init(); + void unconnected(); void simpleTypes(); void complexTypes(); void wrongTypes(); @@ -236,6 +237,21 @@ void tst_QDBusReply::init() QVERIFY(iface->isValid()); } +void tst_QDBusReply::unconnected() +{ + QDBusConnection con("invalid stored connection"); + QVERIFY(!con.isConnected()); + QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con); + QVERIFY(!iface.isValid()); + + QDBusReply rvoid = iface.asyncCall("ReloadConfig"); + QVERIFY(!rvoid.isValid()); + + QDBusReply rstring = iface.asyncCall("GetId"); + QVERIFY(!rstring.isValid()); + QVERIFY(rstring.value().isEmpty()); +} + void tst_QDBusReply::simpleTypes() { QDBusReply rbool = iface->call(QDBus::BlockWithGui, "retrieveBool"); -- cgit v0.12 From 9fd117106c4c18fc5299816ab62cdaeb574b608d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 9 Dec 2009 13:36:52 +0100 Subject: Fix crash in QFontDialog::getFont() on Mac 10.4 [NSFontManager setTarget] is not available on 10.4. Rev-by: Richard Moe Gustavsen --- src/gui/dialogs/qfontdialog_mac.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm index dacb54c..b9f918f 100644 --- a/src/gui/dialogs/qfontdialog_mac.mm +++ b/src/gui/dialogs/qfontdialog_mac.mm @@ -394,7 +394,9 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) } [mFontPanel setDelegate:nil]; [[NSFontManager sharedFontManager] setDelegate:nil]; +#ifdef QT_MAC_USE_COCOA [[NSFontManager sharedFontManager] setTarget:nil]; +#endif } @end @@ -518,7 +520,9 @@ void *QFontDialogPrivate::openCocoaFontPanel(const QFont &initial, extraHeight:dialogExtraHeight]; [ourPanel setDelegate:delegate]; [[NSFontManager sharedFontManager] setDelegate:delegate]; +#ifdef QT_MAC_USE_COCOA [[NSFontManager sharedFontManager] setTarget:delegate]; +#endif setFont(delegate, initial); // hack to get correct initial layout -- cgit v0.12 From 1bbb6e4db246d7be69a7592e2e700f79d7858d5a Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Thu, 10 Sep 2009 08:49:56 +0200 Subject: Add a mkspec for selecting gcc-4.0 on Mac OS X. This has one known use case: compiling with the 10.4u SDKi on 10.6. (cherry picked from commit 855f1705ceb15c303b55fcced8b0303d90352a44) --- mkspecs/macx-g++40/Info.plist.app | 20 ++++++ mkspecs/macx-g++40/Info.plist.lib | 18 +++++ mkspecs/macx-g++40/qmake.conf | 20 ++++++ mkspecs/macx-g++40/qplatformdefs.h | 132 +++++++++++++++++++++++++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 mkspecs/macx-g++40/Info.plist.app create mode 100644 mkspecs/macx-g++40/Info.plist.lib create mode 100644 mkspecs/macx-g++40/qmake.conf create mode 100644 mkspecs/macx-g++40/qplatformdefs.h diff --git a/mkspecs/macx-g++40/Info.plist.app b/mkspecs/macx-g++40/Info.plist.app new file mode 100644 index 0000000..393b615 --- /dev/null +++ b/mkspecs/macx-g++40/Info.plist.app @@ -0,0 +1,20 @@ + + + + + CFBundleIconFile + @ICON@ + CFBundlePackageType + APPL + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + @TYPEINFO@ + CFBundleExecutable + @EXECUTABLE@ + CFBundleIdentifier + com.yourcompany.@EXECUTABLE@ + NOTE + This file was generated by Qt/QMake. + + diff --git a/mkspecs/macx-g++40/Info.plist.lib b/mkspecs/macx-g++40/Info.plist.lib new file mode 100644 index 0000000..97609ed --- /dev/null +++ b/mkspecs/macx-g++40/Info.plist.lib @@ -0,0 +1,18 @@ + + + + + CFBundlePackageType + FMWK + CFBundleShortVersionString + @SHORT_VERSION@ + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + @TYPEINFO@ + CFBundleExecutable + @LIBRARY@ + NOTE + Please, do NOT change this file -- It was generated by Qt/QMake. + + diff --git a/mkspecs/macx-g++40/qmake.conf b/mkspecs/macx-g++40/qmake.conf new file mode 100644 index 0000000..d6fd09d --- /dev/null +++ b/mkspecs/macx-g++40/qmake.conf @@ -0,0 +1,20 @@ +#macx-g++ (different from g++.conf) + +# +# qmake configuration for macx-g++ +# +# Mac OS X + command-line compiler +# + +MAKEFILE_GENERATOR = UNIX +TEMPLATE = app +CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +QMAKE_CC = gcc-4.0 +QMAKE_CXX = g++-4.0 + +include(../common/mac-g++.conf) + +load(qt_config) diff --git a/mkspecs/macx-g++40/qplatformdefs.h b/mkspecs/macx-g++40/qplatformdefs.h new file mode 100644 index 0000000..98e5eaf --- /dev/null +++ b/mkspecs/macx-g++40/qplatformdefs.h @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include + + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include +#include +#include +#include +#include +#include +#define QT_NO_LIBRARY_UNLOAD + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +#define QT_FOPEN ::fopen +#define QT_FSEEK ::fseeko +#define QT_FTELL ::ftello +#define QT_FGETPOS ::fgetpos +#define QT_FSETPOS ::fsetpos +#define QT_FPOS_T fpos_t +#define QT_OFF_T off_t + +#define QT_STATBUF struct stat +#define QT_STATBUF4TSTAT struct stat +#define QT_STAT ::stat +#define QT_FSTAT ::fstat +#define QT_LSTAT ::lstat +#define QT_STAT_REG S_IFREG +#define QT_STAT_DIR S_IFDIR +#define QT_STAT_MASK S_IFMT +#define QT_STAT_LNK S_IFLNK +#define QT_SOCKET_CONNECT ::connect +#define QT_SOCKET_BIND ::bind +#define QT_FILENO fileno +#define QT_OPEN ::open +#define QT_CLOSE ::close +#define QT_TRUNCATE ::truncate +#define QT_FTRUNCATE ::ftruncate +#define QT_LSEEK ::lseek +#define QT_READ ::read +#define QT_WRITE ::write +#define QT_ACCESS ::access +#define QT_GETCWD ::getcwd +#define QT_CHDIR ::chdir +#define QT_MKDIR ::mkdir +#define QT_RMDIR ::rmdir +#define QT_OPEN_LARGEFILE 0 +#define QT_OPEN_RDONLY O_RDONLY +#define QT_OPEN_WRONLY O_WRONLY +#define QT_OPEN_RDWR O_RDWR +#define QT_OPEN_CREAT O_CREAT +#define QT_OPEN_TRUNC O_TRUNC +#define QT_OPEN_APPEND O_APPEND + +#define QT_SIGNAL_RETTYPE void +#define QT_SIGNAL_ARGS int +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + + +#endif // QPLATFORMDEFS_H -- cgit v0.12 From 0f18542566e72efc09a21c7f69927159d7ca2df5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 14 Dec 2009 12:51:25 +0100 Subject: doc: Fixed erroneous qdoc error message. qdoc reported a "No documentation" error for images used in examples, but these images aren't supposed to have documentation. Task-number: QTBUG-4484 --- tools/qdoc3/generator.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 9389268..95319ca 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -323,7 +323,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) const FakeNode *fake = static_cast(node); if (fake->subType() == Node::Example) generateExampleFiles(fake, marker); - else if (fake->subType() == Node::File) + else if ((fake->subType() == Node::File) || (fake->subType() == Node::Image)) quiet = true; } @@ -547,9 +547,6 @@ void Generator::generateFileList(const FakeNode* fake, ++count; QString file = child->name(); - if (file == "network/qftp/images/dir.png") - qDebug() << "FILE:" << file; - openedList.next(); text << Atom(Atom::ListItemNumber, openedList.numberString()) << Atom(Atom::ListItemLeft, openedList.styleString()) -- cgit v0.12 From adba8e01f0069d240bf0b97175f54e38271acd19 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 14 Dec 2009 16:37:31 +0100 Subject: QNAM Code: Do not re-abort or continue processing notifications. This should finally enable us to use DirectConnection in QNetworkReplyHandler of QtWebKit. Reviewed-by: thiago --- src/network/access/qnetworkreplyimpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index c20812e..1667c10 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -273,7 +273,7 @@ void QNetworkReplyImplPrivate::handleNotifications() if (state != Working) return; - while (!current.isEmpty()) { + while (state == Working && !current.isEmpty()) { InternalNotifications notification = current.dequeue(); switch (notification) { case NotifyDownstreamReadyWrite: @@ -580,7 +580,7 @@ QNetworkReplyImpl::~QNetworkReplyImpl() void QNetworkReplyImpl::abort() { Q_D(QNetworkReplyImpl); - if (d->state == QNetworkReplyImplPrivate::Aborted) + if (d->state == QNetworkReplyImplPrivate::Finished || d->state == QNetworkReplyImplPrivate::Aborted) return; // stop both upload and download -- cgit v0.12 From 2fe3395812b6497e7151e556686a82cfd763f243 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 14 Dec 2009 19:51:13 +0100 Subject: Doc: Minor fixes to language. Reviewed-by: Trust Me --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 1bdc3ed..88b7271 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -3407,9 +3407,9 @@ quint64 QWebPage::bytesReceived() const /*! \fn void QWebPage::unsupportedContent(QNetworkReply *reply) - This signals is emitted when webkit cannot handle a link the user navigated to. + This signal is emitted when WebKit cannot handle a link the user navigated to. - At signal emissions time the meta data of the QNetworkReply \a reply is available. + At signal emission time the meta-data of the QNetworkReply \a reply is available. \note This signal is only emitted if the forwardUnsupportedContent property is set to true. -- cgit v0.12 From ad4ca2152c161f7023e5febcf9e90c0652b8e57d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 14 Dec 2009 19:54:33 +0100 Subject: Doc: Fixed an image reference. Reviewed-by: Trust Me --- src/gui/kernel/qevent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index c4a25e1..3579c79 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -409,7 +409,7 @@ QMouseEventEx::~QMouseEventEx() consider a top-level window A containing a child B which in turn contains a child C (all with mouse tracking enabled): - \image hoverEvents.png + \image hoverevents.png Now, if you move the cursor from the top to the bottom in the middle of A, you will get the following QEvent::MouseMove events: @@ -432,7 +432,7 @@ QMouseEventEx::~QMouseEventEx() \o A::HoverMove, B::HoverMove \o A::HoverMove, B::HoverMove, C::HoverMove \endlist - + */ /*! -- cgit v0.12 From cd0c4934ed60a3eae12d85d93aa950e9296cdb83 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Mon, 14 Dec 2009 21:22:58 +0100 Subject: Change some examples of Webkit to create the mainwindow on the stack --- examples/webkit/fancybrowser/main.cpp | 4 ++-- examples/webkit/googlechat/main.cpp | 4 ++-- examples/webkit/previewer/main.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/webkit/fancybrowser/main.cpp b/examples/webkit/fancybrowser/main.cpp index 7f3c983..7ca862d 100644 --- a/examples/webkit/fancybrowser/main.cpp +++ b/examples/webkit/fancybrowser/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char * argv[]) { QApplication app(argc, argv); - MainWindow *browser = new MainWindow; - browser->show(); + MainWindow browser; + browser.show(); return app.exec(); } diff --git a/examples/webkit/googlechat/main.cpp b/examples/webkit/googlechat/main.cpp index 6b5e11f..ca94131 100644 --- a/examples/webkit/googlechat/main.cpp +++ b/examples/webkit/googlechat/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char * argv[]) QNetworkProxyFactory::setUseSystemConfiguration(true); - GoogleChat *chat = new GoogleChat; - chat->show(); + GoogleChat chat; + chat.show(); return app.exec(); } diff --git a/examples/webkit/previewer/main.cpp b/examples/webkit/previewer/main.cpp index 183b03f..1c80c19 100644 --- a/examples/webkit/previewer/main.cpp +++ b/examples/webkit/previewer/main.cpp @@ -46,8 +46,8 @@ int main(int argc, char * argv[]) { QApplication app(argc, argv); - MainWindow *mainWindow = new MainWindow; - mainWindow->show(); + MainWindow mainWindow; + mainWindow.show(); return app.exec(); } //! [0] -- cgit v0.12 From 7a3c595421b98087da638a5e706320d0d936d828 Mon Sep 17 00:00:00 2001 From: Tristan Chabredier Date: Tue, 15 Dec 2009 10:20:29 +0100 Subject: Fix compilation on HP-UX 11.11. Error was: thread/qthread_unix.cpp: In static member function 'static int QThread::idealThreadCount()': thread/qthread_unix.cpp:325: error: aggregate 'pst_dynamic psd' has incomplete type and cannot be defined thread/qthread_unix.cpp:326: error: 'pstat_getdynamic' was not declared in this scope Task-number: QTBUG-6576 Reviewed-by: Thiago Macieira --- mkspecs/hpux-g++-64/qmake.conf | 4 ++-- mkspecs/hpux-g++-64/qplatformdefs.h | 2 +- src/corelib/thread/qthread_unix.cpp | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mkspecs/hpux-g++-64/qmake.conf b/mkspecs/hpux-g++-64/qmake.conf index 38595c9..f76bd4e 100644 --- a/mkspecs/hpux-g++-64/qmake.conf +++ b/mkspecs/hpux-g++-64/qmake.conf @@ -15,7 +15,7 @@ QMAKE_LEX = flex QMAKE_LEXFLAGS = QMAKE_YACC = yacc QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = +DA2.0W +QMAKE_CFLAGS = QMAKE_CFLAGS_DEPS = -M QMAKE_CFLAGS_WARN_ON = -Wall -W QMAKE_CFLAGS_WARN_OFF = -w @@ -51,7 +51,7 @@ QMAKE_LINK = g++ QMAKE_LINK_SHLIB = g++ QMAKE_LINK_C = gcc QMAKE_LINK_C_SHLIB = gcc -QMAKE_LFLAGS = +DA2.0W -Wl,+s -lpthread +QMAKE_LFLAGS = -Wl,+s -lpthread QMAKE_LFLAGS_RELEASE = QMAKE_LFLAGS_DEBUG = QMAKE_LFLAGS_SHLIB = -fPIC -shared diff --git a/mkspecs/hpux-g++-64/qplatformdefs.h b/mkspecs/hpux-g++-64/qplatformdefs.h index a8d06d8..ac13799 100644 --- a/mkspecs/hpux-g++-64/qplatformdefs.h +++ b/mkspecs/hpux-g++-64/qplatformdefs.h @@ -145,7 +145,7 @@ #define QT_SIGNAL_ARGS int #define QT_SIGNAL_IGNORE SIG_IGN -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T socklen_t #endif // QPLATFORMDEFS_H diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 21b5e65..0309c67 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -74,6 +74,10 @@ # endif #endif +#ifdef Q_OS_HPUX +#include +#endif + #if defined(Q_OS_MAC) # ifdef qDebug # define old_qDebug qDebug -- cgit v0.12 From 1f4a4cca0067b1d4a9784f00e41c3fc1aca1f712 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 14 Dec 2009 16:27:25 +0100 Subject: Optimisations to gesture event filtering. Now we don't filter some events through the gesture manager and use QMap instead of QHash, which seem to be a bit faster in our cases. Reviewed-by: Olivier Goffart --- src/gui/kernel/qapplication.cpp | 46 +++++++++++++++++++++++++++++++++----- src/gui/kernel/qgesturemanager.cpp | 42 +++++++++++++++++----------------- src/gui/kernel/qgesturemanager_p.h | 4 ++-- 3 files changed, 64 insertions(+), 28 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 8c63968..bd13423 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3629,12 +3629,46 @@ bool QApplication::notify(QObject *receiver, QEvent *e) // walk through parents and check for gestures if (qt_gestureManager) { - if (receiver->isWidgetType()) { - if (qt_gestureManager->filterEvent(static_cast(receiver), e)) - return true; - } else if (QGesture *gesture = qobject_cast(receiver)) { - if (qt_gestureManager->filterEvent(gesture, e)) - return true; + switch (e->type()) { + case QEvent::Paint: + case QEvent::MetaCall: + case QEvent::DeferredDelete: + case QEvent::DragEnter: case QEvent::DragMove: case QEvent::DragLeave: + case QEvent::Drop: case QEvent::DragResponse: + case QEvent::ChildAdded: case QEvent::ChildPolished: +#ifdef QT3_SUPPORT + case QEvent::ChildInsertedRequest: + case QEvent::ChildInserted: + case QEvent::LayoutHint: +#endif + case QEvent::ChildRemoved: + case QEvent::UpdateRequest: + case QEvent::UpdateLater: + case QEvent::AccessibilityPrepare: + case QEvent::LocaleChange: + case QEvent::Style: + case QEvent::IconDrag: + case QEvent::StyleChange: + case QEvent::AccessibilityHelp: + case QEvent::AccessibilityDescription: + case QEvent::GraphicsSceneDragEnter: + case QEvent::GraphicsSceneDragMove: + case QEvent::GraphicsSceneDragLeave: + case QEvent::GraphicsSceneDrop: + case QEvent::DynamicPropertyChange: + case QEvent::NetworkReplyUpdated: + break; + default: + if (receiver->isWidgetType()) { + if (qt_gestureManager->filterEvent(static_cast(receiver), e)) + return true; + } else { + // a special case for events that go to QGesture objects. + // We pass the object to the gesture manager and it'll figure + // out if it's QGesture or not. + if (qt_gestureManager->filterEvent(receiver, e)) + return true; + } } } diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 192f9ac..d7cbebd 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -187,10 +187,8 @@ QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recogni #endif } - QList states = - m_objectGestures.value(QGestureManager::ObjectGesture(object, type)); // check if the QGesture for this recognizer has already been created - foreach (QGesture *state, states) { + foreach (QGesture *state, m_objectGestures.value(QGestureManager::ObjectGesture(object, type))) { if (m_gestureToRecognizer.value(state) == recognizer) return state; } @@ -215,14 +213,13 @@ QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recogni return state; } -bool QGestureManager::filterEventThroughContexts(const QMultiHash &contexts, QEvent *event) { QSet triggeredGestures; QSet finishedGestures; QSet newMaybeGestures; - QSet canceledGestures; QSet notGestures; // TODO: sort contexts by the gesture type and check if one of the contexts @@ -231,7 +228,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiHash::const_iterator ContextIterator; + typedef QMultiMap::const_iterator ContextIterator; for (ContextIterator cit = contexts.begin(), ce = contexts.end(); cit != ce; ++cit) { Qt::GestureType gestureType = cit.value(); QMap::const_iterator @@ -271,6 +268,9 @@ bool QGestureManager::filterEventThroughContexts(const QMultiHash startedGestures = triggeredGestures - m_activeGestures; triggeredGestures &= m_activeGestures; @@ -280,8 +280,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiHash activeToCancelGestures = m_activeGestures & notGestures; - canceledGestures += activeToCancelGestures; + QSet canceledGestures = m_activeGestures & notGestures; // start timers for new gestures in maybe state foreach (QGesture *state, newMaybeGestures) { @@ -449,14 +448,14 @@ void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture) // return true if accepted (consumed) bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event) { - QSet types; - QMultiHash contexts; + QMap types; + QMultiMap contexts; QWidget *w = receiver; typedef QMap::const_iterator ContextIterator; if (!w->d_func()->gestureContext.isEmpty()) { for(ContextIterator it = w->d_func()->gestureContext.begin(), e = w->d_func()->gestureContext.end(); it != e; ++it) { - types.insert(it.key()); + types.insert(it.key(), 0); contexts.insertMulti(w, it.key()); } } @@ -468,7 +467,7 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event) e = w->d_func()->gestureContext.end(); it != e; ++it) { if (!(it.value() & Qt::DontStartGestureOnChildren)) { if (!types.contains(it.key())) { - types.insert(it.key()); + types.insert(it.key(), 0); contexts.insertMulti(w, it.key()); } } @@ -477,20 +476,20 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event) break; w = w->parentWidget(); } - return filterEventThroughContexts(contexts, event); + return contexts.isEmpty() ? false : filterEventThroughContexts(contexts, event); } #ifndef QT_NO_GRAPHICSVIEW bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event) { - QSet types; - QMultiHash contexts; + QMap types; + QMultiMap contexts; QGraphicsObject *item = receiver; if (!item->QGraphicsItem::d_func()->gestureContext.isEmpty()) { typedef QMap::const_iterator ContextIterator; for(ContextIterator it = item->QGraphicsItem::d_func()->gestureContext.begin(), e = item->QGraphicsItem::d_func()->gestureContext.end(); it != e; ++it) { - types.insert(it.key()); + types.insert(it.key(), 0); contexts.insertMulti(item, it.key()); } } @@ -503,20 +502,23 @@ bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event) e = item->QGraphicsItem::d_func()->gestureContext.end(); it != e; ++it) { if (!(it.value() & Qt::DontStartGestureOnChildren)) { if (!types.contains(it.key())) { - types.insert(it.key()); + types.insert(it.key(), 0); contexts.insertMulti(item, it.key()); } } } item = item->parentObject(); } - return filterEventThroughContexts(contexts, event); + return contexts.isEmpty() ? false : filterEventThroughContexts(contexts, event); } #endif -bool QGestureManager::filterEvent(QGesture *state, QEvent *event) +bool QGestureManager::filterEvent(QObject *receiver, QEvent *event) { - QMultiHash contexts; + if (!m_gestureToRecognizer.contains(static_cast(receiver))) + return false; + QGesture *state = static_cast(receiver); + QMultiMap contexts; contexts.insert(state, state->gestureType()); return filterEventThroughContexts(contexts, event); } diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h index 4efa10b..5329d1d 100644 --- a/src/gui/kernel/qgesturemanager_p.h +++ b/src/gui/kernel/qgesturemanager_p.h @@ -73,7 +73,7 @@ public: void unregisterGestureRecognizer(Qt::GestureType type); bool filterEvent(QWidget *receiver, QEvent *event); - bool filterEvent(QGesture *receiver, QEvent *event); + bool filterEvent(QObject *receiver, QEvent *event); #ifndef QT_NO_GRAPHICSVIEW bool filterEvent(QGraphicsObject *receiver, QEvent *event); #endif //QT_NO_GRAPHICSVIEW @@ -86,7 +86,7 @@ public: protected: void timerEvent(QTimerEvent *event); - bool filterEventThroughContexts(const QMultiHash &contexts, + bool filterEventThroughContexts(const QMultiMap &contexts, QEvent *event); private: -- cgit v0.12 From 44f7c1e097582a704a06ccbbf516536b88ddcd3a Mon Sep 17 00:00:00 2001 From: dka Date: Mon, 12 Oct 2009 16:25:23 +0300 Subject: Changes to support locale change event for symbian platform Subscribing to the locale change notification to be able to update the system locale whenever the user changes the current system locale. Also changed the initialization of the system locale to make construction of the QLocale object as lightweight as possible. So now the default contructor just creates a QLocale and QSystemLocale objects, but doesn't try to fill the cache in the latter with data from the system and postpones it until it is actually requested (most applications create QLocale objects on the stack and might not even use the data from the system locale, so we don't need to initialize system locale right away). Modified-by: axis Modified-by: Denis Dzyubenko Reviewed-by: Denis Dzyubenko Reviewed-by: axis --- src/corelib/kernel/qcore_symbian_p.h | 3 +- src/corelib/kernel/qcoreapplication.cpp | 10 +++ src/corelib/kernel/qcoreapplication.h | 4 ++ src/corelib/kernel/qcoreapplication_p.h | 4 ++ src/corelib/tools/qlocale.cpp | 43 +++++++++--- src/corelib/tools/qlocale_p.h | 5 +- src/corelib/tools/qlocale_symbian.cpp | 121 ++++++++++++++++++++++++++++++-- src/plugins/s60/src/qlocale_3_1.cpp | 8 +++ 8 files changed, 181 insertions(+), 17 deletions(-) diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index f86bfd3..2ef48b5 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -139,7 +139,8 @@ enum S60PluginFuncOrdinals S60Plugin_GetLongDateFormatSpec = 3, S60Plugin_GetShortDateFormatSpec = 4, S60Plugin_LocalizedDirectoryName = 5, - S60Plugin_GetSystemDrive = 6 + S60Plugin_GetSystemDrive = 6, + S60Plugin_RefreshLocaleInfo = 7 }; Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 8a55bad..93df45d 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -69,6 +69,7 @@ # include # include "qeventdispatcher_symbian_p.h" # include "private/qcore_symbian_p.h" +# include "private/qlocale_p.h" #elif defined(Q_OS_UNIX) # if !defined(QT_NO_GLIB) # include "qeventdispatcher_glib_p.h" @@ -2601,4 +2602,13 @@ int QCoreApplication::loopLevel() \sa Q_OBJECT, QObject::tr(), QObject::trUtf8() */ +#if defined(Q_OS_SYMBIAN) +void QCoreApplicationPrivate::_q_symbianRegisterLocaleNotifier() +{ + QLocalePrivate::symbianRegisterLocaleNotifier(); +} +#endif + QT_END_NAMESPACE + +#include "moc_qcoreapplication.cpp" diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 097b8b4..152a775 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -196,6 +196,10 @@ private: static QCoreApplication *self; +#if defined(Q_OS_SYMBIAN) + Q_PRIVATE_SLOT(d_func(), void _q_symbianRegisterLocaleNotifier()) +#endif + Q_DISABLE_COPY(QCoreApplication) friend class QEventDispatcherUNIXPrivate; diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index bf43f88..39e50c4 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -122,6 +122,10 @@ public: static uint attribs; static inline bool testAttribute(uint flag) { return attribs & (1 << flag); } + +#if defined(Q_OS_SYMBIAN) + void _q_symbianRegisterLocaleNotifier(); +#endif }; QT_END_NAMESPACE diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 4a66b92..22114c2 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -129,6 +129,10 @@ inline bool isascii(int c) } #endif +#if defined(Q_OS_SYMBIAN) +void symbianUpdateSystemPrivate(); +#endif + /****************************************************************************** ** Helpers for accessing Qt locale database */ @@ -1388,7 +1392,8 @@ QSystemLocale::QSystemLocale() /*! \internal */ QSystemLocale::QSystemLocale(bool) -{ } +{ +} /*! Deletes the object. @@ -1407,16 +1412,29 @@ static const QSystemLocale *systemLocale() { if (_systemLocale) return _systemLocale; +#if defined(Q_OS_SYMBIAN) + symbianInitSystemLocale(); +#endif return QSystemLocale_globalSystemLocale(); } -void QLocalePrivate::updateSystemPrivate() +void QLocalePrivate::updateSystemPrivate(bool initialize) { const QSystemLocale *sys_locale = systemLocale(); if (!system_lp) system_lp = globalLocalePrivate(); *system_lp = *sys_locale->fallbackLocale().d(); + system_lp->m_language_id = 0; +#if defined(Q_OS_SYMBIAN) + RDebug::Print(_L("updateSystemPrivate")); +#endif + if (!initialize) + return; + +#if defined(Q_OS_SYMBIAN) + symbianUpdateSystemPrivate(); +#endif QVariant res = sys_locale->query(QSystemLocale::LanguageId, QVariant()); if (!res.isNull()) system_lp->m_language_id = res.toInt(); @@ -1446,12 +1464,12 @@ void QLocalePrivate::updateSystemPrivate() } #endif -static const QLocalePrivate *systemPrivate() +static const QLocalePrivate *systemPrivate(bool initialize = true) { #ifndef QT_NO_SYSTEMLOCALE // copy over the information from the fallback locale and modify if (!system_lp || system_lp->m_language_id == 0) - QLocalePrivate::updateSystemPrivate(); + QLocalePrivate::updateSystemPrivate(initialize); return system_lp; #else @@ -1459,10 +1477,10 @@ static const QLocalePrivate *systemPrivate() #endif } -static const QLocalePrivate *defaultPrivate() +static const QLocalePrivate *defaultPrivate(bool initialize = true) { if (!default_lp) - default_lp = systemPrivate(); + default_lp = systemPrivate(initialize); return default_lp; } @@ -2169,7 +2187,7 @@ QLocale::QLocale() : v(0) { p.numberOptions = default_number_options; - p.index = localePrivateIndex(defaultPrivate()); + p.index = localePrivateIndex(defaultPrivate(false)); } /*! @@ -2199,7 +2217,7 @@ QLocale::QLocale(Language language, Country country) // If not found, should default to system if (d->languageId() == QLocale::C && language != QLocale::C) { p.numberOptions = default_number_options; - p.index = localePrivateIndex(defaultPrivate()); + p.index = localePrivateIndex(defaultPrivate(false)); } else { p.numberOptions = 0; p.index = localePrivateIndex(d); @@ -2283,6 +2301,7 @@ void QLocale::setDefault(const QLocale &locale) */ QLocale::Language QLocale::language() const { + systemPrivate(); // make sure inline data is initialized from the system. return Language(d()->languageId()); } @@ -2293,6 +2312,7 @@ QLocale::Language QLocale::language() const */ QLocale::Country QLocale::country() const { + systemPrivate(); // make sure inline data is initialized from the system. return Country(d()->countryId()); } @@ -3021,6 +3041,7 @@ QDateTime QLocale::toDateTime(const QString &string, const QString &format) cons */ QChar QLocale::decimalPoint() const { + systemPrivate(); // make sure inline data is initialized from the system. return d()->decimal(); } @@ -3031,6 +3052,7 @@ QChar QLocale::decimalPoint() const */ QChar QLocale::groupSeparator() const { + systemPrivate(); // make sure inline data is initialized from the system. return d()->group(); } @@ -3041,6 +3063,7 @@ QChar QLocale::groupSeparator() const */ QChar QLocale::percent() const { + systemPrivate(); // make sure inline data is initialized from the system. return d()->percent(); } @@ -3051,6 +3074,7 @@ QChar QLocale::percent() const */ QChar QLocale::zeroDigit() const { + systemPrivate(); // make sure inline data is initialized from the system. return d()->zero(); } @@ -3061,6 +3085,7 @@ QChar QLocale::zeroDigit() const */ QChar QLocale::negativeSign() const { + systemPrivate(); // make sure inline data is initialized from the system. return d()->minus(); } @@ -3071,6 +3096,7 @@ QChar QLocale::negativeSign() const */ QChar QLocale::positiveSign() const { + systemPrivate(); // make sure inline data is initialized from the system. return d()->plus(); } @@ -3081,6 +3107,7 @@ QChar QLocale::positiveSign() const */ QChar QLocale::exponential() const { + systemPrivate(); // make sure inline data is initialized from the system. return d()->exponential(); } diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index 0123a6e..63e9e0f 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -132,7 +132,10 @@ public: CharBuff *result) const; inline char digitToCLocale(const QChar &c) const; - static void updateSystemPrivate(); + static void updateSystemPrivate(bool initialize = true); +#if defined(Q_OS_SYMBIAN) + static void symbianRegisterLocaleNotifier(); +#endif enum NumberMode { IntegerMode, DoubleStandardMode, DoubleScientificMode }; bool validateChars(const QString &str, NumberMode numMode, QByteArray *buff, int decDigits = -1) const; diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp index 1273d06..c4ad67c 100644 --- a/src/corelib/tools/qlocale_symbian.cpp +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -46,11 +46,95 @@ #include #include +#include +#include #include "private/qcore_symbian_p.h" - +#include "private/qcoreapplication_p.h" +#include "qlocale_p.h" +#include "qdebug.h" QT_BEGIN_NAMESPACE +class CLocaleChangeNotifier : public CActive +{ +public: + static CLocaleChangeNotifier *NewL(); + ~CLocaleChangeNotifier(); + +private: + CLocaleChangeNotifier(); + void ConstructL(); + void RunL(); + void DoCancel(); + +private: + RChangeNotifier changeNotifier; +}; + +static CLocaleChangeNotifier *qt_changeNotifier = NULL; + +CLocaleChangeNotifier *CLocaleChangeNotifier::NewL() +{ + CLocaleChangeNotifier *self = new (ELeave) CLocaleChangeNotifier(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; +} + +CLocaleChangeNotifier::CLocaleChangeNotifier() + : CActive(CActive::EPriorityStandard) +{ +} + + +CLocaleChangeNotifier::~CLocaleChangeNotifier() +{ + Cancel(); + changeNotifier.Close(); +} + +void CLocaleChangeNotifier::ConstructL() +{ + changeNotifier.Create(); + CActiveScheduler::Add(this); + SetActive(); +} + +void CLocaleChangeNotifier::DoCancel() +{ + changeNotifier.LogonCancel(); +} + +void CLocaleChangeNotifier::RunL() +{ + SetActive(); + if (changeNotifier.Logon(iStatus) == KErrNone) { + if (iStatus.Int() == EChangesLocale) { + RDebug::Print(_L("notifier:locale changed")); + QT_TRYCATCH_LEAVING(QLocalePrivate::updateSystemPrivate()); + } else { + RDebug::Print(_L("notifier:something else changed")); + } + } else { + RDebug::Print(_L("notifier:logon failed")); + } +} + +static void qt_cleanupLocaleNotifier() +{ + delete qt_changeNotifier; + qt_changeNotifier = NULL; +} + +void QLocalePrivate::symbianRegisterLocaleNotifier() +{ + if (!qt_changeNotifier) { + QT_TRAP_THROWING(qt_changeNotifier = CLocaleChangeNotifier::NewL()); + qAddPostRoutine(qt_cleanupLocaleNotifier); + } +} + // Located in qlocale.cpp extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry); @@ -65,6 +149,7 @@ static FormatFunc ptrTimeFormatL = NULL; static FormatSpecFunc ptrGetTimeFormatSpec = NULL; static FormatSpecFunc ptrGetLongDateFormatSpec = NULL; static FormatSpecFunc ptrGetShortDateFormatSpec = NULL; +static FormatSpecFunc ptrRefreshLocaleInfo = NULL; // Default functions if functions cannot be resolved static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&) @@ -214,6 +299,8 @@ static const char *jp_locale_dep[] = { */ static QString s60ToQtFormat(const QString &sys_fmt) { + RDebug::Print(_L("Time Format \"%S\""), &timeFormat); + TLocale *locale = _s60Locale.GetLocale(); QString result; @@ -679,6 +766,8 @@ static QString symbianDateFormat(bool short_format) dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale)); } + RDebug::Print(_L("symDateFormat: \"%S\""), &dateFormat); + return s60ToQtFormat(qt_TDesC2QString(dateFormat)); } @@ -688,6 +777,8 @@ static QString symbianDateFormat(bool short_format) */ static QString symbianTimeFormat() { + TPtrC timeFormat = ptrGetTimeFormatSpec(_s60Locale); + RDebug::Print(_L("symTimeFormat: \"%S\""), &timeFormat); return s60ToQtFormat(qt_TDesC2QString(ptrGetTimeFormatSpec(_s60Locale))); } @@ -771,22 +862,35 @@ static QLocale::MeasurementSystem symbianMeasurementSystem() return QLocale::MetricSystem; } -QLocale QSystemLocale::fallbackLocale() const +void symbianUpdateSystemPrivate() { + RDebug::Print(_L("symbianUpdateSystemPrivate")); // load system data before query calls + _s60Locale.LoadSystemSettings(); + if (ptrRefreshLocaleInfo) + ptrRefreshLocaleInfo(); +} + +void symbianInitSystemLocale() +{ + RDebug::Print(_L("symbianInitSystemLocale")); static QBasicAtomicInt initDone = Q_BASIC_ATOMIC_INITIALIZER(0); if (initDone.testAndSetRelaxed(0, 1)) { - _s60Locale.LoadSystemSettings(); + if (!qt_changeNotifier) { + QMetaObject::invokeMethod(qApp, SLOT(_q_symbianRegisterLocaleNotifier()), Qt::AutoConnection); + } // Initialize platform version dependent function pointers ptrTimeFormatL = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL)); + (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL)); ptrGetTimeFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec)); + (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec)); ptrGetLongDateFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec)); + (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec)); ptrGetShortDateFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec)); + (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec)); + ptrRefreshLocaleInfo = reinterpret_cast + (qt_resolveS60PluginFunc(S60Plugin_RefreshLocaleInfo)); if (!ptrTimeFormatL) ptrTimeFormatL = &defaultTimeFormatL; if (!ptrGetTimeFormatSpec) @@ -801,7 +905,10 @@ QLocale QSystemLocale::fallbackLocale() const } while(initDone != 2) QThread::yieldCurrentThread(); +} +QLocale QSystemLocale::fallbackLocale() const +{ TLanguage lang = User::Language(); QString locale = QLatin1String(qt_symbianLocaleName(lang)); return QLocale(locale); diff --git a/src/plugins/s60/src/qlocale_3_1.cpp b/src/plugins/s60/src/qlocale_3_1.cpp index beeee7f..d597861 100644 --- a/src/plugins/s60/src/qlocale_3_1.cpp +++ b/src/plugins/s60/src/qlocale_3_1.cpp @@ -50,6 +50,7 @@ _LIT(KLocaleIndependent, "%F"); static TBuf<10> dateFormat; static TBuf<10> timeFormat; +#define _DEBUG static void initialiseDateFormat() { if(dateFormat.Length()) @@ -146,3 +147,10 @@ EXPORT_C TPtrC defaultGetShortDateFormatSpec(TExtendedLocale&) initialiseDateFormat(); return TPtrC(dateFormat); } + +EXPORT_C void refreshLocaleInfo() +{ + // clear the buffers, so next time we re-read data from the system. + dateFormat.Zero(); + timeFormat.Zero(); +} -- cgit v0.12 From 66d28ef6125294113d6f9b04abdc10d935d0f4b5 Mon Sep 17 00:00:00 2001 From: miniak Date: Tue, 15 Dec 2009 10:38:07 +0100 Subject: Allow the WM_TASKBARCREATED message through the UIPI filter on Windows Vista and higher This is necessary to allow Windows Explorer send the WM_TASKBARCREATED message to a Qt application (to recreate its QSystemTrayIcon-s) even when it is running in a higher UIPI privilege level. Merge-request: 1626 Reviewed-by: Denis Dzyubenko Reviewed-by: Prasanth Ullattil --- src/gui/util/qsystemtrayicon_win.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 362be5b..474555b 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -83,7 +83,11 @@ struct Q_NOTIFYICONIDENTIFIER { GUID guidItem; }; +#define Q_MSGFLT_ALLOW 1 + typedef HRESULT (WINAPI *PtrShell_NotifyIconGetRect)(const Q_NOTIFYICONIDENTIFIER* identifier, RECT* iconLocation); +typedef BOOL (WINAPI *PtrChangeWindowMessageFilter)(UINT message, DWORD dwFlag); +typedef BOOL (WINAPI *PtrChangeWindowMessageFilterEx)(HWND hWnd, UINT message, DWORD action, void* pChangeFilterStruct); class QSystemTrayIconSys : QWidget { @@ -143,6 +147,23 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *object) if (!MYWM_TASKBARCREATED) { MYWM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated"); } + + // Allow the WM_TASKBARCREATED message through the UIPI filter on Windows Vista and higher + static PtrChangeWindowMessageFilterEx pChangeWindowMessageFilterEx = + (PtrChangeWindowMessageFilterEx)QLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilterEx"); + + if (pChangeWindowMessageFilterEx) { + // Call the safer ChangeWindowMessageFilterEx API if available + pChangeWindowMessageFilterEx(winId(), MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW, 0); + } else { + static PtrChangeWindowMessageFilter pChangeWindowMessageFilter = + (PtrChangeWindowMessageFilter)QLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilter"); + + if (pChangeWindowMessageFilter) { + // Call the deprecated ChangeWindowMessageFilter API otherwise + pChangeWindowMessageFilter(MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW); + } + } } QSystemTrayIconSys::~QSystemTrayIconSys() -- cgit v0.12 From 9f8d3a39606abc3888fb9f19594b7db54f5306be Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 15 Dec 2009 10:29:27 +0100 Subject: Calling removeToolBar() on native Mac toolbars (Cocoa) causes crash. The hash and the list which stores the references are already cleared by the delegate function toolbarDidRemoveItem: There is no need to remove them manually after a call to [NSToolbar removeItemAtIndex]. Task-number: QTBUG-6200 Reviewed-by: Richard Moe Gustavsen --- src/gui/widgets/qmainwindowlayout_mac.mm | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index 8d8ffa7..6d50678 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -463,9 +463,6 @@ void QMainWindowLayout::removeFromMacToolbar(QToolBar *toolbar) NSToolbarItem *item = static_cast(it.key()); [[qt_mac_window_for(layoutState.mainWindow->window()) toolbar] removeItemAtIndex:toolbarItemsCopy.indexOf(item)]; - // In Carbon this hash and list gets emptied via events. In Cocoa, we have to do it ourselves here. - it = unifiedToolbarHash.erase(it); - qtoolbarsInUnifiedToolbarList.removeAll(toolbar); #endif break; } -- cgit v0.12 From acaaf55b118322d7edc80e401b20187cf6251683 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 15 Dec 2009 17:05:35 +0100 Subject: doc: Final fix. Example image links now display the image. Task-number: QTBUG-4484 --- tools/qdoc3/generator.cpp | 42 +++++++++++++++++++++++++++++++++++++++++- tools/qdoc3/generator.h | 2 ++ tools/qdoc3/htmlgenerator.cpp | 4 ++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 95319ca..56fca06 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -65,6 +65,8 @@ QMap Generator::imgFileExts; QSet Generator::outputFormats; QStringList Generator::imageFiles; QStringList Generator::imageDirs; +QStringList Generator::exampleDirs; +QStringList Generator::exampleImgExts; QString Generator::outDir; QString Generator::project; @@ -120,12 +122,19 @@ void Generator::initialize(const Config &config) if (!dirInfo.mkdir(outDir + "/images")) config.lastLocation().fatal(tr("Cannot create output directory '%1'") .arg(outDir + "/images")); + if (!dirInfo.mkdir(outDir + "/images/used-in-examples")) + config.lastLocation().fatal(tr("Cannot create output directory '%1'") + .arg(outDir + "/images/used-in-examples")); } imageFiles = config.getStringList(CONFIG_IMAGES); imageDirs = config.getStringList(CONFIG_IMAGEDIRS); + exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS); + exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot + + CONFIG_IMAGEEXTENSIONS); - QString imagesDotFileExtensions = CONFIG_IMAGES + Config::dot + CONFIG_FILEEXTENSIONS; + QString imagesDotFileExtensions = + CONFIG_IMAGES + Config::dot + CONFIG_FILEEXTENSIONS; QSet formats = config.subVars(imagesDotFileExtensions); QSet::ConstIterator f = formats.begin(); while (f != formats.end()) { @@ -530,6 +539,13 @@ void Generator::generateInheritedBy(const ClassNode *classe, } } +/*! + This function is called when the documentation for an + example is being formatted. It outputs the list of source + files comprising the example, and the list of images used + by the example. The images are copied into a subtree of + \c{...doc/html/images/used-in-examples/...} + */ void Generator::generateFileList(const FakeNode* fake, CodeMarker* marker, Node::SubType subtype, @@ -546,6 +562,30 @@ void Generator::generateFileList(const FakeNode* fake, if (child->subType() == subtype) { ++count; QString file = child->name(); + if (subtype == Node::Image) { + if (!file.isEmpty()) { + QDir dirInfo; + QString userFriendlyFilePath; + QString srcPath = Config::findFile(fake->location(), + QStringList(), + exampleDirs, + file, + exampleImgExts, + userFriendlyFilePath); + userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/')); + + QString imgOutDir = outDir + "/images/used-in-examples/" + userFriendlyFilePath; + if (!dirInfo.mkpath(imgOutDir)) + fake->location().fatal(tr("Cannot create output directory '%1'") + .arg(imgOutDir)); + + QString imgOutName = Config::copyFile(fake->location(), + srcPath, + file, + imgOutDir); + } + + } openedList.next(); text << Atom(Atom::ListItemNumber, openedList.numberString()) diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 7667789..cc1ea25 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -183,6 +183,8 @@ class Generator static QSet outputFormats; static QStringList imageFiles; static QStringList imageDirs; + static QStringList exampleDirs; + static QStringList exampleImgExts; static QString outDir; static QString project; }; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 8711c6b..ae7bd81 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3429,6 +3429,8 @@ QString HtmlGenerator::fileName(const Node *node) if (node->type() == Node::Fake) { if (static_cast(node)->subType() == Node::ExternalPage) return node->name(); + if (static_cast(node)->subType() == Node::Image) + return node->name(); } return PageGenerator::fileName(node); } @@ -4000,6 +4002,8 @@ QString HtmlGenerator::getLink(const Atom *atom, if (path.isEmpty()) { link = linkForNode(*node, relative); + if (*node && (*node)->subType() == Node::Image) + link = "images/used-in-examples/" + link; if (targetAtom) link += "#" + refForAtom(targetAtom, *node); } -- cgit v0.12 From 2a2dec6666f8f38e9240784b423ce69b18e1064e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 15 Dec 2009 21:00:18 +0100 Subject: Doc: Modified the coding style of the Audio Devices example. This commit will be a duplicate of the same change applied elsewhere. Reviewed-by: Kurt Korbatits --- examples/multimedia/audiodevices/audiodevices.cpp | 81 +++++++++------------- examples/multimedia/audiodevices/audiodevices.h | 6 +- examples/multimedia/audiodevices/audiodevices.pro | 2 +- .../multimedia/audiodevices/audiodevicesbase.ui | 64 ++++++++++++----- 4 files changed, 84 insertions(+), 69 deletions(-) diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp index e205e03..45c7a53 100644 --- a/examples/multimedia/audiodevices/audiodevices.cpp +++ b/examples/multimedia/audiodevices/audiodevices.cpp @@ -40,45 +40,33 @@ ****************************************************************************/ -#include #include #include "audiodevices.h" -AudioDevicesBase::AudioDevicesBase( QMainWindow *parent, Qt::WFlags f ) +AudioDevicesBase::AudioDevicesBase(QWidget *parent, Qt::WFlags f) + : QMainWindow(parent, f) { - Q_UNUSED(parent) - Q_UNUSED(f) - setupUi( this ); + setupUi(this); } AudioDevicesBase::~AudioDevicesBase() {} -AudioTest::AudioTest( QMainWindow *parent, Qt::WFlags f ) - : AudioDevicesBase( parent, f ) +AudioTest::AudioTest(QWidget *parent, Qt::WFlags f) + : AudioDevicesBase(parent, f) { - nearestFreq->setDisabled(true); - nearestChannel->setDisabled(true); - nearestCodec->setDisabled(true); - nearestSampleSize->setDisabled(true); - nearestSampleType->setDisabled(true); - nearestEndian->setDisabled(true); - logOutput->setDisabled(true); - mode = QAudio::AudioOutput; - modeBox->addItem("Input"); - modeBox->addItem("Output"); - connect(testButton,SIGNAL(clicked()),SLOT(test())); - connect(modeBox,SIGNAL(activated(int)),SLOT(modeChanged(int))); - connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); - connect(frequencyBox,SIGNAL(activated(int)),SLOT(freqChanged(int))); - connect(channelsBox,SIGNAL(activated(int)),SLOT(channelChanged(int))); - connect(codecsBox,SIGNAL(activated(int)),SLOT(codecChanged(int))); - connect(sampleSizesBox,SIGNAL(activated(int)),SLOT(sampleSizeChanged(int))); - connect(sampleTypesBox,SIGNAL(activated(int)),SLOT(sampleTypeChanged(int))); - connect(endianBox,SIGNAL(activated(int)),SLOT(endianChanged(int))); + connect(testButton, SIGNAL(clicked()), SLOT(test())); + connect(modeBox, SIGNAL(activated(int)), SLOT(modeChanged(int))); + connect(deviceBox, SIGNAL(activated(int)), SLOT(deviceChanged(int))); + connect(frequencyBox, SIGNAL(activated(int)), SLOT(freqChanged(int))); + connect(channelsBox, SIGNAL(activated(int)), SLOT(channelChanged(int))); + connect(codecsBox, SIGNAL(activated(int)), SLOT(codecChanged(int))); + connect(sampleSizesBox, SIGNAL(activated(int)), SLOT(sampleSizeChanged(int))); + connect(sampleTypesBox, SIGNAL(activated(int)), SLOT(sampleTypeChanged(int))); + connect(endianBox, SIGNAL(activated(int)), SLOT(endianChanged(int))); modeBox->setCurrentIndex(0); modeChanged(0); @@ -98,7 +86,7 @@ void AudioTest::test() if (!deviceInfo.isNull()) { if (deviceInfo.isFormatSupported(settings)) { - logOutput->append("Success"); + logOutput->append(tr("Success")); nearestFreq->setText(""); nearestChannel->setText(""); nearestCodec->setText(""); @@ -136,16 +124,16 @@ void AudioTest::test() } } else - logOutput->append("No Device"); + logOutput->append(tr("No Device")); } void AudioTest::modeChanged(int idx) { // mode has changed - if(idx == 0) - mode=QAudio::AudioInput; + if (idx == 0) + mode = QAudio::AudioInput; else - mode=QAudio::AudioOutput; + mode = QAudio::AudioOutput; deviceBox->clear(); foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(mode)) @@ -162,37 +150,37 @@ void AudioTest::deviceChanged(int idx) frequencyBox->clear(); QList freqz = deviceInfo.supportedFrequencies(); - for(int i = 0; i < freqz.size(); ++i) + for (int i = 0; i < freqz.size(); ++i) frequencyBox->addItem(QString("%1").arg(freqz.at(i))); - if(freqz.size()) + if (freqz.size()) settings.setFrequency(freqz.at(0)); channelsBox->clear(); QList chz = deviceInfo.supportedChannels(); - for(int i = 0; i < chz.size(); ++i) + for (int i = 0; i < chz.size(); ++i) channelsBox->addItem(QString("%1").arg(chz.at(i))); - if(chz.size()) + if (chz.size()) settings.setChannels(chz.at(0)); codecsBox->clear(); QStringList codecz = deviceInfo.supportedCodecs(); - for(int i = 0; i < codecz.size(); ++i) + for (int i = 0; i < codecz.size(); ++i) codecsBox->addItem(QString("%1").arg(codecz.at(i))); - if(codecz.size()) + if (codecz.size()) settings.setCodec(codecz.at(0)); // Add false to create failed condition! codecsBox->addItem("audio/test"); sampleSizesBox->clear(); QList sampleSizez = deviceInfo.supportedSampleSizes(); - for(int i = 0; i < sampleSizez.size(); ++i) + for (int i = 0; i < sampleSizez.size(); ++i) sampleSizesBox->addItem(QString("%1").arg(sampleSizez.at(i))); - if(sampleSizez.size()) + if (sampleSizez.size()) settings.setSampleSize(sampleSizez.at(0)); sampleTypesBox->clear(); QList sampleTypez = deviceInfo.supportedSampleTypes(); - for(int i = 0; i < sampleTypez.size(); ++i) { + for (int i = 0; i < sampleTypez.size(); ++i) { switch(sampleTypez.at(i)) { case QAudioFormat::SignedInt: sampleTypesBox->addItem("SignedInt"); @@ -206,14 +194,14 @@ void AudioTest::deviceChanged(int idx) case QAudioFormat::Unknown: sampleTypesBox->addItem("Unknown"); } - if(sampleTypez.size()) + if (sampleTypez.size()) settings.setSampleType(sampleTypez.at(0)); } endianBox->clear(); QList endianz = deviceInfo.supportedByteOrders(); - for(int i = 0; i < endianz.size(); ++i) { - switch(endianz.at(i)) { + for (int i = 0; i < endianz.size(); ++i) { + switch (endianz.at(i)) { case QAudioFormat::LittleEndian: endianBox->addItem("Little Endian"); break; @@ -222,7 +210,7 @@ void AudioTest::deviceChanged(int idx) break; } } - if(endianz.size()) + if (endianz.size()) settings.setByteOrder(endianz.at(0)); } @@ -249,7 +237,7 @@ void AudioTest::sampleSizeChanged(int idx) void AudioTest::sampleTypeChanged(int idx) { - switch(sampleTypesBox->itemText(idx).toInt()) { + switch (sampleTypesBox->itemText(idx).toInt()) { case QAudioFormat::SignedInt: settings.setSampleType(QAudioFormat::SignedInt); break; @@ -263,7 +251,7 @@ void AudioTest::sampleTypeChanged(int idx) void AudioTest::endianChanged(int idx) { - switch(endianBox->itemText(idx).toInt()) { + switch (endianBox->itemText(idx).toInt()) { case QAudioFormat::LittleEndian: settings.setByteOrder(QAudioFormat::LittleEndian); break; @@ -271,4 +259,3 @@ void AudioTest::endianChanged(int idx) settings.setByteOrder(QAudioFormat::BigEndian); } } - diff --git a/examples/multimedia/audiodevices/audiodevices.h b/examples/multimedia/audiodevices/audiodevices.h index 5fe5547..bd4b7c4 100644 --- a/examples/multimedia/audiodevices/audiodevices.h +++ b/examples/multimedia/audiodevices/audiodevices.h @@ -49,7 +49,7 @@ class AudioDevicesBase : public QMainWindow, public Ui::AudioDevicesBase { public: - AudioDevicesBase( QMainWindow *parent = 0, Qt::WFlags f = 0 ); + AudioDevicesBase(QWidget *parent = 0, Qt::WFlags f = 0); virtual ~AudioDevicesBase(); }; @@ -57,10 +57,10 @@ class AudioTest : public AudioDevicesBase { Q_OBJECT public: - AudioTest( QMainWindow *parent = 0, Qt::WFlags f = 0 ); + AudioTest(QWidget *parent = 0, Qt::WFlags f = 0); virtual ~AudioTest(); - QAudioDeviceInfo deviceInfo; + QAudioDeviceInfo deviceInfo; QAudioFormat settings; QAudio::Mode mode; diff --git a/examples/multimedia/audiodevices/audiodevices.pro b/examples/multimedia/audiodevices/audiodevices.pro index 232da09..1cb4679 100644 --- a/examples/multimedia/audiodevices/audiodevices.pro +++ b/examples/multimedia/audiodevices/audiodevices.pro @@ -1,7 +1,7 @@ HEADERS = audiodevices.h SOURCES = audiodevices.cpp \ main.cpp -FORMS += audiodevicesbase.ui +FORMS += audiodevicesbase.ui QT += multimedia diff --git a/examples/multimedia/audiodevices/audiodevicesbase.ui b/examples/multimedia/audiodevices/audiodevicesbase.ui index 5207338..faa39dc 100644 --- a/examples/multimedia/audiodevices/audiodevicesbase.ui +++ b/examples/multimedia/audiodevices/audiodevicesbase.ui @@ -11,7 +11,7 @@ - AudioDevicesBase + Audio Devices @@ -41,7 +41,18 @@ - + + + + Input + + + + + Output + + + @@ -93,7 +104,11 @@ - + + + false + + @@ -113,7 +128,11 @@ - + + + false + + @@ -133,7 +152,11 @@ - + + + false + + @@ -153,7 +176,11 @@ - + + + false + + @@ -173,7 +200,11 @@ - + + + false + + @@ -193,10 +224,17 @@ - + + + false + + + + false + 0 @@ -216,16 +254,6 @@ - - - - 0 - 0 - 504 - 19 - - - -- cgit v0.12 From d0d5d9d8e6d7815a0c97af28a7d231bfb9e83c19 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 16 Dec 2009 11:30:44 +0100 Subject: Revert "Changes to support locale change event for symbian platform" Revert a change that is not yet complete and was pushed by mistake. This reverts commit 44f7c1e097582a704a06ccbbf516536b88ddcd3a. --- src/corelib/kernel/qcore_symbian_p.h | 3 +- src/corelib/kernel/qcoreapplication.cpp | 10 --- src/corelib/kernel/qcoreapplication.h | 4 -- src/corelib/kernel/qcoreapplication_p.h | 4 -- src/corelib/tools/qlocale.cpp | 43 +++--------- src/corelib/tools/qlocale_p.h | 5 +- src/corelib/tools/qlocale_symbian.cpp | 121 ++------------------------------ src/plugins/s60/src/qlocale_3_1.cpp | 8 --- 8 files changed, 17 insertions(+), 181 deletions(-) diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index 2ef48b5..f86bfd3 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -139,8 +139,7 @@ enum S60PluginFuncOrdinals S60Plugin_GetLongDateFormatSpec = 3, S60Plugin_GetShortDateFormatSpec = 4, S60Plugin_LocalizedDirectoryName = 5, - S60Plugin_GetSystemDrive = 6, - S60Plugin_RefreshLocaleInfo = 7 + S60Plugin_GetSystemDrive = 6 }; Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 93df45d..8a55bad 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -69,7 +69,6 @@ # include # include "qeventdispatcher_symbian_p.h" # include "private/qcore_symbian_p.h" -# include "private/qlocale_p.h" #elif defined(Q_OS_UNIX) # if !defined(QT_NO_GLIB) # include "qeventdispatcher_glib_p.h" @@ -2602,13 +2601,4 @@ int QCoreApplication::loopLevel() \sa Q_OBJECT, QObject::tr(), QObject::trUtf8() */ -#if defined(Q_OS_SYMBIAN) -void QCoreApplicationPrivate::_q_symbianRegisterLocaleNotifier() -{ - QLocalePrivate::symbianRegisterLocaleNotifier(); -} -#endif - QT_END_NAMESPACE - -#include "moc_qcoreapplication.cpp" diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 152a775..097b8b4 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -196,10 +196,6 @@ private: static QCoreApplication *self; -#if defined(Q_OS_SYMBIAN) - Q_PRIVATE_SLOT(d_func(), void _q_symbianRegisterLocaleNotifier()) -#endif - Q_DISABLE_COPY(QCoreApplication) friend class QEventDispatcherUNIXPrivate; diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 39e50c4..bf43f88 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -122,10 +122,6 @@ public: static uint attribs; static inline bool testAttribute(uint flag) { return attribs & (1 << flag); } - -#if defined(Q_OS_SYMBIAN) - void _q_symbianRegisterLocaleNotifier(); -#endif }; QT_END_NAMESPACE diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 22114c2..4a66b92 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -129,10 +129,6 @@ inline bool isascii(int c) } #endif -#if defined(Q_OS_SYMBIAN) -void symbianUpdateSystemPrivate(); -#endif - /****************************************************************************** ** Helpers for accessing Qt locale database */ @@ -1392,8 +1388,7 @@ QSystemLocale::QSystemLocale() /*! \internal */ QSystemLocale::QSystemLocale(bool) -{ -} +{ } /*! Deletes the object. @@ -1412,29 +1407,16 @@ static const QSystemLocale *systemLocale() { if (_systemLocale) return _systemLocale; -#if defined(Q_OS_SYMBIAN) - symbianInitSystemLocale(); -#endif return QSystemLocale_globalSystemLocale(); } -void QLocalePrivate::updateSystemPrivate(bool initialize) +void QLocalePrivate::updateSystemPrivate() { const QSystemLocale *sys_locale = systemLocale(); if (!system_lp) system_lp = globalLocalePrivate(); *system_lp = *sys_locale->fallbackLocale().d(); - system_lp->m_language_id = 0; -#if defined(Q_OS_SYMBIAN) - RDebug::Print(_L("updateSystemPrivate")); -#endif - if (!initialize) - return; - -#if defined(Q_OS_SYMBIAN) - symbianUpdateSystemPrivate(); -#endif QVariant res = sys_locale->query(QSystemLocale::LanguageId, QVariant()); if (!res.isNull()) system_lp->m_language_id = res.toInt(); @@ -1464,12 +1446,12 @@ void QLocalePrivate::updateSystemPrivate(bool initialize) } #endif -static const QLocalePrivate *systemPrivate(bool initialize = true) +static const QLocalePrivate *systemPrivate() { #ifndef QT_NO_SYSTEMLOCALE // copy over the information from the fallback locale and modify if (!system_lp || system_lp->m_language_id == 0) - QLocalePrivate::updateSystemPrivate(initialize); + QLocalePrivate::updateSystemPrivate(); return system_lp; #else @@ -1477,10 +1459,10 @@ static const QLocalePrivate *systemPrivate(bool initialize = true) #endif } -static const QLocalePrivate *defaultPrivate(bool initialize = true) +static const QLocalePrivate *defaultPrivate() { if (!default_lp) - default_lp = systemPrivate(initialize); + default_lp = systemPrivate(); return default_lp; } @@ -2187,7 +2169,7 @@ QLocale::QLocale() : v(0) { p.numberOptions = default_number_options; - p.index = localePrivateIndex(defaultPrivate(false)); + p.index = localePrivateIndex(defaultPrivate()); } /*! @@ -2217,7 +2199,7 @@ QLocale::QLocale(Language language, Country country) // If not found, should default to system if (d->languageId() == QLocale::C && language != QLocale::C) { p.numberOptions = default_number_options; - p.index = localePrivateIndex(defaultPrivate(false)); + p.index = localePrivateIndex(defaultPrivate()); } else { p.numberOptions = 0; p.index = localePrivateIndex(d); @@ -2301,7 +2283,6 @@ void QLocale::setDefault(const QLocale &locale) */ QLocale::Language QLocale::language() const { - systemPrivate(); // make sure inline data is initialized from the system. return Language(d()->languageId()); } @@ -2312,7 +2293,6 @@ QLocale::Language QLocale::language() const */ QLocale::Country QLocale::country() const { - systemPrivate(); // make sure inline data is initialized from the system. return Country(d()->countryId()); } @@ -3041,7 +3021,6 @@ QDateTime QLocale::toDateTime(const QString &string, const QString &format) cons */ QChar QLocale::decimalPoint() const { - systemPrivate(); // make sure inline data is initialized from the system. return d()->decimal(); } @@ -3052,7 +3031,6 @@ QChar QLocale::decimalPoint() const */ QChar QLocale::groupSeparator() const { - systemPrivate(); // make sure inline data is initialized from the system. return d()->group(); } @@ -3063,7 +3041,6 @@ QChar QLocale::groupSeparator() const */ QChar QLocale::percent() const { - systemPrivate(); // make sure inline data is initialized from the system. return d()->percent(); } @@ -3074,7 +3051,6 @@ QChar QLocale::percent() const */ QChar QLocale::zeroDigit() const { - systemPrivate(); // make sure inline data is initialized from the system. return d()->zero(); } @@ -3085,7 +3061,6 @@ QChar QLocale::zeroDigit() const */ QChar QLocale::negativeSign() const { - systemPrivate(); // make sure inline data is initialized from the system. return d()->minus(); } @@ -3096,7 +3071,6 @@ QChar QLocale::negativeSign() const */ QChar QLocale::positiveSign() const { - systemPrivate(); // make sure inline data is initialized from the system. return d()->plus(); } @@ -3107,7 +3081,6 @@ QChar QLocale::positiveSign() const */ QChar QLocale::exponential() const { - systemPrivate(); // make sure inline data is initialized from the system. return d()->exponential(); } diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index 63e9e0f..0123a6e 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -132,10 +132,7 @@ public: CharBuff *result) const; inline char digitToCLocale(const QChar &c) const; - static void updateSystemPrivate(bool initialize = true); -#if defined(Q_OS_SYMBIAN) - static void symbianRegisterLocaleNotifier(); -#endif + static void updateSystemPrivate(); enum NumberMode { IntegerMode, DoubleStandardMode, DoubleScientificMode }; bool validateChars(const QString &str, NumberMode numMode, QByteArray *buff, int decDigits = -1) const; diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp index c4ad67c..1273d06 100644 --- a/src/corelib/tools/qlocale_symbian.cpp +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -46,94 +46,10 @@ #include #include -#include -#include #include "private/qcore_symbian_p.h" -#include "private/qcoreapplication_p.h" -#include "qlocale_p.h" -#include "qdebug.h" - -QT_BEGIN_NAMESPACE - -class CLocaleChangeNotifier : public CActive -{ -public: - static CLocaleChangeNotifier *NewL(); - ~CLocaleChangeNotifier(); - -private: - CLocaleChangeNotifier(); - void ConstructL(); - void RunL(); - void DoCancel(); - -private: - RChangeNotifier changeNotifier; -}; - -static CLocaleChangeNotifier *qt_changeNotifier = NULL; - -CLocaleChangeNotifier *CLocaleChangeNotifier::NewL() -{ - CLocaleChangeNotifier *self = new (ELeave) CLocaleChangeNotifier(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; -} - -CLocaleChangeNotifier::CLocaleChangeNotifier() - : CActive(CActive::EPriorityStandard) -{ -} -CLocaleChangeNotifier::~CLocaleChangeNotifier() -{ - Cancel(); - changeNotifier.Close(); -} - -void CLocaleChangeNotifier::ConstructL() -{ - changeNotifier.Create(); - CActiveScheduler::Add(this); - SetActive(); -} - -void CLocaleChangeNotifier::DoCancel() -{ - changeNotifier.LogonCancel(); -} - -void CLocaleChangeNotifier::RunL() -{ - SetActive(); - if (changeNotifier.Logon(iStatus) == KErrNone) { - if (iStatus.Int() == EChangesLocale) { - RDebug::Print(_L("notifier:locale changed")); - QT_TRYCATCH_LEAVING(QLocalePrivate::updateSystemPrivate()); - } else { - RDebug::Print(_L("notifier:something else changed")); - } - } else { - RDebug::Print(_L("notifier:logon failed")); - } -} - -static void qt_cleanupLocaleNotifier() -{ - delete qt_changeNotifier; - qt_changeNotifier = NULL; -} - -void QLocalePrivate::symbianRegisterLocaleNotifier() -{ - if (!qt_changeNotifier) { - QT_TRAP_THROWING(qt_changeNotifier = CLocaleChangeNotifier::NewL()); - qAddPostRoutine(qt_cleanupLocaleNotifier); - } -} +QT_BEGIN_NAMESPACE // Located in qlocale.cpp extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry); @@ -149,7 +65,6 @@ static FormatFunc ptrTimeFormatL = NULL; static FormatSpecFunc ptrGetTimeFormatSpec = NULL; static FormatSpecFunc ptrGetLongDateFormatSpec = NULL; static FormatSpecFunc ptrGetShortDateFormatSpec = NULL; -static FormatSpecFunc ptrRefreshLocaleInfo = NULL; // Default functions if functions cannot be resolved static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&) @@ -299,8 +214,6 @@ static const char *jp_locale_dep[] = { */ static QString s60ToQtFormat(const QString &sys_fmt) { - RDebug::Print(_L("Time Format \"%S\""), &timeFormat); - TLocale *locale = _s60Locale.GetLocale(); QString result; @@ -766,8 +679,6 @@ static QString symbianDateFormat(bool short_format) dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale)); } - RDebug::Print(_L("symDateFormat: \"%S\""), &dateFormat); - return s60ToQtFormat(qt_TDesC2QString(dateFormat)); } @@ -777,8 +688,6 @@ static QString symbianDateFormat(bool short_format) */ static QString symbianTimeFormat() { - TPtrC timeFormat = ptrGetTimeFormatSpec(_s60Locale); - RDebug::Print(_L("symTimeFormat: \"%S\""), &timeFormat); return s60ToQtFormat(qt_TDesC2QString(ptrGetTimeFormatSpec(_s60Locale))); } @@ -862,35 +771,22 @@ static QLocale::MeasurementSystem symbianMeasurementSystem() return QLocale::MetricSystem; } -void symbianUpdateSystemPrivate() +QLocale QSystemLocale::fallbackLocale() const { - RDebug::Print(_L("symbianUpdateSystemPrivate")); // load system data before query calls - _s60Locale.LoadSystemSettings(); - if (ptrRefreshLocaleInfo) - ptrRefreshLocaleInfo(); -} - -void symbianInitSystemLocale() -{ - RDebug::Print(_L("symbianInitSystemLocale")); static QBasicAtomicInt initDone = Q_BASIC_ATOMIC_INITIALIZER(0); if (initDone.testAndSetRelaxed(0, 1)) { - if (!qt_changeNotifier) { - QMetaObject::invokeMethod(qApp, SLOT(_q_symbianRegisterLocaleNotifier()), Qt::AutoConnection); - } + _s60Locale.LoadSystemSettings(); // Initialize platform version dependent function pointers ptrTimeFormatL = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL)); + (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL)); ptrGetTimeFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec)); + (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec)); ptrGetLongDateFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec)); + (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec)); ptrGetShortDateFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec)); - ptrRefreshLocaleInfo = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_RefreshLocaleInfo)); + (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec)); if (!ptrTimeFormatL) ptrTimeFormatL = &defaultTimeFormatL; if (!ptrGetTimeFormatSpec) @@ -905,10 +801,7 @@ void symbianInitSystemLocale() } while(initDone != 2) QThread::yieldCurrentThread(); -} -QLocale QSystemLocale::fallbackLocale() const -{ TLanguage lang = User::Language(); QString locale = QLatin1String(qt_symbianLocaleName(lang)); return QLocale(locale); diff --git a/src/plugins/s60/src/qlocale_3_1.cpp b/src/plugins/s60/src/qlocale_3_1.cpp index d597861..beeee7f 100644 --- a/src/plugins/s60/src/qlocale_3_1.cpp +++ b/src/plugins/s60/src/qlocale_3_1.cpp @@ -50,7 +50,6 @@ _LIT(KLocaleIndependent, "%F"); static TBuf<10> dateFormat; static TBuf<10> timeFormat; -#define _DEBUG static void initialiseDateFormat() { if(dateFormat.Length()) @@ -147,10 +146,3 @@ EXPORT_C TPtrC defaultGetShortDateFormatSpec(TExtendedLocale&) initialiseDateFormat(); return TPtrC(dateFormat); } - -EXPORT_C void refreshLocaleInfo() -{ - // clear the buffers, so next time we re-read data from the system. - dateFormat.Zero(); - timeFormat.Zero(); -} -- cgit v0.12 From e1706eab16a4cd7f64665249717cc293d3a1ce93 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 16 Dec 2009 13:14:15 +0100 Subject: Fixes: Ensure QMAKE_LFLAGS+=/MACHINE:X64 works for vcproj files RevBy: Marius SO Details: It worked fine for Makefiles since no checking is done of the flags. Now its fixed so it works for vcproj files too making it easier for people to build 64bit targets in Visual Studio. --- qmake/generators/win32/msvc_objectmodel.cpp | 4 +++- qmake/generators/win32/msvc_objectmodel.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 7dc456e..593a075 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1394,8 +1394,10 @@ bool VCLinkerTool::parseOption(const char* option) case 0x0005bb6: // X86 TargetMachine = machineX86; break; - // so we put the others in AdditionalOptions... case 0x0005b94: // X64 + TargetMachine = machineX64; + break; + // so we put the others in AdditionalOptions... case 0x0046063: // AM33 case 0x000466d: // ARM case 0x0004795: // CEE diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index d178d30..f7fdf3a 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -298,7 +298,8 @@ enum linkProgressOption { }; enum machineTypeOption { machineNotSet, - machineX86 + machineX86, + machineX64 = 17 }; enum midlCharOption { midlCharUnsigned, -- cgit v0.12 From 0568fb9f428a84a344baaa5c53395db4b99f082c Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 16 Dec 2009 13:14:12 +0100 Subject: Text cursor is not shown properly in line edits on Mac OS X. The mac stlye disables the blinking cursor when there is a selection in the line edit. The cursor is not shown back when this selection is removed (either by mouse or key press events). This patch watches the selection changed signal from the line control and updates the cursor status accordingly. Task-number: QTBUG-6378 Reviewed-by: Olivier Goffart --- src/gui/widgets/qlineedit.h | 1 + src/gui/widgets/qlineedit_p.cpp | 17 ++++++++++++++++- src/gui/widgets/qlineedit_p.h | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qlineedit.h b/src/gui/widgets/qlineedit.h index 594e488..3f159f6 100644 --- a/src/gui/widgets/qlineedit.h +++ b/src/gui/widgets/qlineedit.h @@ -288,6 +288,7 @@ private: #ifdef QT_KEYPAD_NAVIGATION Q_PRIVATE_SLOT(d_func(), void _q_editFocusChange(bool)) #endif + Q_PRIVATE_SLOT(d_func(), void _q_selectionChanged()) }; #endif // QT_NO_LINEEDIT diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 4437fef..23ab817 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -126,6 +126,21 @@ void QLineEditPrivate::_q_editFocusChange(bool e) } #endif +void QLineEditPrivate::_q_selectionChanged() +{ + Q_Q(QLineEdit); + if (control->preeditAreaText().isEmpty()) { + QStyleOptionFrameV2 opt; + q->initStyleOption(&opt); + bool showCursor = control->hasSelectedText() ? + q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q): + true; + setCursorVisible(showCursor); + } + + emit q->selectionChanged(); +} + void QLineEditPrivate::init(const QString& txt) { Q_Q(QLineEdit); @@ -138,7 +153,7 @@ void QLineEditPrivate::init(const QString& txt) QObject::connect(control, SIGNAL(cursorPositionChanged(int,int)), q, SLOT(_q_cursorPositionChanged(int,int))); QObject::connect(control, SIGNAL(selectionChanged()), - q, SIGNAL(selectionChanged())); + q, SLOT(_q_selectionChanged())); QObject::connect(control, SIGNAL(accepted()), q, SIGNAL(returnPressed())); QObject::connect(control, SIGNAL(editingFinished()), diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h index dc648e8..f13dce2 100644 --- a/src/gui/widgets/qlineedit_p.h +++ b/src/gui/widgets/qlineedit_p.h @@ -128,7 +128,7 @@ public: #ifdef QT_KEYPAD_NAVIGATION void _q_editFocusChange(bool); #endif - + void _q_selectionChanged(); #ifndef QT_NO_COMPLETER void _q_completionHighlighted(QString); #endif -- cgit v0.12 From f9d962ac5d738b26d3c939f83fe6d32bd3202535 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 10 Dec 2009 17:52:18 +0100 Subject: Do not call macToQtFormat twice in QLocale. We already convert date/time format inside the getMacDateFormat, so no reason to do it again later. Reviewed-by: Prasanth --- src/corelib/tools/qlocale.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 4a66b92..8645f17 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1187,14 +1187,14 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const } case DateFormatLong: case DateFormatShort: - return macToQtFormat(getMacDateFormat(type == DateFormatShort + return getMacDateFormat(type == DateFormatShort ? kCFDateFormatterShortStyle - : kCFDateFormatterLongStyle)); + : kCFDateFormatterLongStyle); case TimeFormatLong: case TimeFormatShort: - return macToQtFormat(getMacTimeFormat(type == TimeFormatShort + return getMacTimeFormat(type == TimeFormatShort ? kCFDateFormatterShortStyle - : kCFDateFormatterLongStyle)); + : kCFDateFormatterLongStyle); case DayNameLong: case DayNameShort: return macDayName(in.toInt(), (type == DayNameShort)); -- cgit v0.12 From cc598ec6b0d396ab11de20a3f21064522578960c Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 11 Dec 2009 17:54:22 +0100 Subject: Doc fix: mark QFileOpenEvent::url to be available since 4.6 Reviewed-by: trustme --- src/gui/kernel/qevent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index c4a25e1..e836eda 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3023,7 +3023,7 @@ QShowEvent::~QShowEvent() This event is only used to notify the application of a request. It may be safely ignored. - \note This class is currently supported for Mac Os X only. + \note This class is currently supported for Mac OS X only. */ /*! @@ -3066,6 +3066,8 @@ QFileOpenEvent::~QFileOpenEvent() \fn QUrl QFileOpenEvent::url() const Returns the url that is being opened. + + \since 4.6 */ QUrl QFileOpenEvent::url() const { -- cgit v0.12 From 6d84ab27595ad9b570ccaf5a3230e83aa878ef06 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 15 Dec 2009 17:07:13 +0100 Subject: An optimisation to QTextStream Using QLocale::operator== is faster than comparing languages, because when getting a language from a default constructed QLocale object, it initializes the system locale and quieries the system which languge it supports. Reviewed-by: Olivier Goffart --- src/corelib/io/qtextstream.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 594718e..47f340c 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -440,7 +440,7 @@ QTextStreamPrivate::QTextStreamPrivate(QTextStream *q_ptr) readConverterSavedState(0), #endif readConverterSavedStateOffset(0), - locale(QLocale::C) + locale(QLocale::c()) { this->q_ptr = q_ptr; reset(); @@ -1806,8 +1806,7 @@ QTextStreamPrivate::NumberParsingStatus QTextStreamPrivate::getNumber(qulonglong if (ch.isDigit()) { val *= 10; val += ch.digitValue(); - } else if (locale.language() != QLocale::C - && ch == locale.groupSeparator()) { + } else if (locale != QLocale::c() && ch == locale.groupSeparator()) { continue; } else { ungetChar(ch); @@ -1958,7 +1957,7 @@ bool QTextStreamPrivate::getReal(double *f) else if (lc == locale.negativeSign().toLower() || lc == locale.positiveSign().toLower()) input = InputSign; - else if (locale.language() != QLocale::C // backward-compatibility + else if (locale != QLocale::c() // backward-compatibility && lc == locale.groupSeparator().toLower()) input = InputDigit; // well, it isn't a digit, but no one cares. else @@ -2283,7 +2282,7 @@ bool QTextStreamPrivate::putNumber(qulonglong number, bool negative) // add thousands group separators. For backward compatibility we // don't add a group separator for C locale. - if (locale.language() != QLocale::C) + if (locale != QLocale::c()) flags |= QLocalePrivate::ThousandsGroup; const QLocalePrivate *dd = locale.d(); -- cgit v0.12 From cbe70d58bc1667b2e09f78a5d4427e7d071a2354 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 16 Dec 2009 15:44:11 +0100 Subject: Fixed wheel event delivery in graphicsview. We don't need to flip the y-coordinate of window- and view-local coordinates because they are flipped already. Reviewed-by: Prasanth --- src/gui/kernel/qcocoaview_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index ddd8ca6..6c06746 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -777,7 +777,7 @@ extern "C" { NSPoint windowPoint = [theEvent locationInWindow]; NSPoint globalPoint = [[theEvent window] convertBaseToScreen:windowPoint]; NSPoint localPoint = [self convertPoint:windowPoint fromView:nil]; - QPoint qlocal = QPoint(localPoint.x, flipYCoordinate(localPoint.y)); + QPoint qlocal = QPoint(localPoint.x, localPoint.y); QPoint qglobal = QPoint(globalPoint.x, flipYCoordinate(globalPoint.y)); Qt::MouseButtons buttons = QApplication::mouseButtons(); bool wheelOK = false; -- cgit v0.12 From 11ec7b3694feed8514f9559c7b732ad6217e88c6 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 17 Dec 2009 10:27:37 +1000 Subject: Disable benchlibwalltime test. The test is inherently dependent on the timing behavior of the test machine. For now, it seems too difficult to ensure this works everywhere. --- tests/auto/selftests/tst_selftests.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 579f4eb..ed3b08e 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -182,12 +182,12 @@ void tst_Selftests::runSubTest_data() #endif QTest::newRow("benchlibeventcounter") << "benchlibeventcounter" << QStringList("-eventcounter"); QTest::newRow("benchliboptions") << "benchliboptions" << QStringList("-eventcounter"); - QTest::newRow("benchlibwalltime") << "benchlibwalltime" << QStringList(); - //### This test is affected by the speed of the CPU and whether the tick counter is - //### monotonically increasing. It won't work on some machines so leave it off by default. + //### These tests are affected by timing and whether the CPU tick counter is + //### monotonically increasing. They won't work on some machines so leave them off by default. //### Feel free to uncomment for your own testing. #if 0 + QTest::newRow("benchlibwalltime") << "benchlibwalltime" << QStringList(); QTest::newRow("benchlibtickcounter") << "benchlibtickcounter" << QStringList("-tickcounter"); #endif -- cgit v0.12 From bc01bb10da23d0d2308cf02a16947be836bc9a21 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 17 Dec 2009 10:20:46 +0100 Subject: Avoid timer starvation when handling many X11 events After commit d0d0fdb8e46351b4ab8492de31e5363ef6662b57, timers are normally run at idle priority. This makes it possible for the X11 handler to starve timers indefinitely. Fix this by enforcing one normal priority pass of the timer source after we have processed all X11 events. This has the added benefit of keeping animation timers smooth and consistent, which is the intention of this change. Reviewed-by: Jens Bache-Wiig --- src/corelib/kernel/qeventdispatcher_glib.cpp | 5 +++++ src/corelib/kernel/qeventdispatcher_glib_p.h | 2 ++ src/gui/kernel/qguieventdispatcher_glib.cpp | 2 ++ 3 files changed, 9 insertions(+) diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 665b73e..16871c3 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -341,6 +341,11 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context) g_source_attach(&idleTimerSource->source, mainContext); } +void QEventDispatcherGlibPrivate::runTimersOnceWithNormalPriority() +{ + timerSource->runWithIdlePriority = false; +} + QEventDispatcherGlib::QEventDispatcherGlib(QObject *parent) : QAbstractEventDispatcher(*(new QEventDispatcherGlibPrivate), parent) { diff --git a/src/corelib/kernel/qeventdispatcher_glib_p.h b/src/corelib/kernel/qeventdispatcher_glib_p.h index 6a4e726..57cbf94 100644 --- a/src/corelib/kernel/qeventdispatcher_glib_p.h +++ b/src/corelib/kernel/qeventdispatcher_glib_p.h @@ -110,6 +110,8 @@ public: GSocketNotifierSource *socketNotifierSource; GTimerSource *timerSource; GIdleTimerSource *idleTimerSource; + + void runTimersOnceWithNormalPriority(); }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qguieventdispatcher_glib.cpp b/src/gui/kernel/qguieventdispatcher_glib.cpp index f8a638c..a252499 100644 --- a/src/gui/kernel/qguieventdispatcher_glib.cpp +++ b/src/gui/kernel/qguieventdispatcher_glib.cpp @@ -152,6 +152,8 @@ static gboolean x11EventSourceDispatch(GSource *s, GSourceFunc callback, gpointe out: + source->d->runTimersOnceWithNormalPriority(); + if (callback) callback(user_data); return true; -- cgit v0.12