summaryrefslogtreecommitdiffstats
path: root/tests/auto
stat options
Period:
Authors:

Commits per author per week (path 'tests/auto')

AuthorW43 2024W44 2024W45 2024W46 2024Total
Total00000
ption value='0' selected='selected'>unified
authorMartin Jones <martin.jones@nokia.com>2010-03-25 22:09:36 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-25 22:09:36 (GMT)
commit11b9190a182c5f3c1055c100145b02a3975509ed (patch)
tree2c664ad92363204c320e23f9d1e6ca29505eaf2e
parent03686225036ebfc5cf78e3fcc66f5810a140c7d2 (diff)
parent3671dbf34940e166b747b6f8f3f5758fd486073c (diff)
downloadQt-11b9190a182c5f3c1055c100145b02a3975509ed.zip
Qt-11b9190a182c5f3c1055c100145b02a3975509ed.tar.gz
Qt-11b9190a182c5f3c1055c100145b02a3975509ed.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts: src/declarative/graphicsitems/qdeclarativeitem.cpp
Diffstat
-rw-r--r--config.tests/unix/icd/icd.cpp55
-rw-r--r--config.tests/unix/icd/icd.pro3
-rwxr-xr-xconfigure48
-rw-r--r--demos/declarative/minehunt/minehunt.cpp18
-rw-r--r--dist/changes-4.7.010
-rw-r--r--doc/src/declarative/extending.qdoc16
-rw-r--r--doc/src/declarative/integrating.qdoc4
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc87
-rw-r--r--doc/src/declarative/qtprogrammers.qdoc2
-rw-r--r--doc/src/examples/bearercloud.qdoc197
-rw-r--r--doc/src/examples/bearermonitor.qdoc49
-rw-r--r--doc/src/examples/qtscriptcustomclass.qdoc13
-rw-r--r--doc/src/getting-started/examples.qdoc2
-rw-r--r--doc/src/images/bearercloud-example.pngbin0 -> 37582 bytes
-rw-r--r--doc/src/images/bearermonitor-example.pngbin0 -> 34862 bytes
-rw-r--r--doc/src/network-programming/bearermanagement.qdoc286
-rw-r--r--doc/src/network-programming/qtnetwork.qdoc30
-rw-r--r--doc/src/snippets/code/src_gui_image_qicon.cpp4
-rw-r--r--doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp9
-rw-r--r--doc/src/snippets/qelapsedtimer/main.cpp112
-rw-r--r--doc/src/snippets/qelapsedtimer/qelapsedtimer.pro2
-rw-r--r--doc/src/sql-programming/sql-driver.qdoc67
-rw-r--r--examples/network/bearercloud/bearercloud.h4
-rw-r--r--examples/network/bearercloud/cloud.cpp4
-rw-r--r--examples/network/bearercloud/cloud.h8
-rw-r--r--examples/network/bearermonitor/sessionwidget.cpp9
-rw-r--r--examples/network/bearermonitor/sessionwidget.h2
-rw-r--r--examples/script/customclass/bytearrayclass.cpp17
-rw-r--r--examples/script/customclass/bytearrayclass.h2
-rw-r--r--mkspecs/common/symbian/symbian.conf7
-rw-r--r--mkspecs/linux-g++-maemo/qmake.conf3
-rw-r--r--qmake/generators/makefile.cpp5
-rw-r--r--src/3rdparty/harfbuzz/src/Makefile.am3
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-greek.c442
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp1
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h1
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp2
-rw-r--r--src/3rdparty/harfbuzz/tests/shaping/main.cpp127
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/config.h2
-rw-r--r--src/3rdparty/phonon/gstreamer/glrenderer.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro3
-rw-r--r--src/corelib/animation/qabstractanimation.cpp1
-rw-r--r--src/corelib/animation/qabstractanimation_p.h57
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/corelib/global/qnamespace.qdoc4
-rw-r--r--src/corelib/io/qdir.cpp6
-rw-r--r--src/corelib/io/qdir.h4
-rw-r--r--src/corelib/io/qdiriterator.cpp6
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp2
-rw-r--r--src/corelib/io/qfsfileengine.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_p.h4
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp28
-rw-r--r--src/corelib/io/qprocess.cpp6
-rw-r--r--src/corelib/io/qprocess_unix.cpp8
-rw-r--r--src/corelib/kernel/qcore_unix.cpp65
-rw-r--r--src/corelib/kernel/qcore_unix_p.h4
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp9
-rw-r--r--src/corelib/kernel/qtranslator.cpp4
-rw-r--r--src/corelib/statemachine/qstate.cpp18
-rw-r--r--src/corelib/statemachine/qstate.h3
-rw-r--r--src/corelib/thread/qthread.cpp4
-rw-r--r--src/corelib/thread/qthread_unix.cpp107
-rw-r--r--src/corelib/tools/qdatetime.cpp353
-rw-r--r--src/corelib/tools/qdatetime.h2
-rw-r--r--src/corelib/tools/qelapsedtimer.cpp251
-rw-r--r--src/corelib/tools/qelapsedtimer.h93
-rw-r--r--src/corelib/tools/qelapsedtimer_generic.cpp178
-rw-r--r--src/corelib/tools/qelapsedtimer_mac.cpp126
-rw-r--r--src/corelib/tools/qelapsedtimer_symbian.cpp131
-rw-r--r--src/corelib/tools/qelapsedtimer_unix.cpp179
-rw-r--r--src/corelib/tools/qelapsedtimer_win.cpp135
-rw-r--r--src/corelib/tools/qlocale.cpp56
-rw-r--r--src/corelib/tools/qlocale.h57
-rw-r--r--src/corelib/tools/qlocale_data_p.h6093
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp11
-rw-r--r--src/corelib/tools/qstringlist.cpp2
-rw-r--r--src/corelib/tools/qtimeline.cpp4
-rw-r--r--src/corelib/tools/tools.pri8
-rw-r--r--src/dbus/qdbusmarshaller.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp14
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h6
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp12
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp248
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp8
-rw-r--r--src/gui/dialogs/qfileinfogatherer_p.h5
-rw-r--r--src/gui/dialogs/qprogressdialog.cpp4
-rw-r--r--src/gui/dialogs/qwizard.cpp205
-rw-r--r--src/gui/dialogs/qwizard.h5
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp6
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp16
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h5
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp2
-rw-r--r--src/gui/itemviews/qtreeview.cpp22
-rw-r--r--src/gui/kernel/qapplication.cpp7
-rw-r--r--src/gui/kernel/qapplication_win.cpp4
-rw-r--r--src/gui/kernel/qapplication_x11.cpp9
-rw-r--r--src/gui/kernel/qclipboard_x11.cpp15
-rw-r--r--src/gui/kernel/qcocoamenuloader_mac.mm3
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h20
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm63
-rw-r--r--src/gui/kernel/qcursor_x11.cpp68
-rw-r--r--src/gui/kernel/qdnd_win.cpp16
-rw-r--r--src/gui/kernel/qdnd_x11.cpp12
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm8
-rw-r--r--src/gui/kernel/qeventdispatcher_mac_p.h1
-rw-r--r--src/gui/kernel/qgesture_p.h4
-rw-r--r--src/gui/kernel/qkeysequence.cpp35
-rw-r--r--src/gui/kernel/qstandardgestures.cpp7
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm7
-rw-r--r--src/gui/kernel/qt_x11_p.h2
-rw-r--r--src/gui/kernel/qwidget.cpp4
-rw-r--r--src/gui/kernel/qwidget_mac.mm9
-rw-r--r--src/gui/kernel/qwidget_p.h3
-rw-r--r--src/gui/kernel/qwidget_x11.cpp52
-rw-r--r--src/gui/kernel/qx11embed_x11.cpp4
-rw-r--r--src/gui/painting/qpaintengineex.cpp19
-rw-r--r--src/gui/styles/qmacstyle_mac.mm10
-rw-r--r--src/gui/styles/qplastiquestyle.cpp4
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp2
-rw-r--r--src/gui/styles/qwindowsstyle.cpp2
-rw-r--r--src/gui/styles/qwindowsstyle_p.h4
-rw-r--r--src/gui/styles/qwindowsvistastyle_p.h1
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp8
-rw-r--r--src/gui/text/qtextdocument_p.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp9
-rw-r--r--src/gui/util/qcompleter.cpp2
-rw-r--r--src/gui/widgets/qabstractslider.cpp10
-rw-r--r--src/gui/widgets/qabstractslider_p.h3
-rw-r--r--src/gui/widgets/qeffects.cpp6
-rw-r--r--src/gui/widgets/qlinecontrol.cpp1
-rw-r--r--src/gui/widgets/qmainwindow.cpp2
-rw-r--r--src/gui/widgets/qmenu_mac.mm38
-rw-r--r--src/gui/widgets/qscrollbar.cpp4
-rw-r--r--src/gui/widgets/qsplitter.cpp32
-rw-r--r--src/gui/widgets/qsplitter.h1
-rw-r--r--src/gui/widgets/qtoolbarlayout.cpp4
-rw-r--r--src/gui/widgets/qworkspace.cpp10
-rw-r--r--src/imports/multimedia/qdeclarativeaudio.cpp2
-rw-r--r--src/imports/multimedia/qdeclarativemediabase.cpp10
-rw-r--r--src/imports/multimedia/qdeclarativemediabase_p.h2
-rw-r--r--src/imports/multimedia/qdeclarativevideo.cpp2
-rw-r--r--src/multimedia/audio/qaudioinput_alsa_p.h5
-rw-r--r--src/multimedia/audio/qaudiooutput_alsa_p.h5
-rw-r--r--src/multimedia/base/qpaintervideosurface.cpp34
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp138
-rw-r--r--src/network/access/qnetworkaccessmanager.h17
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h13
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp20
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h4
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp4
-rw-r--r--src/network/bearer/qnetworkconfigmanager.h3
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.h1
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp2
-rw-r--r--src/network/bearer/qnetworkconfiguration_p.h3
-rw-r--r--src/network/bearer/qnetworksession.cpp4
-rw-r--r--src/network/bearer/qnetworksession.h8
-rw-r--r--src/network/bearer/qnetworksession_p.h4
-rw-r--r--src/network/socket/qabstractsocket.cpp10
-rw-r--r--src/network/socket/qhttpsocketengine.cpp6
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp4
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp4
-rw-r--r--src/network/socket/qsocks5socketengine.cpp18
-rw-r--r--src/network/ssl/qsslsocket.cpp10
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp8
-rw-r--r--src/opengl/qglshaderprogram.cpp20
-rw-r--r--src/opengl/qpaintengine_opengl.cpp8
-rw-r--r--src/plugins/bearer/bearer.pro10
-rw-r--r--src/plugins/bearer/corewlan/corewlan.pro2
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.h6
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm492
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp11
-rw-r--r--src/plugins/bearer/icd/icd.pro4
-rw-r--r--src/plugins/bearer/icd/qicdengine.cpp5
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.h7
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp15
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.h2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp4
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.h20
-rw-r--r--src/plugins/bearer/qnetworksession_impl.cpp4
-rw-r--r--src/plugins/bearer/qnetworksession_impl.h2
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp77
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.h13
-rw-r--r--src/plugins/bearer/symbian/symbian.pro18
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp82
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h6
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp396
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.h7
-rw-r--r--src/plugins/phonon/mmf/mmf.pro36
-rw-r--r--src/script/api/qscriptengine.cpp62
-rw-r--r--src/script/api/qscriptengine.h2
-rw-r--r--src/script/api/qscriptengine_p.h1
-rw-r--r--src/script/api/qscriptvalue.cpp14
-rw-r--r--src/script/api/qscriptvalueiterator.cpp1
-rw-r--r--src/script/bridge/qscriptqobject.cpp3
-rw-r--r--src/script/script.pro5
-rw-r--r--src/testlib/qtestcoreelement.h5
-rw-r--r--src/testlib/qtestsystem.h4
-rw-r--r--src/tools/bootstrap/bootstrap.pri2
-rw-r--r--src/tools/bootstrap/bootstrap.pro2
-rw-r--r--src/tools/moc/moc.cpp4
-rw-r--r--src/tools/moc/moc.h7
-rw-r--r--tests/auto/corelib.pro1
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp2
-rw-r--r--tests/auto/guiapplauncher/guiapplauncher.pro3
-rw-r--r--tests/auto/macnativeevents/macnativeevents.pro16
-rw-r--r--tests/auto/macnativeevents/qnativeinput.cpp378
-rw-r--r--tests/auto/macnativeevents/qnativeinput.h228
-rw-r--r--tests/auto/macnativeevents/qnativeinput_mac.cpp382
-rw-r--r--tests/auto/macnativeevents/qnativeplayer.cpp139
-rw-r--r--tests/auto/macnativeevents/qnativeplayer.h92
-rw-r--r--tests/auto/macnativeevents/tst_macnativeevents.cpp81
-rw-r--r--tests/auto/network.pro1
-rw-r--r--tests/auto/other.pro1
-rw-r--r--tests/auto/qdatetime/tst_qdatetime.cpp75
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp48
-rw-r--r--tests/auto/qelapsedtimer/qelapsedtimer.pro13
-rw-r--r--tests/auto/qelapsedtimer/tst_qelapsedtimer.cpp157
-rw-r--r--tests/auto/qfile/tst_qfile.cpp47
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp25
-rw-r--r--tests/auto/qglthreads/qglthreads.pro3
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp52
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp33
-rw-r--r--tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro5
-rw-r--r--tests/auto/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp111
-rw-r--r--tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp8
-rw-r--r--tests/auto/qnetworksession/test/tst_qnetworksession.cpp265
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp19
-rw-r--r--tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp87
-rw-r--r--tests/auto/qshortcut/tst_qshortcut.cpp2
-rw-r--r--tests/auto/qstate/tst_qstate.cpp33
-rw-r--r--tests/auto/qstring/tst_qstring.cpp5
-rw-r--r--tests/auto/qstringlist/tst_qstringlist.cpp10
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp75
-rw-r--r--tests/auto/qtranslator/qtranslator.pro2
-rw-r--r--tests/auto/qtranslator/qtranslator.qrc5
-rw-r--r--tests/auto/qtranslator/tst_qtranslator.cpp19
-rw-r--r--tests/auto/qwidget/qwidget.pro4
-rw-r--r--tests/auto/qwidget_window/qwidget_window.pro3
-rw-r--r--tests/auto/qwizard/tst_qwizard.cpp97
-rw-r--r--tests/manual/qtbug-8933/README7
-rw-r--r--tests/manual/qtbug-8933/main.cpp51
-rw-r--r--tests/manual/qtbug-8933/qtbug-8933.pro16
-rw-r--r--tests/manual/qtbug-8933/widget.cpp99
-rw-r--r--tests/manual/qtbug-8933/widget.h73
-rw-r--r--tests/manual/qtbug-8933/widget.ui33
-rw-r--r--tools/assistant/tools/assistant/bookmarkmanager.cpp5
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp16
-rw-r--r--tools/designer/src/components/formeditor/formeditor.qrc1
-rw-r--r--tools/designer/src/components/formeditor/formwindowmanager.cpp4
-rw-r--r--tools/designer/src/components/formeditor/images/cleartext.pngbin0 -> 760 bytes
-rw-r--r--tools/designer/src/components/propertyeditor/propertyeditor.cpp67
-rw-r--r--tools/designer/src/components/propertyeditor/propertyeditor.h5
-rw-r--r--tools/designer/src/components/widgetbox/widgetbox.cpp5
-rw-r--r--tools/designer/src/designer/qdesigner_actions.cpp10
-rw-r--r--tools/designer/src/lib/shared/filterwidget.cpp160
-rw-r--r--tools/designer/src/lib/shared/filterwidget_p.h52
-rw-r--r--tools/designer/src/lib/shared/qtresourceview.cpp3
-rw-r--r--tools/linguist/linguist/mainwindow.cpp44
-rw-r--r--tools/qdoc3/generator.cpp8
-rw-r--r--tools/qdoc3/helpprojectwriter.cpp61
-rw-r--r--tools/qdoc3/htmlgenerator.cpp2
-rw-r--r--tools/qdoc3/node.cpp12
-rw-r--r--tools/qdoc3/node.h8
-rw-r--r--tools/qdoc3/tree.cpp78
-rw-r--r--translations/qt_da.ts15
-rw-r--r--translations/qt_de.ts2019
-rw-r--r--translations/qt_es.ts15
-rw-r--r--translations/qt_fr.ts15
-rw-r--r--translations/qt_ja_JP.ts15
-rw-r--r--translations/qt_pl.ts15
-rw-r--r--translations/qt_pt.ts15
-rw-r--r--translations/qt_ru.ts15
-rw-r--r--translations/qt_sv.ts15
-rw-r--r--translations/qt_zh_CN.ts15
-rw-r--r--translations/qt_zh_TW.ts15
-rwxr-xr-xutil/local_database/cldr2qlocalexml.py313
-rw-r--r--util/local_database/enumdata.py59
-rw-r--r--util/local_database/locale.xml9217
-rwxr-xr-xutil/local_database/qlocalexml2cpp.py12
-rw-r--r--util/local_database/xpathlite.py152
284 files changed, 13782 insertions, 13970 deletions
diff --git a/config.tests/unix/icd/icd.cpp b/config.tests/unix/icd/icd.cpp
new file mode 100644
index 0000000..e3701ac
--- /dev/null
+++ b/config.tests/unix/icd/icd.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the config.tests 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$
+**
+****************************************************************************/
+
+#include <libicd-network-wlan-dev.h>
+#include <maemo_icd.h>
+#include <iapconf.h>
+//#include <proxyconf.h>
+#include <icd/dbus_api.h>
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+int main(int, char **)
+{
+ dbus_shutdown();
+ return 0;
+}
diff --git a/config.tests/unix/icd/icd.pro b/config.tests/unix/icd/icd.pro
new file mode 100644
index 0000000..d736b41
--- /dev/null
+++ b/config.tests/unix/icd/icd.pro
@@ -0,0 +1,3 @@
+SOURCES = icd.cpp
+CONFIG -= qt
+mac:CONFIG -= app_bundle
diff --git a/configure b/configure
index f41f6e1..3c38763 100755
--- a/configure
+++ b/configure
@@ -789,6 +789,7 @@ CFG_GRAPHICS_SYSTEM=default
CFG_ALSA=auto
CFG_PULSEAUDIO=auto
CFG_COREWLAN=auto
+CFG_ICD=auto
# initalize variables used for installation
QT_INSTALL_PREFIX=
@@ -827,6 +828,10 @@ QT_LIBS_GLIB=
QT_CFLAGS_GSTREAMER=
QT_LIBS_GSTREAMER=
+# flags for icd (Maemo Internet Connection Daemon)
+QT_CFLAGS_ICD=
+QT_LIBS_ICD=
+
#-------------------------------------------------------------------------------
# check SQL drivers, mouse drivers and decorations available in this package
#-------------------------------------------------------------------------------
@@ -945,7 +950,7 @@ while [ "$#" -gt 0 ]; do
shift
VAL=$1
;;
- -prefix|-docdir|-headerdir|-plugindir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
+ -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL="$1"
@@ -3339,7 +3344,7 @@ if [ "$OPT_HELP" = "yes" ]; then
cat <<EOF
Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir <dir>]
- [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-datadir <dir>]
+ [-docdir <dir>] [-headerdir <dir>] [-plugindir <dir> ] [-importdir <dir>] [-datadir <dir>]
[-translationdir <dir>] [-sysconfdir <dir>] [-examplesdir <dir>]
[-demosdir <dir>] [-buildkey <key>] [-release] [-debug]
[-debug-and-release] [-developer-build] [-shared] [-static] [-no-fast] [-fast] [-no-largefile]
@@ -5175,6 +5180,39 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
CFG_PHONON=yes
fi
fi
+
+ # auto-detect icd support
+ if [ "$CFG_GLIB" = "yes" -a "$CFG_ICD" != "no" ]; then
+ # ICD support has a cyclic dependency on Qt.
+ if [ -n "$PKG_CONFIG" ]; then
+ QT_CFLAGS_ICD=`$PKG_CONFIG --cflags dbus-glib-1 gconf-2.0 osso-ic conninet 2>/dev/null`
+ QT_LIBS_ICD=`$PKG_CONFIG --libs dbus-glib-1 gconf-2.0 osso-ic conninet 2>/dev/null`
+ QT_CFLAGS_QTNETWORK=`$PKG_CONFIG --cflags QtNetwork 2>/dev/null`
+ QT_LIBS_QTNETWORK=`$PKG_CONFIG --libs QtNetwork 2>/dev/null`
+ else
+ QT_CFLAGS_QTNETOWRK=
+ QT_LIBS_QTNETWORK=
+ fi
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icd "ICD" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_ICD $QT_LIBS_ICD $QT_CFLAGS_QTNETWORK $QT_LIBS_QTNETWORK; then
+ [ "$CFG_ICD" = "auto" ] && CFG_ICD=yes
+ QMakeVar set QT_CFLAGS_ICD "$QT_CFLAGS_ICD"
+ QMakeVar set QT_LIBS_ICD "$QT_LIBS_ICD"
+ else
+ if [ "$CFG_ICD" = "auto" ]; then
+ CFG_ICD=no
+ elif [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ # CFG_ICD is "yes"
+
+ echo "The ICD Bearer Management plugin cannot be enabled because dbus-glib-1, gconf-2.0, osso-ic or conninet was not found."
+ echo " Turn on verbose messaging (-v) to $0 to see the final report."
+ echo " If you believe this message is in error you may use the continue"
+ echo " switch (-continue) to $0 to continue."
+ exit 101
+ fi
+ fi
+ elif [ "$CFG_GLIB" = "no" ]; then
+ CFG_ICD=no
+ fi
fi # X11/QWS
# x11
@@ -6527,6 +6565,10 @@ if [ "$CFG_COREWLAN" = "yes" ]; then
QT_CONFIG="$QT_CONFIG corewlan"
fi
+if [ "$CFG_ICD" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG icd"
+fi
+
#
# Some Qt modules are too advanced in C++ for some old compilers
# Detect here the platforms where they are known to work.
@@ -7252,6 +7294,7 @@ fi
[ "$CFG_ALSA" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ALSA"
[ "$CFG_PULSEAUDIO" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_PULSEAUDIO"
[ "$CFG_COREWLAN" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_COREWLAN"
+[ "$CFG_ICD" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICD"
# sort QCONFIG_FLAGS for neatness if we can
[ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq`
@@ -7768,6 +7811,7 @@ echo "Pulse Audio support .... $CFG_PULSEAUDIO"
if [ "$PLATFORM_MAC" = "yes" ]; then
echo "CoreWlan support ....... $CFG_COREWLAN"
fi
+echo "ICD support ............ $CFG_ICD"
echo
[ "$CFG_PTMALLOC" != "no" ] && echo "Use ptmalloc ........... $CFG_PTMALLOC"
diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp
index e54508a..a953c5a 100644
--- a/demos/declarative/minehunt/minehunt.cpp
+++ b/demos/declarative/minehunt/minehunt.cpp
@@ -54,16 +54,16 @@ class Tile : public QObject
public:
Tile() : _hasFlag(false), _hasMine(false), _hint(-1), _flipped(false) {}
- Q_PROPERTY(bool hasFlag READ hasFlag WRITE setHasFlag NOTIFY hasFlagChanged);
+ Q_PROPERTY(bool hasFlag READ hasFlag WRITE setHasFlag NOTIFY hasFlagChanged)
bool hasFlag() const { return _hasFlag; }
- Q_PROPERTY(bool hasMine READ hasMine NOTIFY hasMineChanged);
+ Q_PROPERTY(bool hasMine READ hasMine NOTIFY hasMineChanged)
bool hasMine() const { return _hasMine; }
- Q_PROPERTY(int hint READ hint NOTIFY hintChanged);
+ Q_PROPERTY(int hint READ hint NOTIFY hintChanged)
int hint() const { return _hint; }
- Q_PROPERTY(bool flipped READ flipped NOTIFY flippedChanged());
+ Q_PROPERTY(bool flipped READ flipped NOTIFY flippedChanged())
bool flipped() const { return _flipped; }
void setHasFlag(bool flag) {if(flag==_hasFlag) return; _hasFlag = flag; emit hasFlagChanged();}
@@ -91,19 +91,19 @@ class MinehuntGame : public QObject
public:
MinehuntGame();
- Q_PROPERTY(QDeclarativeListProperty<Tile> tiles READ tiles CONSTANT);
+ Q_PROPERTY(QDeclarativeListProperty<Tile> tiles READ tiles CONSTANT)
QDeclarativeListProperty<Tile> tiles();
- Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY isPlayingChanged);
+ Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY isPlayingChanged)
bool isPlaying() {return playing;}
- Q_PROPERTY(bool hasWon READ hasWon NOTIFY hasWonChanged);
+ Q_PROPERTY(bool hasWon READ hasWon NOTIFY hasWonChanged)
bool hasWon() {return won;}
- Q_PROPERTY(int numMines READ numMines NOTIFY numMinesChanged);
+ Q_PROPERTY(int numMines READ numMines NOTIFY numMinesChanged)
int numMines() const{return nMines;}
- Q_PROPERTY(int numFlags READ numFlags NOTIFY numFlagsChanged);
+ Q_PROPERTY(int numFlags READ numFlags NOTIFY numFlagsChanged)
int numFlags() const{return nFlags;}
public slots:
diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0
index 76fa7f8..b9aa64d 100644
--- a/dist/changes-4.7.0
+++ b/dist/changes-4.7.0
@@ -41,6 +41,16 @@ Third party components
* Library *
****************************************************************************
+QtCore
+------
+
+QtGui
+-----
+
+ - QAbstractItemView
+ * Fixed a bug that would cause keyboard searches not to behave
+ properly when used within 400 milliseconds of midnight.
+
- QPrinter
* Obsoleted the slightly confusing setNumCopies() and numCopies()
functions, and replaced them with setCopyCount(), copyCount() and
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index 0ae4f7d..8c096da 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -177,7 +177,7 @@ The guest property declaration looks like this:
\snippet examples/declarative/extending/properties/birthdayparty.h 2
-\l {Extending QML in C++ - Object and List Property Types Example} shows the complete
+\l {Extending QML - Object and List Property Types Example} shows the complete
code used to create the \c BirthdayParty type.
\section1 Inheritance and Coercion
@@ -224,7 +224,7 @@ QML will automatically coerce C++ types when assigning to either an object
property, or to a list property. Only if coercion fails does an assignment
error occur.
-\l {Extending QML in C++ - Inheritance and Coercion Example} shows the complete
+\l {Extending QML - Inheritance and Coercion Example} shows the complete
code used to create the \c Boy and \c Girl types.
\section1 Default Property
@@ -256,7 +256,7 @@ refer to a property declared in the class itself, or a property inherited from a
base class.
\endquotation
-\l {Extending QML in C++ - Default Property Example} shows the complete code used to
+\l {Extending QML - Default Property Example} shows the complete code used to
specify a default property.
\section1 Grouped Properties
@@ -281,7 +281,7 @@ property block - in this case the size, color, brand and price properties.
Grouped property blocks may declared and accessed be recusively.
-\l {Extending QML in C++ - Grouped Properties Example} shows the complete code used to
+\l {Extending QML - Grouped Properties Example} shows the complete code used to
implement the \c shoe property grouping.
\section1 Attached Properties
@@ -373,7 +373,7 @@ creating it if it does not already exist. If \a create is false, the attachment
object will only be returned if it has previously been created.
\endquotation
-\l {Extending QML in C++ - Attached Properties Example} shows the complete code used to
+\l {Extending QML - Attached Properties Example} shows the complete code used to
implement the rsvp attached property.
\section1 Memory Management and QVariant types
@@ -435,7 +435,7 @@ listed in \l {Adding Types}, as well registered object types are permitted as
signal parameter types. Using other types is not an error, but the parameter
value will not be accessible from script.
-\l {Extending QML in C++ - Signal Support Example} shows the complete code used to
+\l {Extending QML - Signal Support Example} shows the complete code used to
implement the onPartyStarted signal property.
\section1 Property Value Sources
@@ -482,7 +482,7 @@ to assign it normally, as though it were a regular QML type. Only if this
assignment fails does the engine call the setTarget() method. This allows
the type to also be used in contexts other than just as a value source.
-\l {Extending QML in C++ - Property Value Source Example} shows the complete code used
+\l {Extending QML - Property Value Source Example} shows the complete code used
implement the HappyBirthday property value source.
\section1 Property Binding
@@ -554,7 +554,7 @@ The CONSTANT attribute should only be used for properties whose value is set,
and finalized, only in the class constructor. All other properties that want
to be used in bindings should have a NOTIFY signal instead.
-\l {Extending QML in C++ - Binding Example} shows the BirthdayParty example updated to
+\l {Extending QML - Binding Example} shows the BirthdayParty example updated to
include NOTIFY signals for use in binding.
\section1 Extension Objects
diff --git a/doc/src/declarative/integrating.qdoc b/doc/src/declarative/integrating.qdoc
index c685d3d..165a735 100644
--- a/doc/src/declarative/integrating.qdoc
+++ b/doc/src/declarative/integrating.qdoc
@@ -103,13 +103,13 @@ and that this approach allows you to integrate new items written in QML
without using the above method.
You can make custom C++ types
-available in QML using the pair of macros listed in \l{Extending QML}.
+available in QML using the pair of macros listed in \l{Extending QML in C++}.
While this is normally only useful for
types that were designed for QML use, in conjunction with the
\l{GraphicsObjectContainer} element QGraphicsWidget subclasses can also be
used effectively (if they were designed, like QGraphicsWidget, to be controllable through Qt's property system).
This way you can write your UI using QML, without having to rewrite your existing items.
-For details on implementing this approach see \l{Extending QML} page for details on exposing your C++ types,
+For details on implementing this approach see \l{Extending QML in C++} page for details on exposing your C++ types,
and the \l{GraphicsObjectContainer} documentation for details about using it to wrap QGraphicsWidgets.
*/
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index b43d0ec..8013b92 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -40,76 +40,75 @@
****************************************************************************/
/*!
-\module QtDeclarative
-\title QtDeclarative Module
-\ingroup modules
+ \module QtDeclarative
+ \title QtDeclarative Module
+ \ingroup modules
-\brief The Qt Declarative module provides a declarative framework for building
-highly dynamic, custom user interfaces.
+ \brief The Qt Declarative module provides a declarative framework
+ for building highly dynamic, custom user interfaces.
-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:
-\code
-#include <QtDeclarative>
-\endcode
+ \code
+ #include <QtDeclarative>
+ \endcode
-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:
-\code
-QT += declarative
-\endcode
-
-For more information on the Qt Declarative module, see the
-\l{declarativeui.html}{Declarative UI} documentation.
+ \code
+ QT += declarative
+ \endcode
+ For more information on the Qt Declarative module, see the
+ \l{declarativeui.html}{Declarative UI} documentation.
*/
/*!
- \macro QML_DECLARE_TYPE(T)
- \relates QDeclarativeEngine
-
- yada yada yada
-
+ \macro QML_DECLARE_TYPE()
+ \relates QDeclarativeEngine
*/
/*!
- \fn int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
- \relates QDeclarativeEngine
+ \fn int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+ \relates QDeclarativeEngine
- This template function registers the C++ type \a T with the QML system, and make it available in
- QML under the name \a qmlName in the import library \a uri version \a versionMajor.versionMajor.
+ This template function registers the C++ type in the QML system with
+ the name \a qmlName. in the library imported from \a uri having the
+ version number composed from \a versionMajor and \a versionMinor.
- Returns the QML type id.
+ Returns the QML type id.
- Example: Register the C++ class \c MinehuntGame as QML type \c Game version 0.1 in the import
- library \c MinehuntCore:
+ Example: Register the C++ class \c MinehuntGame as the QML type
+ named \c Game for version 0.1 in the import library \c MinehuntCore:
- \code
- qmlRegisterType<MinehuntGame>("MinehuntCore", 0, 1, "Game");
- \endcode
+ \code
+ qmlRegisterType<MinehuntGame>("MinehuntCore", 0, 1, "Game");
+ \endcode
*/
/*!
- \fn int qmlRegisterType()
- \relates QDeclarativeEngine
- \overload
+ \fn int qmlRegisterType()
+ \relates QDeclarativeEngine
+ \overload
- This template function registers the C++ type \a T with the QML system. Instances of this type cannot
- be created from the QML system.
+ This template function registers the C++ type in the QML
+ system. Instances of this type cannot be created from the QML
+ system.
- Returns the QML type id.
+ Returns the QML type id.
*/
-/*! \fn int qmlRegisterInterface(const char *typeName)
- \relates QDeclarativeEngine
+/*!
+ \fn int qmlRegisterInterface(const char *typeName)
+ \relates QDeclarativeEngine
- This template function registers the C++ type \a T as interface with the QML system, under the name
- \a typeName.
+ This template function registers the C++ type in the QML system
+ under the name \a typeName.
- Returns the QML type id.
+ Returns the QML type id.
*/
diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc
index ca1d596..05ffeb0 100644
--- a/doc/src/declarative/qtprogrammers.qdoc
+++ b/doc/src/declarative/qtprogrammers.qdoc
@@ -65,7 +65,7 @@ QML provides direct access to the following concepts from Qt:
\o Qt models - used directly in data binding (QAbstractItemModel and next generation QListModelInterface)
\endlist
-Qt knowledge is \e required for \l {Extending QML}, and also for \l{Integrating QML with existing Qt UI code}.
+Qt knowledge is \e required for \l {Extending QML in C++}, and also for \l{Integrating QML with existing Qt UI code}.
\section1 QML Items compared with QWidgets
diff --git a/doc/src/examples/bearercloud.qdoc b/doc/src/examples/bearercloud.qdoc
new file mode 100644
index 0000000..c7acf04
--- /dev/null
+++ b/doc/src/examples/bearercloud.qdoc
@@ -0,0 +1,197 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+/*!
+ \example network/bearercloud
+ \title Bearer Cloud Example
+
+ The Bearer Cloud example shows how to use the Bearer Management API to monitor the
+ connectivity state of the local device.
+
+ \image bearercloud-example.png Screenshot of the Bearer Cloud example
+
+ Bearer Management provides the QNetworkConfigurationManager class which can be used to monitor
+ changes in the available \l {QNetworkConfiguration}{network configurations} and the
+ QNetworkSession class which is used to \l {QNetworkSession::open()}{open} and
+ \l {QNetworkSession::close()}{close} a session bringing a network interface up or down if
+ necessary.
+
+ This example displays all known \l {QNetworkConfiguration}{network configurations} in a cloud
+ orbiting the local device. There are four orbits representing the four possible
+ \l {QNetworkConfiguration::StateFlags}{states} that the network configuration can be in.
+ The closer the orbit the more useful the network configuration is in its current state.
+ The inner orbit is populated with network configurations that are in the
+ \l {QNetworkConfiguration::Active}{Active} state. The second orbit is populated with network
+ configurations that are in the \l {QNetworkConfiguration::Discovered}{Discovered} state. The
+ third orbit is populated with network configurations that are in the
+ \l {QNetworkConfiguration::Defined}{Defined} state. Finally the outer orbit is populated by
+ configurations that are in the \l {QNetworkConfiguration::Undefined}{Undefined} state.
+
+ Hovering the mouse over a network configuration will display information about the network
+ configuration in a tool tip.
+
+ Double clicking on an Active or Discovered network configuration will
+ \l {QNetworkSession::close()}{close} or \l {QNetworkSession::open()}{open} a network session,
+ respectively.
+
+ Lastly you can reorganize the cloud without changing the state of the network configurations by
+ dragging them around.
+
+ This example consists of two main classes, the BearerCloud and Cloud classes. The Cloud class
+ represents a single network session and associated network configuration. The BearerCloud
+ class implements a Graphics View scene and manages the life-cycle of Cloud
+ objects in response to notification signals from QNetworkConfigurationManager.
+
+ \section1 Setting the scene
+
+ When constructing the scene we first calculate some random offsets using the global qsand()
+ and qrand() functions. We will use these offsets to scatter the initial position of new Cloud
+ objects.
+
+ Next we place a text item in the center of the scene to represent the local device and
+ surround it with four concentric circles to help visualize the orbits.
+
+ Finally we connect up the network configuration notification signals and queue the initial
+ population of the scene during the next iteration of the event loop.
+
+ \snippet examples/network/bearercloud/bearercloud.cpp 0
+
+ Populating the scene with the initial list of known network configuration is easy. Iterate
+ over the list returned by QNetworkConfigurationManager::allConfigurations(), calling our
+ configurationAdded() slot on each one.
+
+ We finishing off by calling cloudMoved() to ensure that animations are started.
+
+ \snippet examples/network/bearercloud/bearercloud.cpp 1
+
+ The configurationAdded() slot gets called when a new network configuration is added to the
+ system.
+
+ It stores the \l {QNetworkConfiguration::identifier()}{identifier} of the network
+ configuration in the \e {configStates} map, which is used to keep a count of the number of
+ network configurations in each state. This in turn is used to calculate the initial position
+ of new Cloud objects.
+
+ Next we create a new Cloud object for this network configuration. Set its initial position
+ and store it in the \e {configurations} hash.
+
+ The last step is to add it to the scene by calling QGraphicsScene::addItem().
+
+ \snippet examples/network/bearercloud/bearercloud.cpp 2
+
+ The configurationRemoved() slot gets called when a network configuration is removed from the
+ system.
+
+ First we remove all references to the network configuration from the \e {configStates} and
+ \e {configurations} member variables.
+
+ Next we initiate animation by setting a final scale value on the Cloud object associated with
+ the removed network configuration.
+
+ Finally we flag the Cloud object to delete itself after it has finished animating.
+
+ \snippet examples/network/bearercloud/bearercloud.cpp 3
+
+ The Cloud object will take care of most of the work required when a network configuration
+ changes. All we do in the configurationChanged() slot is update the \e {configStates} member
+ variable.
+
+ \snippet examples/network/bearercloud/bearercloud.cpp 4
+
+
+ \section1 Responding to changes
+
+ Each network session and associated network configuration known to the system is represented in
+ the scene as a Cloud object.
+
+ In the Cloud constructor we first initialize member variables. Then we create a new
+ QNetworkSession object bound to the network configuration. Next we connect the QNetworkSession
+ signals which we use to monitor it for state changes.
+
+ Next we set some QGraphicsItem properties. The QGraphicsItem::ItemIsMovable flag enables mouse
+ interaction with the Cloud object.
+
+ The Cloud object consists of an icon and a text caption, these are constructed here. We will
+ assign values to them later, as these will change as the sessions state changes.
+
+ Next we set the initial animation state and call our newConfigurationActivated() slot to finish
+ setting up the Cloud object based on the state of network session.
+
+ \snippet examples/network/bearercloud/cloud.cpp 0
+
+ The newConfigurationActivated() slot is called when a session has successfully roamed from one
+ access point to another.
+
+ The first thing we do is set the icon, inserting it into a shared SVG renderer cache if it is
+ not already available. Next we set the text caption to the name of the network configuration.
+
+ We then set the position of the icon and text caption so that they are centered horizontally.
+
+ Finally we call our stateChanged() slot.
+
+ \snippet examples/network/bearercloud/cloud.cpp 1
+
+ The stateChanged() slot is called when the session state changes.
+
+ In this slot we set lower the opacity of Cloud objects with network sessions that cannot be
+ \l {QNetworkSession::open()}{opened}, and set a detailed tool tip describing the sessions
+ state.
+
+ \snippet examples/network/bearercloud/cloud.cpp 2
+
+ In our reimplementation of the QGraphicsItem::mouseDoubleClickEvent() function we call
+ QNetworkSession::open() or QNetworkSession::close() to open or close the session in response
+ to a double left click.
+
+ \snippet examples/network/bearercloud/cloud.cpp 3
+
+ As we support the user dragging Cloud objects around we need to restart animations when the
+ position of the Cloud object changes. This is accomplished by reimplementing the
+ QGraphicsItem::itemChanged() function and calling the cloudMoved() function of the BearerCloud
+ object.
+
+ \snippet examples/network/bearercloud/cloud.cpp 4
+
+ The remainder of the code for the Cloud object implements the animations. The
+ calculateForces() function calculates the new position of the Cloud object based on the
+ position of all the other Cloud objects in the scene. The new position is set when the
+ advance() function is called to update the Cloud object for the current animation frame.
+*/
diff --git a/doc/src/examples/bearermonitor.qdoc b/doc/src/examples/bearermonitor.qdoc
new file mode 100644
index 0000000..592d1e5
--- /dev/null
+++ b/doc/src/examples/bearermonitor.qdoc
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+/*!
+ \example network/bearermonitor
+ \title Bearer Monitor Example
+
+ The Bearer Monitor example shows how to use the Bearer Management API.
+
+ \image bearermonitor-example.png Screenshot of the Bearer Monitor example
+*/
diff --git a/doc/src/examples/qtscriptcustomclass.qdoc b/doc/src/examples/qtscriptcustomclass.qdoc
index f825ad9..028c7a6 100644
--- a/doc/src/examples/qtscriptcustomclass.qdoc
+++ b/doc/src/examples/qtscriptcustomclass.qdoc
@@ -120,6 +120,8 @@
this ByteArrayClass object, so that the constructor, when it is invoked, can extract the
pointer and use it to create a new \c{ByteArray} object.
+ \snippet examples/script/customclass/bytearrayclass.cpp 10
+
\snippet examples/script/customclass/bytearrayclass.cpp 1
The newInstance() function isn't part of the QScriptClass API; its purpose is to offer
@@ -128,6 +130,11 @@
QScriptEngine::newObject() will call the prototype() function of our class, ensuring that
the prototype of the new object will be the standard \c{ByteArray} prototype.
+ QScriptEngine::reportAdditionalMemoryCost() is called to inform the script engine of the
+ memory occupied by the QByteArray. This gives the garbage collector a hint that it should
+ perhaps trigger more frequently, possibly freeing up memory associated with large ByteArray
+ objects that are no longer in use.
+
\snippet examples/script/customclass/bytearrayclass.cpp 2
construct() is the native function that will act as a constructor for \c{ByteArray}
@@ -159,6 +166,12 @@
array index that was calculated in the queryProperty() function, enlarge the array if necessary,
and write the given value to the array.
+ \snippet examples/script/customclass/bytearrayclass.cpp 9
+
+ The resize() function is a helper function that resizes the QByteArray to a new size, and,
+ if the new size is greater than the old, reports the additional memory cost to the script
+ engine.
+
\snippet examples/script/customclass/bytearrayclass.cpp 6
The propertyFlags() reimplementation specifies that the \c{length} property can't be deleted,
diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc
index bc6404c..885e96c 100644
--- a/doc/src/getting-started/examples.qdoc
+++ b/doc/src/getting-started/examples.qdoc
@@ -880,6 +880,8 @@
\o \l{network/threadedfortuneserver}{Threaded Fortune Server}\raisedaster
\o \l{network/torrent}{Torrent}
\o \l{network/googlesuggest}{Google Suggest}
+ \o \l{network/bearercloud}{Bearer Cloud}\raisedaster
+ \o \l{network/bearermonitor}{Bearer Monitor}
\endlist
Examples marked with an asterisk (*) are fully documented.
diff --git a/doc/src/images/bearercloud-example.png b/doc/src/images/bearercloud-example.png
new file mode 100644
index 0000000..aaf69df
--- /dev/null
+++ b/doc/src/images/bearercloud-example.png
Binary files differ
diff --git a/doc/src/images/bearermonitor-example.png b/doc/src/images/bearermonitor-example.png
new file mode 100644
index 0000000..1b8a9c3
--- /dev/null
+++ b/doc/src/images/bearermonitor-example.png
Binary files differ
diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc
new file mode 100644
index 0000000..10d697a
--- /dev/null
+++ b/doc/src/network-programming/bearermanagement.qdoc
@@ -0,0 +1,286 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+/*!
+\page bearer-management.html
+
+\title Bearer Management
+\brief An API to control the system's connectivity state.
+
+\ingroup network
+
+Bearer Management controls the connectivity state of the system so that
+the user can start or stop interfaces or roam transparently between
+access points.
+
+\tableofcontents
+
+
+\section1 Overview
+
+The Bearer Management API controls the system's connectivity state. This
+incorporates simple information such as whether the device is online and
+how many interfaces there are as well as enables the application developer
+to start, stop network interfaces and influences other connection specific
+details. Depending on the platform's capabilities it may even provide
+session management so that a network interface remains up for as long as
+clients have a registered interest in them while at the same time
+optimizes the interface's uptime.
+
+This API does not provide support for management of network configurations
+themselves. It is up to the platform to provide infrastructure which
+enables to user to create, edit or delete network configurations.
+
+\section2 The API in Detail
+
+Computer systems manage their network interfaces via a set of configurations.
+Each configuration describes a set of parameters which instruct the system
+how a particular network interface is started. One of the most simplistic
+examples might be an Ethernet configuration that links a network card to a
+DHCP server. A more complex example might be a Wireless LAN configuration
+which may comprise of hardware details such as the WLAN card address,
+WLAN access point details (e.g ESSID, encryption details) and user specific
+information (for example username and password). Once the network interface
+was configured and started according to the configuration blue print,
+multiple applications are free to use this link layer connection/session
+for their own socket operations. Note that the QNetworkConfiguration object
+only provides limited information about the configuration details themselves.
+It's main purpose is to act as a configuration identifier through which link
+layer connections can be created, destroyed and monitored.
+
+QNetworkSession provides two types of use cases. It enables the monitoring of
+physical network interfaces and management of network sessions. Network sessions
+are a common feature on mobile devices where multiple applications
+can request network sessions as they see fit. The system consolidates and tracks
+active network sessions for the same network interface by maintaining the link
+layer connections until the last session has been closed. The subsequent table
+lists the major QNetworkSession functions and how they fit into the session and
+hardware management categories:
+
+\table 60%
+\header \o Interface management \o Session management
+\row \o QNetworkSession::stop() \o QNetworkSession::open()
+\row \o QNetworkSession::interface() \o QNetworkSession::close()
+\row \o QNetworkSession::state() \o QNetworkSession::isOpen()
+\row \o QNetworkSession::bytesWritten() \o QNetworkSession::migrate()
+\row \o QNetworkSession::bytesReceived() \o QNetworkSession::ignore()
+\row \o QNetworkSession::activeTime() \o QNetworkSession::accept()
+\row \o QNetworkSession::stateChanged() \o QNetworkSession::reject()
+\row \o \o QNetworkSession::opened()
+\row \o \o QNetworkSession::closed()
+\endtable
+
+The state of the session represents the state of the underlying access point
+whereas the session's openness implies the networking/connectivity state available
+to the current process.
+
+Possible use cases for interface management are network management related
+applications which intend to monitor the connectivity state but do not engage
+in network communication themselves. Any application wanting to open a socket
+to a remote address will typically use session management related functionality.
+
+\section3 Service networks
+
+Some mobile platforms use the concept of grouped access points (also
+called SNAP or Service Network Access Point). In principle multiple
+configurations are grouped together and possibly even prioritized when
+compared to each other. This is useful for use cases where all
+configurations serve a similar purpose or context. A common context could
+be that they provide access to the public Internet or possibly only to the
+office Intranet. By providing a pool of configurations the system can make
+a decision based on given priorities which usually map to factors such as
+speed, availability and cost. Furthermore the system can automatically
+roam from one access point to the next one while ensuring minimal impact on
+the user experience.
+
+The \l{QNetworkConfiguration::Type} flag specifies to what category a
+configuration belongs. The \l{QNetworkConfiguration::InternetAccessPoint}
+type is the most common example. It represents a configuration that can be
+used to create a session. The above mentioned grouping behavior is provided
+by \l {QNetworkConfiguration::ServiceNetwork} configurations. Service
+networks are place holders until such time when the user attempts to
+\l {QNetworkSession::open()}{open()} a new session. At that point in time
+the system determines which of the configurations \l{QNetworkConfiguration::children()}
+is best to use. The selection algorithm is provided by the platform and is usually managed
+by network settings applications. A service network can only have one level of indirection
+which implies children can only be of type \l {QNetworkConfiguration::InternetAccessPoint}.
+
+Most systems allow the user to define the systems default configuration.
+Usually the default behavior is either a service network, a particular
+Internet access point or the user instructs the platform to ask the user
+once an application requests the network. User interaction is generally
+implemented by some sort of system dialog which shows up at the appropriate
+point in time. The application does not have to handle the user input. This
+API provides the \l QNetworkConfigurationManager::defaultConfiguration()
+call which serves a similar purpose. The subsequent code snippet provides
+a quick way how an application can quickly create a new network session
+without (or only minimal) user interaction:
+
+\code
+ // Set Internet Access Point
+ QNetworkConfigurationManager manager;
+ const bool canStartIAP = (manager.capabilities()
+ & QNetworkConfigurationManager::CanStartAndStopInterfaces);
+ // Is there default access point, use it
+ QNetworkConfiguration cfg = manager.defaultConfiguration();
+ if (!cfg.isValid() || (!canStartIAP && cfg.state() != QNetworkConfiguration::Active)) {
+ QMessageBox::information(this, tr("Network"), tr(
+ "No Access Point found."));
+ return;
+ }
+
+ session = new QNetworkSession(cfg, this);
+ session->open();
+ session->waitForOpened(-1);
+\endcode
+
+To accommodate the "Ask user" use case the default configuration can be of
+type QNetworkConfiguration::UserChoice. A user choice configuration is
+resolved as part of the \l {QNetworkSession::open()} call. Note that a
+\l{QNetworkConfiguration::UserChoice}{UserChoice} configuration is only
+ever returned via \l {QNetworkConfigurationManager::defaultConfiguration()}
+and not \l QNetworkConfigurationManager::allConfigurations().
+
+On systems which do not maintain a list of
+\l {QNetworkConfigurationManager::defaultConfiguration()}{defaultConfiguration()}
+an invalid configuration is returned. A possible workaround could be to
+implement a custom dialog which is populated based on what
+\l QNetworkConfigurationManager::allConfigurations() returns.
+
+\section3 Managing network sessions
+
+A QNetworkSession object separates a \l {QNetworkSession::state()}{state()}
+and an \l{QNetworkSession::isOpen()}{isOpen()} condition.
+
+The state() attribute enables developers to detect whether the system
+currently maintains a global network session for the given
+QNetworkConfiguration. If \l {QNetworkSession::isOpen()}{isOpen()}
+returns true the QNetworkSession instance at hand was at least one of the
+entities requesting the global network session. This distinction is
+required to support the notion of session registrations. For as long as
+there are one or more open QNetworkSession instances the underlying
+network interface is not shut down. Therefore the session
+\l{QNetworkSession::state()}{state()} can be used to monitor the state of
+network interfaces.
+
+An open session is created by calling \l {QNetworkSession::open()} and
+closed via \l{QNetworkSession::close()}, respectively. If the session
+is \l{QNetworkSession::Disconnected}{disconnected} at the time of the
+\l{QNetworkSession::open()}{open()} call the underlying interface is started;
+otherwise only the reference counter against the global session is
+incremeted. The opposite behavior can be observed when using
+\l{QNetworkSession::close()}{close()}.
+
+In some use cases it may be necessary to turn the interface off despite of
+open sessions. This can be achieved by calling
+\l{QNetworkSession::stop()}{stop()}. An example use case could be a
+network manager type of application allowing the user to control the
+overall state of the devices connectivity.
+
+Global (inter-process) session support is platform dependent and can be
+detected via \l {QNetworkConfigurationManager::SystemSessionSupport}.
+If the system does not support global session calling
+\l{QNetworkSession::close()}{close()} never stops the interface.
+
+\section3 Roaming
+
+Roaming is the process of reconnecting a device from one network to another
+while minimizing the impact on the application. The system notifies the application
+about link layer changes so that the required preparation can be taken.
+The most common reaction would be to reinitialize sockets and to renegotiate
+stateful connections with other parties. In the most extreme cases applications
+may even prevent the roaming altogether.
+
+Roaming is initiated when the system determines that a more appropriate access point
+becomes available to the user. In general such a decision is based on cost, network speed
+or network type (access to certain private networks may only be provided via certain access points).
+Almost all devices providing roaming support have some form of global configuration application
+enabling the user to define such groups of access points (service networks) and priorities.
+
+This API supports two types of roaming. Application level roaming (ALR)
+provides the most control over the process. Applications will be notified about upcoming
+link layer changes and get the opportunity to test the new access point. Eventually they can
+reject or accept the link layer change. The second form of roaming is referred to as Forced Roaming.
+The system simply changes the link layer without consulting the application. It is up to
+the application to detect that some of its internal socket may have become invalid. As a consequence
+it has to reinitialize those sockets and reestablish the previous user session without
+any interruption. Forced roaming has the advantage that applications don't have to
+manage the entire roaming process by themselves.
+
+QNetworkSession is the central class for managing roaming related issues.
+
+\section3 Platform capabilities
+
+Some API features are not available on all platforms. The
+\l QNetworkConfigurationManager::Capability should be used to detect
+platform features at runtime. The following table lists the various
+platform APIs being used by this API. This may assist in the process of
+determining the feature support:
+
+\table
+ \header
+ \o Platform
+ \o Backend capabilities
+ \row
+ \o Linux\unicode{0xAE}
+ \o Linux uses the \l {http://projects.gnome.org/NetworkManager}{NetworkManager API} which supports interface notifications and starting and stopping of network interfaces.
+ \row
+ \o Windows\unicode{0xAE} XP
+ \o This platform supports interface notifications without active polling.
+ \row
+ \o Windows XP SP2+Hotfixes, Windows XP SP3, Windows Vista, Windows 7
+ \o In addition to standard Windows XP wifi access point monitoring has been improved which includes the ability to start and stop wifi interfaces. This requires Windows to manage the wifi interfaces.
+ \row
+ \o Symbian\unicode{0xAE} Platform & S60 3.1
+ \o Symbian support is based on Symbian platforms RConnection. In addition to interface notifications, starting and stopping of network it provides system wide session support and direct connection routing.
+ \row
+ \o Symbian Platform & S60 3.2+
+ \o This platform enjoys the most comprehensive feature set. In addition to the features support by the S60 3.1 Network roaming is supported.
+ \row
+ \o Mac OS\unicode{0xAE}
+ \o This platform has full support by way of CoreWLAN offered in Mac OS 10.6. Previous
+ versions of Mac OS - 10.5 and 10.4 have limited support.
+ \row
+ \o All other platforms (*nix, Windows Mobile)
+ \o This backend is the fallback for all platforms supports network interface notifications via active polling only.
+\endtable
+
+*/
diff --git a/doc/src/network-programming/qtnetwork.qdoc b/doc/src/network-programming/qtnetwork.qdoc
index d7e7481..36f48cf 100644
--- a/doc/src/network-programming/qtnetwork.qdoc
+++ b/doc/src/network-programming/qtnetwork.qdoc
@@ -53,11 +53,14 @@
\brief An Introduction to Network Programming with Qt
The QtNetwork module offers classes that allow you to write TCP/IP clients
- and servers. it offers classes such as QFtp that implement specific
+ and servers. It offers classes such as QFtp that implement specific
application-level protocols, lower-level classes such as QTcpSocket,
QTcpServer and QUdpSocket that represent low level network concepts,
and high level classes such as QNetworkRequest, QNetworkReply and
QNetworkAccessManager to perform network operations using common protocols.
+ It also offers classes such as QNetworkConfiguration,
+ QNetworkConfigurationManager and QNetworkSession that implement bearer
+ management.
\tableofcontents
@@ -327,4 +330,29 @@
by passing a factory to QNetworkProxyFactory::setApplicationProxyFactory()
and a custom proxying policy can be created by subclassing
QNetworkProxyFactory; see the class documentation for details.
+
+ \section1 Bearer Management Support
+
+ Bearer Management controls the connectivity state of the device such that
+ the application can start or stop network interfaces and roam
+ transparently between access points.
+
+ The QNetworkConfigurationManager class manages the list of network
+ configurations known to the device. A network configuration describes the
+ set of parameters used to start a network interface and is represented by
+ the QNetworkConfiguration class.
+
+ A network interface is started by openning a QNetworkSession based on a
+ given network configuration. In most situations creating a network session
+ based on the platform specified default network configuration is
+ appropriate. The default network configuration is returned by the
+ QNetworkConfigurationManager::defaultConfiguration() function.
+
+ On some platforms it is a platform requirement that the application open a
+ network session before any network operations can be performed. This can be
+ tested by the presents of the
+ QNetworkConfigurationManager::NetworkSessionRequired flag in the value
+ returned by the QNetworkConfigurationManager::capabilities() function.
+
+ \sa {Bearer Management}
*/
diff --git a/doc/src/snippets/code/src_gui_image_qicon.cpp b/doc/src/snippets/code/src_gui_image_qicon.cpp
index df1fa82..e0dcfa6 100644
--- a/doc/src/snippets/code/src_gui_image_qicon.cpp
+++ b/doc/src/snippets/code/src_gui_image_qicon.cpp
@@ -56,8 +56,8 @@ void MyWidget::drawIcon(QPainter *painter, QPoint pos)
QPixmap pixmap = icon.pixmap(QSize(22, 22),
isEnabled() ? QIcon::Normal
: QIcon::Disabled,
- isOn() ? QIcon::On
- : QIcon::Off);
+ isChecked() ? QIcon::On
+ : QIcon::Off);
painter->drawPixmap(pos, pixmap);
}
//! [2]
diff --git a/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp b/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp
index 5db6676..1853650 100644
--- a/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp
+++ b/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp
@@ -69,3 +69,12 @@ networkAccessManager->setConfiguration(manager.defaultConfiguration());
//! [3]
networkAccessManager->setConfiguration(QNetworkConfiguration());
//! [3]
+
+//! [4]
+networkAccessManager->setNetworkAccessible(QNetworkAccessManager::NotAccessible);
+//! [4]
+
+//! [5]
+networkAccessManager->setNetworkAccessible(QNetworkAccessManager::Accessible);
+//! [5]
+
diff --git a/doc/src/snippets/qelapsedtimer/main.cpp b/doc/src/snippets/qelapsedtimer/main.cpp
new file mode 100644
index 0000000..9d0421f
--- /dev/null
+++ b/doc/src/snippets/qelapsedtimer/main.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtNetwork module 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$
+**
+****************************************************************************/
+#include <QtCore>
+
+void slowOperation1()
+{
+ static char buf[256];
+ for (int i = 0; i < (1<<20); ++i)
+ buf[i % sizeof buf] = i;
+}
+
+void slowOperation2(int) { slowOperation1(); }
+
+void startExample()
+{
+//![0]
+ QElapsedTimer timer;
+ timer.start();
+
+ slowOperation1();
+
+ qDebug() << "The slow operation took" << timer.elapsed() << "milliseconds";
+//![0]
+}
+
+//![1]
+void executeSlowOperations(int timeout)
+{
+ QElapsedTimer timer;
+ timer.start();
+ slowOperation1();
+
+ int remainingTime = timeout - timer.elapsed();
+ if (remainingTime > 0)
+ slowOperation2(remainingTime);
+}
+//![1]
+
+//![2]
+void executeOperationsForTime(int ms)
+{
+ QElapsedTimer timer;
+ timer.start();
+
+ while (!timer.hasExpired(ms))
+ slowOperation1();
+}
+//![2]
+
+int restartExample()
+{
+//![3]
+ QElapsedTimer timer;
+
+ int count = 1;
+ timer.start();
+ do {
+ count *= 2;
+ slowOperation2(count);
+ } while (timer.restart() < 250);
+
+ return count;
+//![3]
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+
+ startExample();
+ restartExample();
+ executeSlowOperations(5);
+ executeOperationsForTime(5);
+}
diff --git a/doc/src/snippets/qelapsedtimer/qelapsedtimer.pro b/doc/src/snippets/qelapsedtimer/qelapsedtimer.pro
new file mode 100644
index 0000000..b0a8f66
--- /dev/null
+++ b/doc/src/snippets/qelapsedtimer/qelapsedtimer.pro
@@ -0,0 +1,2 @@
+SOURCES = main.cpp
+QT -= gui
diff --git a/doc/src/sql-programming/sql-driver.qdoc b/doc/src/sql-programming/sql-driver.qdoc
index e26472e..6bccd83 100644
--- a/doc/src/sql-programming/sql-driver.qdoc
+++ b/doc/src/sql-programming/sql-driver.qdoc
@@ -192,6 +192,73 @@
built in release mode only. If you are expecting a debug version
to be built as well, don't use the \c{"-o Makefile"} option.
+ \section3 How to build the MySQL driver for MinGW users
+
+ The following steps have been used successfully for WinXP SP3. In
+ this example, Qt 4.6.2 is shown.
+
+ \list
+
+ \o Download the following components:
+ \list
+ \o \c{MinGW-5.1.6.exe}
+ \o \c{mingw-utils-0.3.tar.gz}
+ \o Qt sources, e.g. \c{qt-everywhere-opensource-src-4.6.2.zip}
+ \o \c{mysql-5.1.35-win32.msi}
+ \endlist
+
+ \o Install \c{MinGW-5.1.6.exe} in, e.g. \c{C:\MinGW}.
+
+ \o Extract \c{mingw-utils-0.3.tar.gz} into, e.g. \c{C:\MinGW}.
+
+ \o Add the path for \c{MinGW-5.1.6.exe} to your \c{PATH} variable,
+ e.g. \c{C:\MinGW\bin;}
+
+ \o Extract the Qt sources, (\c{qt-everywhere-opensource-src-4.6.2.zip}),
+ into, e.g. \c{C:\Qt}.
+
+ \o Add the path for the eventual Qt binary to your \c{PATH} variable,
+ e.g. \c{C:\Qt\4.6.2\bin;}.
+
+ \o Install MySQL (\c{mysql-5.1.35-win32.msi}), customizing the
+ components. Select only the headers and libraries. Install in,
+ e.g. \c{C:\MySQL\MySQL51}.
+
+ \o Open the DOS prompt, go to \c{C:\MySQL\MySQL51\lib\opt}, and run
+ the following commands:
+ \list
+ \o \c{reimp -d libmysql.lib}
+ \o \c{dlltool -k -d libmysql.def -l libmysql.a}
+ \endlist
+
+ \o Open the DOS prompt, go to \c{C:\Qt\4.6.2} and run the following commands:
+ \list
+ \o \c{configure.exe -debug-and-release -platform win32-g++ -qt-sql-mysql
+ -l mysql -I C:\MySQL\MySQL51\include -L C:\MySQL\MySQL51\lib\opt}
+ \o \c{mingw32-make sub-src}
+ \endlist
+ This step takes a long time.
+
+ \o Open the DOS prompt, go to
+ \c{C:\Qt\4.6.2\src\plugins\sqldrivers\mysql} and run the
+ following command:
+ \list
+ \o \c{qmake "INCLUDEPATH+=C:\MySQL\MySQL51\include" "LIBS+=-L. mysql" mysql.pro}
+ \endlist
+
+ \o Now the following libraries are ready in \c{C:\Qt\4.6.2\plugins\sqldrivers}.
+ \list
+ \o \c{libqsqlmysql4.a}
+ \o \c{libqsqlmysqld4.a}
+ \o \c{qsqlmysql4.dll}
+ \o \c{qsqlmysqld4.dll}
+ \endlist
+ To use the SDK and QtCreator directly, copy these libraries to
+ your \c{C:\Qt\...\qt\plugins\sqldrivers\}, and copy
+ \c{C:\MySQL\MySQL51\lib\opt\libmysql.dll} to your \c{C:\Qt\...\qt\bin\}.
+
+ \endlist
+
\target QOCI
\section2 QOCI for the Oracle Call Interface (OCI)
diff --git a/examples/network/bearercloud/bearercloud.h b/examples/network/bearercloud/bearercloud.h
index f09cb53..09de4c6 100644
--- a/examples/network/bearercloud/bearercloud.h
+++ b/examples/network/bearercloud/bearercloud.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <qnetworkconfigmanager.h>
+#include <QNetworkConfigurationManager>
#include <QGraphicsScene>
#include <QMap>
diff --git a/examples/network/bearercloud/cloud.cpp b/examples/network/bearercloud/cloud.cpp
index 81e13a6..d041034 100644
--- a/examples/network/bearercloud/cloud.cpp
+++ b/examples/network/bearercloud/cloud.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -253,10 +253,12 @@ void Cloud::stateChanged(QNetworkSession::State state)
else
tooltip += tr("<b>%1</b><br>").arg(configuration.name());
+#ifndef QT_NO_NETWORKINTERFACE
const QNetworkInterface interface = session->interface();
if (interface.isValid())
tooltip += tr("<br>Interface: %1").arg(interface.humanReadableName());
tooltip += tr("<br>Id: %1").arg(configuration.identifier());
+#endif
const QString bearerName = configuration.bearerName();
if (!bearerName.isEmpty())
diff --git a/examples/network/bearercloud/cloud.h b/examples/network/bearercloud/cloud.h
index 38f8aff..9e25fb6 100644
--- a/examples/network/bearercloud/cloud.h
+++ b/examples/network/bearercloud/cloud.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include <qnetworkconfiguration.h>
-#include <qnetworksession.h>
+#include <QNetworkConfiguration>
+#include <QNetworkSession>
#include <QGraphicsItem>
QT_USE_NAMESPACE
@@ -56,7 +56,7 @@ class Cloud : public QObject, public QGraphicsItem
Q_INTERFACES(QGraphicsItem)
public:
- Cloud(const QNetworkConfiguration &config, QGraphicsItem *parent = 0);
+ explicit Cloud(const QNetworkConfiguration &config, QGraphicsItem *parent = 0);
~Cloud();
enum { Type = UserType + 1 };
diff --git a/examples/network/bearermonitor/sessionwidget.cpp b/examples/network/bearermonitor/sessionwidget.cpp
index 46ffb20..655c1ac 100644
--- a/examples/network/bearermonitor/sessionwidget.cpp
+++ b/examples/network/bearermonitor/sessionwidget.cpp
@@ -47,6 +47,13 @@ SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *paren
{
setupUi(this);
+#ifdef QT_NO_NETWORKINTERFACE
+ interfaceName->setVisible(false);
+ interfaceNameLabel->setVisible(false);
+ interfaceGuid->setVisible(false);
+ interfaceGuidLabel->setVisible(false);
+#endif
+
session = new QNetworkSession(config, this);
connect(session, SIGNAL(stateChanged(QNetworkSession::State)),
@@ -102,8 +109,10 @@ void SessionWidget::updateSession()
bearer->setText(c.bearerName());
}
+#ifndef QT_NO_NETWORKINTERFACE
interfaceName->setText(session->interface().humanReadableName());
interfaceGuid->setText(session->interface().name());
+#endif
}
void SessionWidget::openSession()
diff --git a/examples/network/bearermonitor/sessionwidget.h b/examples/network/bearermonitor/sessionwidget.h
index cc9c067..ae5cc96 100644
--- a/examples/network/bearermonitor/sessionwidget.h
+++ b/examples/network/bearermonitor/sessionwidget.h
@@ -53,7 +53,7 @@ class SessionWidget : public QWidget, public Ui_SessionWidget
Q_OBJECT
public:
- SessionWidget(const QNetworkConfiguration &config, QWidget *parent = 0);
+ explicit SessionWidget(const QNetworkConfiguration &config, QWidget *parent = 0);
~SessionWidget();
void timerEvent(QTimerEvent *);
diff --git a/examples/script/customclass/bytearrayclass.cpp b/examples/script/customclass/bytearrayclass.cpp
index 1dbf2d4..239b4b4 100644
--- a/examples/script/customclass/bytearrayclass.cpp
+++ b/examples/script/customclass/bytearrayclass.cpp
@@ -148,13 +148,13 @@ void ByteArrayClass::setProperty(QScriptValue &object,
if (!ba)
return;
if (name == length) {
- ba->resize(value.toInt32());
+ resize(*ba, value.toInt32());
} else {
qint32 pos = id;
if (pos < 0)
return;
if (ba->size() <= pos)
- ba->resize(pos + 1);
+ resize(*ba, pos + 1);
(*ba)[pos] = char(value.toInt32());
}
}
@@ -194,10 +194,13 @@ QScriptValue ByteArrayClass::constructor()
return ctor;
}
+//! [10]
QScriptValue ByteArrayClass::newInstance(int size)
{
+ engine()->reportAdditionalMemoryCost(size);
return newInstance(QByteArray(size, /*ch=*/0));
}
+//! [10]
//! [1]
QScriptValue ByteArrayClass::newInstance(const QByteArray &ba)
@@ -235,6 +238,16 @@ void ByteArrayClass::fromScriptValue(const QScriptValue &obj, QByteArray &ba)
ba = qvariant_cast<QByteArray>(obj.data().toVariant());
}
+//! [9]
+void ByteArrayClass::resize(QByteArray &ba, int newSize)
+{
+ int oldSize = ba.size();
+ ba.resize(newSize);
+ if (newSize > oldSize)
+ engine()->reportAdditionalMemoryCost(newSize - oldSize);
+}
+//! [9]
+
ByteArrayClassPropertyIterator::ByteArrayClassPropertyIterator(const QScriptValue &object)
diff --git a/examples/script/customclass/bytearrayclass.h b/examples/script/customclass/bytearrayclass.h
index f185754..3f7ce22 100644
--- a/examples/script/customclass/bytearrayclass.h
+++ b/examples/script/customclass/bytearrayclass.h
@@ -82,6 +82,8 @@ private:
static QScriptValue toScriptValue(QScriptEngine *eng, const QByteArray &ba);
static void fromScriptValue(const QScriptValue &obj, QByteArray &ba);
+ void resize(QByteArray &ba, int newSize);
+
QScriptString length;
QScriptValue proto;
QScriptValue ctor;
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf
index 0b6de5e..a9d7dca 100644
--- a/mkspecs/common/symbian/symbian.conf
+++ b/mkspecs/common/symbian/symbian.conf
@@ -9,9 +9,6 @@ QMAKE_INCREMENTAL_STYLE = sublib
DEFINES += UNICODE QT_KEYPAD_NAVIGATION QT_SOFTKEYS_ENABLED QT_USE_MATH_H_FLOATS
-# QNetworkAccessManager to create a network session by default
-DEFINES += QT_QNAM_DEFAULT_NETWORK_SESSION
-
QMAKE_COMPILER_DEFINES += SYMBIAN
QMAKE_EXT_OBJ = .o
@@ -66,8 +63,8 @@ QMAKE_LINK_OBJECT_MAX =
QMAKE_LINK_OBJECT_SCRIPT=
QMAKE_LIBS = -llibc -llibm -leuser -llibdl
-QMAKE_LIBS_CORE = $$QMAKE_LIBS -lefsrv
-QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lhal -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lcentralrepository
+QMAKE_LIBS_CORE = $$QMAKE_LIBS -lefsrv -lhal
+QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lcentralrepository
QMAKE_LIBS_NETWORK =
QMAKE_LIBS_EGL = -llibEGL
QMAKE_LIBS_OPENGL =
diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf
index e272e72..ca201bc 100644
--- a/mkspecs/linux-g++-maemo/qmake.conf
+++ b/mkspecs/linux-g++-maemo/qmake.conf
@@ -33,7 +33,4 @@ DEFINES += QT_GL_NO_SCISSOR_TEST
# Work round SGX 1.4 driver bug (text corrupted), modify glyph cache width:
DEFINES += QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024
-# QNetworkAccessManager to create a network session by default
-DEFINES += QT_QNAM_DEFAULT_NETWORK_SESSION
-
load(qt_config)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index b9d2445..29a2422 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1245,7 +1245,8 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
}
if(!dirstr.endsWith(Option::dir_sep))
dirstr += Option::dir_sep;
- if(exists(wild)) { //real file
+ bool is_target = (wild == fileFixify(var("TARGET"), FileFixifyAbsolute));
+ if(is_target || exists(wild)) { //real file or target
QString file = wild;
QFileInfo fi(fileInfo(wild));
if(!target.isEmpty())
@@ -1259,7 +1260,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
QString cmd;
if (fi.isDir())
cmd = "-$(INSTALL_DIR)";
- else if (fi.isExecutable())
+ else if (is_target || fi.isExecutable())
cmd = "-$(INSTALL_PROGRAM)";
else
cmd = "-$(INSTALL_FILE)";
diff --git a/src/3rdparty/harfbuzz/src/Makefile.am b/src/3rdparty/harfbuzz/src/Makefile.am
index 2b0fb1d..51d0652 100644
--- a/src/3rdparty/harfbuzz/src/Makefile.am
+++ b/src/3rdparty/harfbuzz/src/Makefile.am
@@ -12,7 +12,8 @@ MAINSOURCES = \
harfbuzz-impl.c \
harfbuzz-open.c \
harfbuzz-shaper.cpp \
- harfbuzz-tibetan.c \
+ harfbuzz-greek.c \
+ harfbuzz-tibetan.c \
harfbuzz-khmer.c \
harfbuzz-indic.cpp \
harfbuzz-hebrew.c \
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
new file mode 100644
index 0000000..59f3077
--- /dev/null
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
@@ -0,0 +1,442 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This is part of HarfBuzz, an OpenType Layout engine library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ */
+
+#include "harfbuzz-shaper.h"
+#include "harfbuzz-shaper-private.h"
+#include <assert.h>
+
+#ifndef NO_OPENTYPE
+static const HB_OpenTypeFeature greek_features[] = {
+ { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty },
+ { HB_MAKE_TAG('l', 'i', 'g', 'a'), CcmpProperty },
+ { HB_MAKE_TAG('c', 'l', 'i', 'g'), CcmpProperty },
+ {0, 0}
+};
+#endif
+
+/*
+ Greek decompositions
+*/
+
+
+typedef struct _hb_greek_decomposition {
+ HB_UChar16 composed;
+ HB_UChar16 base;
+} hb_greek_decomposition;
+
+static const hb_greek_decomposition decompose_0x300[] = {
+ { 0x1FBA, 0x0391 },
+ { 0x1FC8, 0x0395 },
+ { 0x1FCA, 0x0397 },
+ { 0x1FDA, 0x0399 },
+ { 0x1FF8, 0x039F },
+ { 0x1FEA, 0x03A5 },
+ { 0x1FFA, 0x03A9 },
+ { 0x1F70, 0x03B1 },
+ { 0x1F72, 0x03B5 },
+ { 0x1F74, 0x03B7 },
+ { 0x1F76, 0x03B9 },
+ { 0x1F78, 0x03BF },
+ { 0x1F7A, 0x03C5 },
+ { 0x1F7C, 0x03C9 },
+ { 0x1FD2, 0x03CA },
+ { 0x1FE2, 0x03CB },
+ { 0x1F02, 0x1F00 },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x300(HB_UChar16 base)
+{
+ if ((base ^ 0x1f00) < 0x100) {
+ if (base <= 0x1f69 && !(base & 0x6))
+ return base + 2;
+ if (base == 0x1fbf)
+ return 0x1fcd;
+ if (base == 0x1ffe)
+ return 0x1fdd;
+ return 0;
+ }
+ const hb_greek_decomposition *d = decompose_0x300;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+static const hb_greek_decomposition decompose_0x301[] = {
+ { 0x0386, 0x0391 },
+ { 0x0388, 0x0395 },
+ { 0x0389, 0x0397 },
+ { 0x038A, 0x0399 },
+ { 0x038C, 0x039F },
+ { 0x038E, 0x03A5 },
+ { 0x038F, 0x03A9 },
+ { 0x03AC, 0x03B1 },
+ { 0x03AD, 0x03B5 },
+ { 0x03AE, 0x03B7 },
+ { 0x03AF, 0x03B9 },
+ { 0x03CC, 0x03BF },
+ { 0x03CD, 0x03C5 },
+ { 0x03CE, 0x03C9 },
+ { 0x0390, 0x03CA },
+ { 0x03B0, 0x03CB },
+ { 0x03D3, 0x03D2 },
+ { 0, 0 }
+};
+
+
+static HB_UChar16 compose_0x301(HB_UChar16 base)
+{
+ if ((base ^ 0x1f00) < 0x100) {
+ if (base <= 0x1f69 && !(base & 0x6))
+ return base + 4;
+ if (base == 0x1fbf)
+ return 0x1fce;
+ if (base == 0x1ffe)
+ return 0x1fde;
+ }
+ const hb_greek_decomposition *d = decompose_0x301;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+static const hb_greek_decomposition decompose_0x304[] = {
+ { 0x1FB9, 0x0391 },
+ { 0x1FD9, 0x0399 },
+ { 0x1FE9, 0x03A5 },
+ { 0x1FB1, 0x03B1 },
+ { 0x1FD1, 0x03B9 },
+ { 0x1FE1, 0x03C5 },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x304(HB_UChar16 base)
+{
+ const hb_greek_decomposition *d = decompose_0x304;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+static const hb_greek_decomposition decompose_0x306[] = {
+ { 0x1FB8, 0x0391 },
+ { 0x1FD8, 0x0399 },
+ { 0x1FE8, 0x03A5 },
+ { 0x1FB0, 0x03B1 },
+ { 0x1FD0, 0x03B9 },
+ { 0x1FE0, 0x03C5 },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x306(HB_UChar16 base)
+{
+ const hb_greek_decomposition *d = decompose_0x306;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+static const hb_greek_decomposition decompose_0x308[] = {
+ { 0x03AA, 0x0399 },
+ { 0x03AB, 0x03A5 },
+ { 0x03CA, 0x03B9 },
+ { 0x03CB, 0x03C5 },
+ { 0x03D4, 0x03D2 },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x308(HB_UChar16 base)
+{
+ const hb_greek_decomposition *d = decompose_0x308;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+
+static const hb_greek_decomposition decompose_0x313[] = {
+ { 0x1F08, 0x0391 },
+ { 0x1F18, 0x0395 },
+ { 0x1F28, 0x0397 },
+ { 0x1F38, 0x0399 },
+ { 0x1F48, 0x039F },
+ { 0x1F68, 0x03A9 },
+ { 0x1F00, 0x03B1 },
+ { 0x1F10, 0x03B5 },
+ { 0x1F20, 0x03B7 },
+ { 0x1F30, 0x03B9 },
+ { 0x1F40, 0x03BF },
+ { 0x1FE4, 0x03C1 },
+ { 0x1F50, 0x03C5 },
+ { 0x1F60, 0x03C9 },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x313(HB_UChar16 base)
+{
+ const hb_greek_decomposition *d = decompose_0x313;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+static const hb_greek_decomposition decompose_0x314[] = {
+ { 0x1F09, 0x0391 },
+ { 0x1F19, 0x0395 },
+ { 0x1F29, 0x0397 },
+ { 0x1F39, 0x0399 },
+ { 0x1F49, 0x039F },
+ { 0x1FEC, 0x03A1 },
+ { 0x1F59, 0x03A5 },
+ { 0x1F69, 0x03A9 },
+ { 0x1F01, 0x03B1 },
+ { 0x1F11, 0x03B5 },
+ { 0x1F21, 0x03B7 },
+ { 0x1F31, 0x03B9 },
+ { 0x1F41, 0x03BF },
+ { 0x1FE5, 0x03C1 },
+ { 0x1F51, 0x03C5 },
+ { 0x1F61, 0x03C9 },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x314(HB_UChar16 base)
+{
+ const hb_greek_decomposition *d = decompose_0x314;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+static const hb_greek_decomposition decompose_0x342[] = {
+ { 0x1FB6, 0x03B1 },
+ { 0x1FC6, 0x03B7 },
+ { 0x1FD6, 0x03B9 },
+ { 0x1FE6, 0x03C5 },
+ { 0x1FF6, 0x03C9 },
+ { 0x1FD7, 0x03CA },
+ { 0x1FE7, 0x03CB },
+ { 0x1F06, 0x1F00 },
+ { 0x1F07, 0x1F01 },
+ { 0x1F0E, 0x1F08 },
+ { 0x1F0F, 0x1F09 },
+ { 0x1F26, 0x1F20 },
+ { 0x1F27, 0x1F21 },
+ { 0x1F2E, 0x1F28 },
+ { 0x1F2F, 0x1F29 },
+ { 0x1F36, 0x1F30 },
+ { 0x1F37, 0x1F31 },
+ { 0x1F3E, 0x1F38 },
+ { 0x1F3F, 0x1F39 },
+ { 0x1F56, 0x1F50 },
+ { 0x1F57, 0x1F51 },
+ { 0x1F5F, 0x1F59 },
+ { 0x1F66, 0x1F60 },
+ { 0x1F67, 0x1F61 },
+ { 0x1F6E, 0x1F68 },
+ { 0x1F6F, 0x1F69 },
+ { 0x1FCF, 0x1FBF },
+ { 0x1FDF, 0x1FFE },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x342(HB_UChar16 base)
+{
+ const hb_greek_decomposition *d = decompose_0x342;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+static const hb_greek_decomposition decompose_0x345[] = {
+ { 0x1FBC, 0x0391 },
+ { 0x1FCC, 0x0397 },
+ { 0x1FFC, 0x03A9 },
+ { 0x1FB4, 0x03AC },
+ { 0x1FC4, 0x03AE },
+ { 0x1FB3, 0x03B1 },
+ { 0x1FC3, 0x03B7 },
+ { 0x1FF3, 0x03C9 },
+ { 0x1FF4, 0x03CE },
+ { 0x1F80, 0x1F00 },
+ { 0x1F81, 0x1F01 },
+ { 0x1F82, 0x1F02 },
+ { 0x1F83, 0x1F03 },
+ { 0x1F84, 0x1F04 },
+ { 0x1F85, 0x1F05 },
+ { 0x1F86, 0x1F06 },
+ { 0x1F87, 0x1F07 },
+ { 0x1F88, 0x1F08 },
+ { 0x1F89, 0x1F09 },
+ { 0x1F8A, 0x1F0A },
+ { 0x1F8B, 0x1F0B },
+ { 0x1F8C, 0x1F0C },
+ { 0x1F8D, 0x1F0D },
+ { 0x1F8E, 0x1F0E },
+ { 0x1F8F, 0x1F0F },
+ { 0x1F90, 0x1F20 },
+ { 0x1F91, 0x1F21 },
+ { 0x1F92, 0x1F22 },
+ { 0x1F93, 0x1F23 },
+ { 0x1F94, 0x1F24 },
+ { 0x1F95, 0x1F25 },
+ { 0x1F96, 0x1F26 },
+ { 0x1F97, 0x1F27 },
+ { 0x1F98, 0x1F28 },
+ { 0x1F99, 0x1F29 },
+ { 0x1F9A, 0x1F2A },
+ { 0x1F9B, 0x1F2B },
+ { 0x1F9C, 0x1F2C },
+ { 0x1F9D, 0x1F2D },
+ { 0x1F9E, 0x1F2E },
+ { 0x1F9F, 0x1F2F },
+ { 0x1FA0, 0x1F60 },
+ { 0x1FA1, 0x1F61 },
+ { 0x1FA2, 0x1F62 },
+ { 0x1FA3, 0x1F63 },
+ { 0x1FA4, 0x1F64 },
+ { 0x1FA5, 0x1F65 },
+ { 0x1FA6, 0x1F66 },
+ { 0x1FA7, 0x1F67 },
+ { 0x1FA8, 0x1F68 },
+ { 0x1FA9, 0x1F69 },
+ { 0x1FAA, 0x1F6A },
+ { 0x1FAB, 0x1F6B },
+ { 0x1FAC, 0x1F6C },
+ { 0x1FAD, 0x1F6D },
+ { 0x1FAE, 0x1F6E },
+ { 0x1FAF, 0x1F6F },
+ { 0x1FB2, 0x1F70 },
+ { 0x1FC2, 0x1F74 },
+ { 0x1FF2, 0x1F7C },
+ { 0x1FB7, 0x1FB6 },
+ { 0x1FC7, 0x1FC6 },
+ { 0x1FF7, 0x1FF6 },
+ { 0, 0 }
+};
+
+static HB_UChar16 compose_0x345(HB_UChar16 base)
+{
+ const hb_greek_decomposition *d = decompose_0x345;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+}
+
+/*
+ Greek shaping. Heuristic positioning can't render polytonic greek correctly. We're a lot
+ better off mapping greek chars with diacritics to the characters in the extended greek
+ region in Unicode if possible.
+*/
+HB_Bool HB_GreekShape(HB_ShaperItem *shaper_item)
+{
+ assert(shaper_item->item.script == HB_Script_Greek);
+
+ const HB_UChar16 *uc = shaper_item->string + shaper_item->item.pos;
+ unsigned short *logClusters = shaper_item->log_clusters;
+ HB_GlyphAttributes *attributes = shaper_item->attributes;
+
+ HB_Bool haveGlyphs;
+ int slen = 1;
+ int cluster_start = 0;
+ hb_uint32 i;
+
+ HB_STACKARRAY(HB_UChar16, shapedChars, 2 * shaper_item->item.length);
+ *shapedChars = *uc;
+ logClusters[0] = 0;
+
+ for (i = 1; i < shaper_item->item.length; ++i) {
+ hb_uint16 base = shapedChars[slen-1];
+ hb_uint16 shaped = 0;
+ if (uc[i] == 0x300)
+ shaped = compose_0x300(base);
+ else if (uc[i] == 0x301)
+ shaped = compose_0x301(base);
+ else if (uc[i] == 0x304)
+ shaped = compose_0x304(base);
+ else if (uc[i] == 0x306)
+ shaped = compose_0x306(base);
+ else if (uc[i] == 0x308)
+ shaped = compose_0x308(base);
+ else if (uc[i] == 0x313)
+ shaped = compose_0x313(base);
+ else if (uc[i] == 0x314)
+ shaped = compose_0x314(base);
+ else if (uc[i] == 0x342)
+ shaped = compose_0x342(base);
+ else if (uc[i] == 0x345)
+ shaped = compose_0x345(base);
+
+ if (shaped) {
+ if (shaper_item->font->klass->canRender(shaper_item->font, (HB_UChar16 *)&shaped, 1)) {
+ shapedChars[slen-1] = shaped;
+ } else {
+ shaped = 0;
+ }
+ }
+
+ if (!shaped) {
+ HB_CharCategory category;
+ int cmb;
+ shapedChars[slen] = uc[i];
+ HB_GetUnicodeCharProperties(uc[i], &category, &cmb);
+ if (category != HB_Mark_NonSpacing) {
+ attributes[slen].clusterStart = TRUE;
+ attributes[slen].mark = FALSE;
+ attributes[slen].combiningClass = 0;
+ attributes[slen].dontPrint = HB_IsControlChar(uc[i]);
+ cluster_start = slen;
+ } else {
+ attributes[slen].clusterStart = FALSE;
+ attributes[slen].mark = TRUE;
+ attributes[slen].combiningClass = cmb;
+ }
+ ++slen;
+ }
+ logClusters[i] = cluster_start;
+ }
+
+ haveGlyphs = shaper_item->font->klass
+ ->convertStringToGlyphIndices(shaper_item->font,
+ shapedChars, slen,
+ shaper_item->glyphs, &shaper_item->num_glyphs,
+ shaper_item->item.bidiLevel % 2);
+
+ HB_FREE_STACKARRAY(shapedChars);
+
+ if (!haveGlyphs)
+ return FALSE;
+
+#ifndef NO_OPENTYPE
+ if (HB_SelectScript(shaper_item, greek_features)) {
+ const int availableGlyphs = shaper_item->num_glyphs;
+ HB_OpenTypeShape(shaper_item, /*properties*/0);
+ return HB_OpenTypePosition(shaper_item, availableGlyphs, /*doLogClusters*/TRUE);
+ }
+#endif
+ HB_HeuristicPosition(shaper_item);
+
+ return TRUE;
+}
+
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp
index d2f902f..2dae501 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp
@@ -25,6 +25,7 @@
#include "harfbuzz-shaper.cpp"
#include "harfbuzz-indic.cpp"
extern "C" {
+#include "harfbuzz-greek.c"
#include "harfbuzz-tibetan.c"
#include "harfbuzz-khmer.c"
#include "harfbuzz-hebrew.c"
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h
index 80bccf8..11ed753 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h
@@ -100,6 +100,7 @@ typedef struct {
extern const HB_ScriptEngine hb_scriptEngines[];
extern HB_Bool HB_BasicShape(HB_ShaperItem *shaper_item);
+extern HB_Bool HB_GreekShape(HB_ShaperItem *shaper_item);
extern HB_Bool HB_TibetanShape(HB_ShaperItem *shaper_item);
extern HB_Bool HB_HebrewShape(HB_ShaperItem *shaper_item);
extern HB_Bool HB_ArabicShape(HB_ShaperItem *shaper_item);
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index bfc7bd4..4bc53c8 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -587,7 +587,7 @@ const HB_ScriptEngine HB_ScriptEngines[] = {
// Common
{ HB_BasicShape, 0},
// Greek
- { HB_BasicShape, 0},
+ { HB_GreekShape, 0},
// Cyrillic
{ HB_BasicShape, 0},
// Armenian
diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
index 827ac30..b48b0a9 100644
--- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp
+++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
@@ -136,13 +136,13 @@ HB_Error hb_getPointInOutline(HB_Font font, HB_Glyph glyph, int flags, hb_uint32
return HB_Err_Ok;
}
-void hb_getGlyphMetrics(HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics)
+void hb_getGlyphMetrics(HB_Font, HB_Glyph, HB_GlyphMetrics *metrics)
{
// ###
metrics->x = metrics->y = metrics->width = metrics->height = metrics->xOffset = metrics->yOffset = 0;
}
-HB_Fixed hb_getFontMetric(HB_Font font, HB_FontMetric metric)
+HB_Fixed hb_getFontMetric(HB_Font, HB_FontMetric )
{
return 0; // ####
}
@@ -169,6 +169,8 @@ public slots:
void initTestCase();
void cleanupTestCase();
private slots:
+ void greek();
+
void devanagari();
void bengali();
void gurmukhi();
@@ -203,18 +205,25 @@ void tst_QScriptEngine::cleanupTestCase()
FT_Done_FreeType(freetype);
}
-struct ShapeTable {
- unsigned short unicode[16];
- unsigned short glyphs[16];
+class Shaper
+{
+public:
+ Shaper(FT_Face face, HB_Script script, const QString &str);
+
+ HB_FontRec hbFont;
+ HB_ShaperItem shaper_item;
+ QVarLengthArray<HB_Glyph> hb_glyphs;
+ QVarLengthArray<HB_GlyphAttributes> hb_attributes;
+ QVarLengthArray<HB_Fixed> hb_advances;
+ QVarLengthArray<HB_FixedPoint> hb_offsets;
+ QVarLengthArray<unsigned short> hb_logClusters;
+
};
-static bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
+Shaper::Shaper(FT_Face face, HB_Script script, const QString &str)
{
- QString str = QString::fromUtf16( s->unicode );
-
HB_Face hbFace = HB_NewFace(face, hb_getSFntTable);
- HB_FontRec hbFont;
hbFont.klass = &hb_fontClass;
hbFont.userData = face;
hbFont.x_ppem = face->size->metrics.x_ppem;
@@ -222,7 +231,6 @@ static bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
hbFont.x_scale = face->size->metrics.x_scale;
hbFont.y_scale = face->size->metrics.y_scale;
- HB_ShaperItem shaper_item;
shaper_item.kerning_applied = false;
shaper_item.string = reinterpret_cast<const HB_UChar16 *>(str.constData());
shaper_item.stringLength = str.length();
@@ -237,11 +245,6 @@ static bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
shaper_item.glyphIndicesPresent = false;
shaper_item.initialGlyphCount = 0;
- QVarLengthArray<HB_Glyph> hb_glyphs(shaper_item.num_glyphs);
- QVarLengthArray<HB_GlyphAttributes> hb_attributes(shaper_item.num_glyphs);
- QVarLengthArray<HB_Fixed> hb_advances(shaper_item.num_glyphs);
- QVarLengthArray<HB_FixedPoint> hb_offsets(shaper_item.num_glyphs);
- QVarLengthArray<unsigned short> hb_logClusters(shaper_item.num_glyphs);
while (1) {
hb_glyphs.resize(shaper_item.num_glyphs);
@@ -263,10 +266,68 @@ static bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
if (HB_ShapeItem(&shaper_item))
break;
-
}
HB_FreeFace(hbFace);
+}
+
+
+#if defined(Q_WS_X11)
+static bool decomposedShaping(FT_Face face, HB_Script script, const QChar &ch)
+{
+ QString uc = QString().append(ch);
+ Shaper shaper(face, script, uc);
+
+ uc = uc.normalized(QString::NormalizationForm_D);
+ Shaper decomposed(face, script, uc);
+
+ if( shaper.shaper_item.num_glyphs != decomposed.shaper_item.num_glyphs )
+ goto error;
+
+ for (unsigned int i = 0; i < shaper.shaper_item.num_glyphs; ++i) {
+ if ((shaper.shaper_item.glyphs[i]&0xffffff) != (decomposed.shaper_item.glyphs[i]&0xffffff))
+ goto error;
+ }
+ return true;
+ error:
+ QString str = "";
+ int i = 0;
+ while (i < uc.length()) {
+ str += QString("%1 ").arg(uc[i].unicode(), 4, 16);
+ ++i;
+ }
+ qDebug("%s: decomposedShaping of char %4x failed\n decomposedString: %s\n nglyphs=%d, decomposed nglyphs %d",
+ face->family_name,
+ ch.unicode(), str.toLatin1().data(),
+ shaper.shaper_item.num_glyphs,
+ decomposed.shaper_item.num_glyphs);
+
+ str = "";
+ i = 0;
+ while (i < shaper.shaper_item.num_glyphs) {
+ str += QString("%1 ").arg(shaper.shaper_item.glyphs[i], 4, 16);
+ ++i;
+ }
+ qDebug(" composed glyph result = %s", str.toLatin1().constData());
+ str = "";
+ i = 0;
+ while (i < decomposed.shaper_item.num_glyphs) {
+ str += QString("%1 ").arg(decomposed.shaper_item.glyphs[i], 4, 16);
+ ++i;
+ }
+ qDebug(" decomposed glyph result = %s", str.toLatin1().constData());
+ return false;
+}
+#endif
+
+struct ShapeTable {
+ unsigned short unicode[16];
+ unsigned short glyphs[16];
+};
+
+static bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
+{
+ Shaper shaper(face, script, QString::fromUtf16( s->unicode ));
hb_uint32 nglyphs = 0;
const unsigned short *g = s->glyphs;
@@ -275,16 +336,16 @@ static bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
g++;
}
- if( nglyphs != shaper_item.num_glyphs )
+ if( nglyphs != shaper.shaper_item.num_glyphs )
goto error;
for (hb_uint32 i = 0; i < nglyphs; ++i) {
- if ((shaper_item.glyphs[i]&0xffffff) != s->glyphs[i])
+ if ((shaper.shaper_item.glyphs[i]&0xffffff) != s->glyphs[i])
goto error;
}
return true;
error:
- str = "";
+ QString str = "";
const unsigned short *uc = s->unicode;
while (*uc) {
str += QString("%1 ").arg(*uc, 4, 16);
@@ -293,18 +354,40 @@ static bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
qDebug("%s: shaping of string %s failed, nglyphs=%d, expected %d",
face->family_name,
str.toLatin1().constData(),
- shaper_item.num_glyphs, nglyphs);
+ shaper.shaper_item.num_glyphs, nglyphs);
str = "";
hb_uint32 i = 0;
- while (i < shaper_item.num_glyphs) {
- str += QString("%1 ").arg(shaper_item.glyphs[i], 4, 16);
+ while (i < shaper.shaper_item.num_glyphs) {
+ str += QString("%1 ").arg(shaper.shaper_item.glyphs[i], 4, 16);
++i;
}
qDebug(" glyph result = %s", str.toLatin1().constData());
return false;
}
+
+void tst_QScriptEngine::greek()
+{
+ FT_Face face = loadFace("DejaVuSans.ttf");
+ if (face) {
+ for (int uc = 0x1f00; uc <= 0x1fff; ++uc) {
+ QString str;
+ str.append(uc);
+ if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) {
+ //qDebug() << "skipping" << hex << uc;
+ continue;
+ }
+ if (uc == 0x1fc1 || uc == 0x1fed)
+ continue;
+ QVERIFY( decomposedShaping(face, HB_Script_Greek, QChar(uc)) );
+ }
+ } else {
+ QSKIP("couln't find DejaVu Sans", SkipAll);
+ }
+}
+
+
void tst_QScriptEngine::devanagari()
{
{
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/config.h b/src/3rdparty/javascriptcore/JavaScriptCore/config.h
index d5fdfe9..2af2e71 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/config.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/config.h
@@ -25,7 +25,7 @@
#include <wtf/Platform.h>
-#if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
+#if !defined(QT_BUILD_SCRIPT_LIB) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
#if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
#define JS_EXPORTDATA __declspec(dllexport)
#else
diff --git a/src/3rdparty/phonon/gstreamer/glrenderer.cpp b/src/3rdparty/phonon/gstreamer/glrenderer.cpp
index 6cf3459..0203028 100644
--- a/src/3rdparty/phonon/gstreamer/glrenderer.cpp
+++ b/src/3rdparty/phonon/gstreamer/glrenderer.cpp
@@ -304,7 +304,7 @@ void GLRenderWidgetImplementation::paintEvent(QPaintEvent *)
const float tx_array[] = { 0, 0, 1, 0, 1, 1, 0, 1};
const QRectF r = drawFrameRect();
- const float v_array[] = { r.left(), r.top(), r.right(), r.top(), r.right(), r.bottom(), r.left(), r.bottom() };
+ const float v_array[] = { float(r.left()), float(r.top()), float(r.right()), float(r.top()), float(r.right()), float(r.bottom()), float(r.left()), float(r.bottom()) };
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_texture[0]);
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 3a50b1a..e24e9e2 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -3431,3 +3431,6 @@ symbian {
}
}
}
+
+# WebKit doesn't compile in C++0x mode
+*-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index f834a80..82b3003 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -170,6 +170,7 @@ QUnifiedTimer::QUnifiedTimer() :
currentAnimationIdx(0), consistentTiming(false), slowMode(false),
isPauseTimerActive(false), runningLeafAnimations(0)
{
+ time.invalidate();
}
QUnifiedTimer *QUnifiedTimer::instance()
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 8bc3224..2282cdb 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -56,6 +56,7 @@
#include <QtCore/qbasictimer.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qtimer.h>
+#include <QtCore/qelapsedtimer.h>
#include <private/qobject_p.h>
#ifdef Q_OS_WIN
@@ -113,61 +114,7 @@ private:
Q_DECLARE_PUBLIC(QAbstractAnimation)
};
-class ElapsedTimer
-{
-public:
- ElapsedTimer() {
- invalidate();
- }
-
- void invalidate() {
- m_started = -1;
- }
-
- bool isValid() const {
- return m_started >= 0;
- }
-
- void start() {
- m_started = getTickCount_sys();
- }
-
- qint64 elapsed() const {
- qint64 current = getTickCount_sys();
- qint64 delta = current - m_started;
- if (delta < 0)
- delta += getPeriod_sys(); //we wrapped around
- return delta;
- }
-
-private:
- enum {
- MSECS_PER_HOUR = 3600000,
- MSECS_PER_MIN = 60000
- };
-
- qint64 m_started;
-
- quint64 getPeriod_sys() const {
-#ifdef Q_OS_WIN
- return Q_UINT64_C(0x100000000);
-#else
- // fallback
- return 86400 * 1000;
-#endif
- }
-
- qint64 getTickCount_sys() const {
-#ifdef Q_OS_WIN
- return ::GetTickCount();
-#else
- // fallback
- const QTime t = QTime::currentTime();
- return MSECS_PER_HOUR * t.hour() + MSECS_PER_MIN * t.minute() + 1000 * t.second() + t.msec();
-#endif
- }
-};
-
+typedef QElapsedTimer ElapsedTimer;
class QUnifiedTimer : public QObject
{
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 1ef875f..09c000b 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -511,6 +511,9 @@ public:
WA_Maemo5AutoOrientation = 130,
WA_Maemo5ShowProgressIndicator = 131,
#endif
+
+ WA_X11DoNotAcceptFocus = 132,
+
// Add new attributes before this line
WA_AttributeCount
};
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 8f9902f..992d2ba 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1256,6 +1256,10 @@
window boundary (widget without parent or dialog) is found.
This attribute currently has effect only on Symbian platforms
+ \value WA_X11DoNotAcceptFocus Asks the window manager to not give focus
+ to this top level window. This attribute has no effect on non-X11
+ platforms.
+
\omitvalue WA_SetLayoutDirection
\omitvalue WA_InputMethodTransparent
\omitvalue WA_WState_CompressKeys
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 505889e..1b60936 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1079,6 +1079,8 @@ QDir::Filters QDir::filter() const
\value NoSymLinks Do not list symbolic links (ignored by operating
systems that don't support symbolic links).
\value NoDotAndDotDot Do not list the special entries "." and "..".
+ \value NoDot Do not list the special entry ".".
+ \value NoDotDot Do not list the special entry "..".
\value AllEntries List directories, files, drives and symlinks (this does not list
broken symlinks unless you specify System).
\value Readable List files for which the application has read
@@ -2367,7 +2369,9 @@ QDebug operator<<(QDebug debug, QDir::Filters filters)
if (filters & QDir::Files) flags << QLatin1String("Files");
if (filters & QDir::Drives) flags << QLatin1String("Drives");
if (filters & QDir::NoSymLinks) flags << QLatin1String("NoSymLinks");
- if (filters & QDir::NoDotAndDotDot) flags << QLatin1String("NoDotAndDotDot");
+ if (filters & QDir::NoDotAndDotDot) flags << QLatin1String("NoDotAndDotDot"); // ### Qt5: remove (because NoDotAndDotDot=NoDot|NoDotDot)
+ if (filters & QDir::NoDot) flags << QLatin1String("NoDot");
+ if (filters & QDir::NoDotDot) flags << QLatin1String("NoDotDot");
if ((filters & QDir::AllEntries) == QDir::AllEntries) flags << QLatin1String("AllEntries");
if (filters & QDir::Readable) flags << QLatin1String("Readable");
if (filters & QDir::Writable) flags << QLatin1String("Writable");
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index 186dd2f..28da271 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -88,7 +88,9 @@ public:
AllDirs = 0x400,
CaseSensitive = 0x800,
- NoDotAndDotDot = 0x1000,
+ NoDotAndDotDot = 0x1000, // ### Qt5 NoDotAndDotDot = NoDot|NoDotDot
+ NoDot = 0x2000,
+ NoDotDot = 0x4000,
NoFilter = -1
#ifdef QT3_SUPPORT
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 860fb63..fd4b9c1 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -287,7 +287,11 @@ bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInf
const bool dotOrDotDot = fileName[0] == QLatin1Char('.')
&& ((fileNameSize == 1)
||(fileNameSize == 2 && fileName[1] == QLatin1Char('.')));
- if ((filters & QDir::NoDotAndDotDot) && dotOrDotDot)
+ if ((filters & QDir::NoDot) && dotOrDotDot && fileNameSize == 1)
+ return false;
+ if ((filters & QDir::NoDotDot) && dotOrDotDot && fileNameSize == 2)
+ return false;
+ if ((filters & QDir::NoDotAndDotDot) && dotOrDotDot) // ### Qt5 remove (NoDotAndDotDot == NoDot|NoDotDot)
return false;
// name filter
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 7223e49..00af3fd 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -248,7 +248,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine()
eng = QDnotifyFileSystemWatcherEngine::create();
return eng;
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
-# if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
+# if 0 && defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5)
return QFSEventsFileSystemWatcherEngine::create();
else
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 5e14804..a1ffb81 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -126,8 +126,10 @@ void QFSFileEnginePrivate::init()
fileAttrib = INVALID_FILE_ATTRIBUTES;
fileHandle = INVALID_HANDLE_VALUE;
mapHandle = INVALID_HANDLE_VALUE;
+#ifndef Q_OS_WINCE
cachedFd = -1;
#endif
+#endif
}
/*!
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index 365652a..e9e55f3 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -112,7 +112,11 @@ public:
HANDLE fileHandle;
HANDLE mapHandle;
QHash<uchar *, DWORD /* offset % AllocationGranularity */> maps;
+
+#ifndef Q_OS_WINCE
mutable int cachedFd;
+#endif
+
mutable DWORD fileAttrib;
#else
QHash<uchar *, QPair<int /*offset % PageSize*/, size_t /*length + offset % PageSize*/> > maps;
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 8d34486..eeca07e 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -450,13 +450,27 @@ bool QFSFileEnginePrivate::nativeClose()
// Windows native mode.
bool ok = true;
+
+#ifndef Q_OS_WINCE
+ if (cachedFd != -1) {
+ if (::_close(cachedFd) && !::CloseHandle(fileHandle)) {
+ q->setError(QFile::UnspecifiedError, qt_error_string());
+ ok = false;
+ }
+
+ // System handle is closed with associated file descriptor.
+ fileHandle = INVALID_HANDLE_VALUE;
+ cachedFd = -1;
+
+ return ok;
+ }
+#endif
+
if ((fileHandle == INVALID_HANDLE_VALUE || !::CloseHandle(fileHandle))) {
q->setError(QFile::UnspecifiedError, qt_error_string());
ok = false;
}
fileHandle = INVALID_HANDLE_VALUE;
- cachedFd = -1; // gets closed by CloseHandle above
-
return ok;
}
@@ -1261,12 +1275,7 @@ static QString readSymLink(const QString &link)
REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER*)qMalloc(bufsize);
DWORD retsize = 0;
if (::DeviceIoControl(handle, FSCTL_GET_REPARSE_POINT, 0, 0, rdb, bufsize, &retsize, 0)) {
- if (rdb->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
- int length = rdb->MountPointReparseBuffer.SubstituteNameLength / sizeof(wchar_t);
- int offset = rdb->MountPointReparseBuffer.SubstituteNameOffset / sizeof(wchar_t);
- const wchar_t* PathBuffer = &rdb->MountPointReparseBuffer.PathBuffer[offset];
- result = QString::fromWCharArray(PathBuffer, length);
- } else {
+ if (rdb->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
int length = rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(wchar_t);
int offset = rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset / sizeof(wchar_t);
const wchar_t* PathBuffer = &rdb->SymbolicLinkReparseBuffer.PathBuffer[offset];
@@ -1529,8 +1538,7 @@ bool QFSFileEnginePrivate::isSymlink() const
if (hFind != INVALID_HANDLE_VALUE) {
::FindClose(hFind);
if ((findData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
- && (findData.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT
- || findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) {
+ && findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK) {
is_link = true;
}
}
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 12a992a..63c2ab8 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -88,7 +88,7 @@ QT_END_NAMESPACE
#include "qprocess_p.h"
#include <qbytearray.h>
-#include <qdatetime.h>
+#include <qelapsedtimer.h>
#include <qcoreapplication.h>
#include <qsocketnotifier.h>
#include <qtimer.h>
@@ -1639,7 +1639,7 @@ bool QProcess::waitForBytesWritten(int msecs)
if (d->processState == QProcess::NotRunning)
return false;
if (d->processState == QProcess::Starting) {
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
bool started = waitForStarted(msecs);
if (!started)
@@ -1676,7 +1676,7 @@ bool QProcess::waitForFinished(int msecs)
if (d->processState == QProcess::NotRunning)
return false;
if (d->processState == QProcess::Starting) {
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
bool started = waitForStarted(msecs);
if (!started)
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 5119ec0..216c382 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -92,7 +92,6 @@ QT_END_NAMESPACE
#include <private/qcoreapplication_p.h>
#include <private/qthread_p.h>
-#include <qdatetime.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qlist.h>
@@ -101,6 +100,7 @@ QT_END_NAMESPACE
#include <qsemaphore.h>
#include <qsocketnotifier.h>
#include <qthread.h>
+#include <qelapsedtimer.h>
#include <errno.h>
#include <stdlib.h>
@@ -933,7 +933,7 @@ bool QProcessPrivate::waitForReadyRead(int msecs)
qDebug("QProcessPrivate::waitForReadyRead(%d)", msecs);
#endif
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
forever {
@@ -1005,7 +1005,7 @@ bool QProcessPrivate::waitForBytesWritten(int msecs)
qDebug("QProcessPrivate::waitForBytesWritten(%d)", msecs);
#endif
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
while (!writeBuffer.isEmpty()) {
@@ -1072,7 +1072,7 @@ bool QProcessPrivate::waitForFinished(int msecs)
qDebug("QProcessPrivate::waitForFinished(%d)", msecs);
#endif
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
forever {
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 0fd965b..e0d92c0 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qcore_unix_p.h"
+#include "qelapsedtimer.h"
#ifndef Q_OS_VXWORKS
# if !defined(Q_OS_HPUX) || defined(__ia64)
@@ -56,74 +57,12 @@
#include <mach/mach_time.h>
#endif
-#if !defined(QT_NO_CLOCK_MONOTONIC)
-# if defined(QT_BOOTSTRAPPED)
-# define QT_NO_CLOCK_MONOTONIC
-# endif
-#endif
-
QT_BEGIN_NAMESPACE
-bool qt_gettime_is_monotonic()
-{
-#if (_POSIX_MONOTONIC_CLOCK-0 > 0) || defined(Q_OS_MAC)
- return true;
-#else
- static int returnValue = 0;
-
- if (returnValue == 0) {
-# if (_POSIX_MONOTONIC_CLOCK-0 < 0)
- returnValue = -1;
-# elif (_POSIX_MONOTONIC_CLOCK == 0)
- // detect if the system support monotonic timers
- long x = sysconf(_SC_MONOTONIC_CLOCK);
- returnValue = (x >= 200112L) ? 1 : -1;
-# endif
- }
-
- return returnValue != -1;
-#endif
-}
-
-timeval qt_gettime()
-{
- timeval tv;
-#if defined(Q_OS_MAC)
- static mach_timebase_info_data_t info = {0,0};
- if (info.denom == 0)
- mach_timebase_info(&info);
-
- uint64_t cpu_time = mach_absolute_time();
- uint64_t nsecs = cpu_time * (info.numer / info.denom);
- tv.tv_sec = nsecs / 1000000000ull;
- tv.tv_usec = (nsecs / 1000) - (tv.tv_sec * 1000000);
- return tv;
-#elif (_POSIX_MONOTONIC_CLOCK-0 > 0)
- timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- tv.tv_sec = ts.tv_sec;
- tv.tv_usec = ts.tv_nsec / 1000;
- return tv;
-#else
-# if !defined(QT_NO_CLOCK_MONOTONIC) && !defined(QT_BOOTSTRAPPED)
- if (qt_gettime_is_monotonic()) {
- timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- tv.tv_sec = ts.tv_sec;
- tv.tv_usec = ts.tv_nsec / 1000;
- return tv;
- }
-# endif
- // use gettimeofday
- ::gettimeofday(&tv, 0);
- return tv;
-#endif
-}
-
static inline bool time_update(struct timeval *tv, const struct timeval &start,
const struct timeval &timeout)
{
- if (!qt_gettime_is_monotonic()) {
+ if (!QElapsedTimer::isMonotonic()) {
// we cannot recalculate the timeout without a monotonic clock as the time may have changed
return false;
}
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 297b25d..439ca5a 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -314,8 +314,8 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options)
# define _POSIX_MONOTONIC_CLOCK -1
#endif
-bool qt_gettime_is_monotonic();
-timeval qt_gettime();
+timeval qt_gettime(); // in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp
+
Q_CORE_EXPORT int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
const struct timeval *tv);
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 2da5a7d..8fc3fb8 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -47,7 +47,6 @@
#include "qeventloop.h"
#include "qcorecmdlineargs_p.h"
#include <qdatastream.h>
-#include <qdatetime.h>
#include <qdebug.h>
#include <qdir.h>
#include <qfile.h>
@@ -59,6 +58,7 @@
#include <qthreadpool.h>
#include <qthreadstorage.h>
#include <private/qthread_p.h>
+#include <qelapsedtimer.h>
#include <qlibraryinfo.h>
#include <qvarlengtharray.h>
#include <private/qfactoryloader_p.h>
@@ -917,7 +917,7 @@ void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags, int m
QThreadData *data = QThreadData::current();
if (!data->eventDispatcher)
return;
- QTime start;
+ QElapsedTimer start;
start.start();
if (flags & QEventLoop::DeferredDeletion)
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index a141887..f7d45ac 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -45,6 +45,7 @@
#include "qpair.h"
#include "qsocketnotifier.h"
#include "qthread.h"
+#include "qelapsedtimer.h"
#include "qeventdispatcher_unix_p.h"
#include <private/qthread_p.h>
@@ -311,12 +312,10 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
QTimerInfoList::QTimerInfoList()
{
- currentTime = qt_gettime();
-
#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC)
- if (!qt_gettime_is_monotonic()) {
+ if (!QElapsedTimer::isMonotonic()) {
// not using monotonic timers, initialize the timeChanged() machinery
- previousTime = currentTime;
+ previousTime = qt_gettime();
tms unused;
previousTicks = times(&unused);
@@ -393,7 +392,7 @@ bool QTimerInfoList::timeChanged(timeval *delta)
void QTimerInfoList::repairTimersIfNeeded()
{
- if (qt_gettime_is_monotonic())
+ if (QElapsedTimer::isMonotonic())
return;
timeval delta;
if (timeChanged(&delta))
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 7d1e1d3..ca54c6c 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -412,12 +412,12 @@ bool QTranslator::load(const QString & filename, const QString & directory,
realname = prefix + fname + (suffix.isNull() ? QString::fromLatin1(".qm") : suffix);
fi.setFile(realname);
- if (fi.isReadable())
+ if (fi.isReadable() && fi.isFile())
break;
realname = prefix + fname;
fi.setFile(realname);
- if (fi.isReadable())
+ if (fi.isReadable() && fi.isFile())
break;
int rightmost = 0;
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index b6b3281..69cca06 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp