diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-19 15:50:28 +0200 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-09-19 15:50:28 +0200 |
commit | 715d0b474b23bc230319c33eb7316af23b5fccaa (patch) | |
tree | ffd714454ce559433551632ffaaee1a21d8fd0a3 | |
parent | 607f2db351edf4b0f677c302fa37733596abe024 (diff) | |
parent | 52eb21be3dd3a76d018b5b86a8d72d68accb924a (diff) |
Merge branch 'stable' into dev
Conflicts:
src/qml/qml/v8/qqmlbuiltinfunctions.cpp
tests/auto/qml/qml.pro
Change-Id: Ib373aed6a8f8df9521740fb5b080daed38546cd2
18 files changed, 492 insertions, 46 deletions
diff --git a/examples/quick/models/abstractitemmodel/doc/images/qml-abstractitemmodel-example.png b/examples/quick/models/abstractitemmodel/doc/images/qml-abstractitemmodel-example.png Binary files differnew file mode 100644 index 0000000000..1d7ff197ad --- /dev/null +++ b/examples/quick/models/abstractitemmodel/doc/images/qml-abstractitemmodel-example.png diff --git a/examples/quick/models/abstractitemmodel/doc/src/abstractitemmodel-example.qdoc b/examples/quick/models/abstractitemmodel/doc/src/abstractitemmodel-example.qdoc new file mode 100644 index 0000000000..bcf1034226 --- /dev/null +++ b/examples/quick/models/abstractitemmodel/doc/src/abstractitemmodel-example.qdoc @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example models/abstractitemmodel + \title Models and Views: AbstractItemModel Example + \brief Shows how to use a QAbstractItemModel subclass as a model in QML. + + \image qml-abstractitemmodel-example.png +*/
\ No newline at end of file diff --git a/examples/quick/models/objectlistmodel/doc/images/qml-objectlistmodel-example.png b/examples/quick/models/objectlistmodel/doc/images/qml-objectlistmodel-example.png Binary files differnew file mode 100644 index 0000000000..c0fc490c75 --- /dev/null +++ b/examples/quick/models/objectlistmodel/doc/images/qml-objectlistmodel-example.png diff --git a/examples/quick/models/objectlistmodel/doc/src/objectlistmodel-example.qdoc b/examples/quick/models/objectlistmodel/doc/src/objectlistmodel-example.qdoc new file mode 100644 index 0000000000..2d1046dc5e --- /dev/null +++ b/examples/quick/models/objectlistmodel/doc/src/objectlistmodel-example.qdoc @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example models/objectlistmodel + \title Models and Views: Object ListModel Example + \brief Shows how to use a QList<QObject*> as a model in QML. + + \image qml-objectlistmodel-example.png +*/ diff --git a/examples/quick/models/stringlistmodel/doc/images/qml-stringlistmodel-example.png b/examples/quick/models/stringlistmodel/doc/images/qml-stringlistmodel-example.png Binary files differnew file mode 100644 index 0000000000..c8c888b620 --- /dev/null +++ b/examples/quick/models/stringlistmodel/doc/images/qml-stringlistmodel-example.png diff --git a/examples/quick/models/stringlistmodel/doc/src/stringlistmodel-example.qdoc b/examples/quick/models/stringlistmodel/doc/src/stringlistmodel-example.qdoc new file mode 100644 index 0000000000..3ee9058d57 --- /dev/null +++ b/examples/quick/models/stringlistmodel/doc/src/stringlistmodel-example.qdoc @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example models/stringlistmodel + \title Models and Views: String ListModel Example + \brief Shows how to use a QStringList as a model in QML. + + \image qml-stringlistmodel-example.png +*/ diff --git a/src/qml/doc/src/cppintegration/contextproperties.qdoc b/src/qml/doc/src/cppintegration/contextproperties.qdoc index 1c2bced738..e0d5091f2f 100644 --- a/src/qml/doc/src/cppintegration/contextproperties.qdoc +++ b/src/qml/doc/src/cppintegration/contextproperties.qdoc @@ -84,11 +84,15 @@ a \l Connections object: \snippet qml/qtbinding/context-advanced/connections.qml 0 Context properties can be useful for using C++ based data models in a QML view. See the -\l {quick/modelviews/stringlistmodel}{String ListModel}, -\l {quick/modelviews/objectlistmodel}{Object ListModel} and -\l {quick/modelviews/abstractitemmodel}{AbstractItemModel} models for -respective examples on using QStringListModel, QObjectList-based models and QAbstractItemModel -in QML views. +following examples: +\list + \li \l {Models and Views: String ListModel Example}{String ListModel} + \li \l {Models and Views: Object ListModel Example}{Object ListModel} + \li \l {Models and Views: AbstractItemModel Example}{AbstractItemModel} +\endlist + +demonstrating the use of QStringList, \l{QList<QObject*>}-based models and +QAbstractItemModel in QML views. Also see the QQmlContext documentation for more information. diff --git a/src/qml/doc/src/javascript/date.qdoc b/src/qml/doc/src/javascript/date.qdoc index 085d988377..89dc464adb 100644 --- a/src/qml/doc/src/javascript/date.qdoc +++ b/src/qml/doc/src/javascript/date.qdoc @@ -132,17 +132,18 @@ hour, if DST is currently in effect, while it was not for the time specified, or vice versa. - \sa {QtQuick2::Locale}{Locale} + \sa {QtQml2::Locale}{Locale} */ /*! - \qmlmethod string Date::toLocaleString(locale,format) + \qmlmethod string Date::toLocaleString(locale, format) Converts the Date to a string containing the date and time suitable for the specified \a locale in the specified \a format. - If the format is not specified Locale.LongFormat will be used. + If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will + be used. If \a locale is not specified, the default locale will be used. @@ -158,12 +159,13 @@ */ /*! - \qmlmethod string Date::toLocaleDateString(locale,format) + \qmlmethod string Date::toLocaleDateString(locale, format) Converts the Date to a string containing the date suitable for the specified \a locale in the specified \a format. - If the format is not specified Locale.LongFormat will be used. + If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will + be used. If \a locale is not specified, the default locale will be used. @@ -179,12 +181,13 @@ */ /*! - \qmlmethod string Date::toLocaleTimeString(locale,format) + \qmlmethod string Date::toLocaleTimeString(locale, format) Converts the Date to a string containing the time suitable for the specified \a locale in the specified \a format. - If the format is not specified Locale.LongFormat will be used. + If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will + be used. If \a locale is not specified, the default locale will be used. @@ -200,10 +203,97 @@ */ /*! + \qmlmethod string Date::fromLocaleString(locale, dateTimeString, format) + + Converts the datetime string \a dateTimeString to a \l {QtQml2::Date}{Date} + object using \a locale and \a format. + + If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will + be used. + + If \a locale is not specified, the default locale will be used. + + The following example shows a datetime being parsed from a datetime string + in a certain format using the default locale: + \code + import QtQml 2.0 + + QtObject { + property var locale: Qt.locale() + property string dateTimeString: "Tue 2013-09-17 10:56:06" + + Component.onCompleted: { + print(Date.fromLocaleString(locale, dateTimeString, "ddd yyyy-MM-dd hh:mm:ss")); + } + } + \endcode +*/ + +/*! + \qmlmethod string Date::fromLocaleDateString(locale, dateString, format) + + Converts the date string \a dateString to a \l {QtQml2::Date}{Date} object + using \a locale and \a format. + + If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will + be used. + + If \a locale is not specified, the default locale will be used. + + The following example shows the current date first being formatted as a date + string using the default locale and format, then parsed back again in the + same manner: + \code + import QtQml 2.0 + + QtObject { + property var locale: Qt.locale() + property date currentDate: new Date() + property string dateString + + Component.onCompleted: { + dateString = currentDate.toLocaleDateString(); + print(Date.fromLocaleDateString(dateString)); + } + } + \endcode +*/ + +/*! + \qmlmethod string Date::fromLocaleTimeString(locale, timeString, format) + + Converts the time string \a timeString to a \l {QtQml2::Date}{Date} object + using \a locale and \a format. + + If \a format is not specified, \l {QtQml2::Locale}{Locale.LongFormat} will + be used. + + If \a locale is not specified, the default locale will be used. + + The following example shows the current time first being formatted as a time + string using the default locale and a short format, then parsed back again + in the same manner: + \code + import QtQuick 2.0 + + QtObject { + property var locale: Qt.locale() + property date currentTime: new Date() + property string timeString + + Component.onCompleted: { + timeString = currentTime.toLocaleTimeString(locale, Locale.ShortFormat); + print(Date.fromLocaleTimeString(locale, timeString, Locale.ShortFormat)); + } + } + \endcode +*/ + +/*! \qmlmethod string Date::timeZoneUpdated() Informs the JS engine that the system's timezone has been changed, which is necessary - for the correct manipulation of date/time data. + for the correct manipulation of datetime data. JS stores Date objects in UTC time; all access to and from Date components in local time involves the application of the current offset from UTC. If the current offset diff --git a/src/qml/doc/src/javascript/number.qdoc b/src/qml/doc/src/javascript/number.qdoc index 20fe40c86f..fa56f71925 100644 --- a/src/qml/doc/src/javascript/number.qdoc +++ b/src/qml/doc/src/javascript/number.qdoc @@ -33,7 +33,7 @@ The QML Number object extends the JS Number object with locale aware functions. - \sa {QtQuick2::Locale}{Locale} + \sa {QtQml2::Locale}{Locale} */ /*! diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 5e7116e271..405411e65c 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -798,7 +798,7 @@ V8_DEFINE_EXTENSION(QV8LocaleDataDeletable, localeV8Data); This product includes software developed by the University of California, Berkeley and its contributors. - \sa {QtQuick2::Date}{Date}, {QtQuick2::Number}{Number} + \sa Date, Number */ QQmlLocale::QQmlLocale() @@ -840,7 +840,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) } /*! - \qmlproperty string QtQuick2::Locale::name + \qmlproperty string QtQml2::Locale::name Holds the language and country of this locale as a string of the form "language_country", where @@ -849,77 +849,77 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty string QtQuick2::Locale::decimalPoint + \qmlproperty string QtQml2::Locale::decimalPoint Holds the decimal point character of this locale. */ /*! - \qmlproperty string QtQuick2::Locale::groupSeparator + \qmlproperty string QtQml2::Locale::groupSeparator Holds the group separator character of this locale. */ /*! - \qmlproperty string QtQuick2::Locale::percent + \qmlproperty string QtQml2::Locale::percent Holds the percent character of this locale. */ /*! - \qmlproperty string QtQuick2::Locale::zeroDigit + \qmlproperty string QtQml2::Locale::zeroDigit Holds Returns the zero digit character of this locale. */ /*! - \qmlproperty string QtQuick2::Locale::negativeSign + \qmlproperty string QtQml2::Locale::negativeSign Holds the negative sign character of this locale. */ /*! - \qmlproperty string QtQuick2::Locale::positiveSign + \qmlproperty string QtQml2::Locale::positiveSign Holds the positive sign character of this locale. */ /*! - \qmlproperty string QtQuick2::Locale::exponential + \qmlproperty string QtQml2::Locale::exponential Holds the exponential character of this locale. */ /*! - \qmlmethod string QtQuick2::Locale::dateTimeFormat(type) + \qmlmethod string QtQml2::Locale::dateTimeFormat(type) Returns the date time format used for the current locale. \a type specifies the FormatType to return. - \sa {QtQuick2::Date}{Date} + \sa Date */ /*! - \qmlmethod string QtQuick2::Locale::dateFormat(type) + \qmlmethod string QtQml2::Locale::dateFormat(type) Returns the date format used for the current locale. \a type specifies the FormatType to return. - \sa {QtQuick2::Date}{Date} + \sa Date */ /*! - \qmlmethod string QtQuick2::Locale::timeFormat(type) + \qmlmethod string QtQml2::Locale::timeFormat(type) Returns the time format used for the current locale. \a type specifies the FormatType to return. - \sa {QtQuick2::Date}{Date} + \sa Date */ /*! - \qmlmethod string QtQuick2::Locale::monthName(month, type) + \qmlmethod string QtQml2::Locale::monthName(month, type) Returns the localized name of \a month (0-11), in the optional \l FormatType specified by \a type. @@ -931,7 +931,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlmethod string QtQuick2::Locale::standaloneMonthName(month, type) + \qmlmethod string QtQml2::Locale::standaloneMonthName(month, type) Returns the localized name of \a month (0-11) that is used as a standalone text, in the optional \l FormatType specified by \a type. @@ -946,7 +946,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlmethod string QtQuick2::Locale::dayName(day, type) + \qmlmethod string QtQml2::Locale::dayName(day, type) Returns the localized name of the \a day (where 0 represents Sunday, 1 represents Monday and so on), in the optional @@ -956,7 +956,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlmethod string QtQuick2::Locale::standaloneDayName(day, type) + \qmlmethod string QtQml2::Locale::standaloneDayName(day, type) Returns the localized name of the \a day (where 0 represents Sunday, 1 represents Monday and so on) that is used as a @@ -969,7 +969,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty enumeration QtQuick2::Locale::firstDayOfWeek + \qmlproperty enumeration QtQml2::Locale::firstDayOfWeek Holds the first day of the week according to the current locale. @@ -988,7 +988,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty Array<int> QtQuick2::Locale::weekDays + \qmlproperty Array<int> QtQml2::Locale::weekDays Holds an array of days that are considered week days according to the current locale, where Sunday is 0 and Saturday is 6. @@ -997,7 +997,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty Array<string> QtQuick2::Locale::uiLanguages + \qmlproperty Array<string> QtQml2::Locale::uiLanguages Returns an ordered list of locale names for translation purposes in preference order. @@ -1009,7 +1009,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty enumeration QtQuick2::Locale::textDirection + \qmlproperty enumeration QtQml2::Locale::textDirection Holds the text direction of the language: \list @@ -1019,19 +1019,19 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty string QtQuick2::Locale::amText + \qmlproperty string QtQml2::Locale::amText The localized name of the "AM" suffix for times specified using the conventions of the 12-hour clock. */ /*! - \qmlproperty string QtQuick2::Locale::pmText + \qmlproperty string QtQml2::Locale::pmText The localized name of the "PM" suffix for times specified using the conventions of the 12-hour clock. */ /*! - \qmlmethod string QtQuick2::Locale::currencySymbol(format) + \qmlmethod string QtQml2::Locale::currencySymbol(format) Returns the currency symbol for the specified \a format: \list @@ -1043,7 +1043,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty string QtQuick2::Locale::nativeLanguageName + \qmlproperty string QtQml2::Locale::nativeLanguageName Holds a native name of the language for the locale. For example "Schwiizertüütsch" for Swiss-German locale. @@ -1052,7 +1052,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty string QtQuick2::Locale::nativeCountryName + \qmlproperty string QtQml2::Locale::nativeCountryName Holds a native name of the country for the locale. For example "España" for Spanish/Spain locale. @@ -1061,7 +1061,7 @@ QV4::ReturnedValue QQmlLocale::method_localeCompare(QV4::SimpleCallContext *ctx) */ /*! - \qmlproperty enumeration QtQuick2::Locale::measurementSystem + \qmlproperty enumeration QtQml2::Locale::measurementSystem This property defines which units are used for measurement. diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index c195994de4..0cbb6e83a9 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -931,7 +931,7 @@ QQuickIntValidator::QQuickIntValidator(QObject *parent) This property holds the name of the locale used to interpret the number. - \sa QML:Qt::locale() + \sa {QtQml2::Qt::locale()}{Qt.locale()} */ QString QQuickIntValidator::localeName() const @@ -1006,7 +1006,7 @@ QQuickDoubleValidator::QQuickDoubleValidator(QObject *parent) This property holds the name of the locale used to interpret the number. - \sa QML:Qt::locale() + \sa {QtQml2::Qt::locale()}{Qt.locale()} */ QString QQuickDoubleValidator::localeName() const diff --git a/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro b/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro index 1cb792eff2..1f957c23ff 100644 --- a/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro +++ b/tests/auto/particles/qquicktrailemitter/qquicktrailemitter.pro @@ -3,6 +3,8 @@ TARGET = tst_qquicktrailemitter SOURCES += tst_qquicktrailemitter.cpp macx:CONFIG -= app_bundle +win32-msvc2012:CONFIG += insignificant_test # QTBUG-33421 + include (../../shared/util.pri) TESTDATA = data/* diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro index 58132786a0..2036f1cd7a 100644 --- a/tests/auto/qml/qml.pro +++ b/tests/auto/qml/qml.pro @@ -56,7 +56,8 @@ PRIVATETESTS += \ qrcqml \ qqmltimer \ qqmlinstantiator \ - qv4debugger + qv4debugger \ + qqmlenginecleanup qtHaveModule(widgets) { PUBLICTESTS += \ diff --git a/tests/auto/qml/qqmlenginecleanup/data/TestType.qml b/tests/auto/qml/qqmlenginecleanup/data/TestType.qml new file mode 100644 index 0000000000..a667c11327 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/data/TestType.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQml 2.0 +QtObject{property int notJustAStandardQtObject: 10 } diff --git a/tests/auto/qml/qqmlenginecleanup/data/types.qml b/tests/auto/qml/qqmlenginecleanup/data/types.qml new file mode 100644 index 0000000000..c8613a270d --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/data/types.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQml 2.0 +import QtQuick 2.0 +import QtQuick.Window 2.0 +import QtQuick.Particles 2.0 +import Test 2.0 +import "." + +QtObject { + //Doesn't create items, just checks that the types are accessible + property TestType tt + property TestTypeCpp ttc + property ParticleSystem ps + property Window wi + property Item it +} diff --git a/tests/auto/qml/qqmlenginecleanup/qqmlenginecleanup.pro b/tests/auto/qml/qqmlenginecleanup/qqmlenginecleanup.pro new file mode 100644 index 0000000000..6428933233 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/qqmlenginecleanup.pro @@ -0,0 +1,10 @@ +CONFIG += testcase +TARGET = tst_qqmlenginecleanup +macx:CONFIG -= app_bundle + +include (../../shared/util.pri) + +SOURCES += tst_qqmlenginecleanup.cpp + +QT += testlib qml +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp new file mode 100644 index 0000000000..e5bfbd0ec8 --- /dev/null +++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../shared/util.h" +#include <QtCore/QObject> +#include <QtQml/qqml.h> +#include <QtQml/QQmlEngine> +#include <QtQml/QQmlComponent> + +//Separate test, because if engine cleanup attempts fail they can easily break unrelated tests +class tst_qqmlenginecleanup : public QQmlDataTest +{ + Q_OBJECT +public: + tst_qqmlenginecleanup() {} + +private slots: + void test_qmlClearTypeRegistrations(); +}; + +void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations() +{ + //Test for preventing memory leaks is in tests/manual/qmltypememory + QQmlEngine* engine; + QQmlComponent* component; + QUrl testFile = testFileUrl("types.qml"); + + qmlRegisterType<QObject>("Test", 2, 0, "TestTypeCpp"); + engine = new QQmlEngine; + component = new QQmlComponent(engine, testFile); + QVERIFY(component->isReady()); + + delete engine; + delete component; + qmlClearTypeRegistrations(); + + //2nd run verifies that types can reload after a qmlClearTypeRegistrations + qmlRegisterType<QObject>("Test", 2, 0, "TestTypeCpp"); + engine = new QQmlEngine; + component = new QQmlComponent(engine, testFile); + QVERIFY(component->isReady()); + + delete engine; + delete component; + qmlClearTypeRegistrations(); + + //3nd run verifies that TestTypeCpp is no longer registered + engine = new QQmlEngine; + component = new QQmlComponent(engine, testFile); + QVERIFY(component->isError()); + QCOMPARE(component->errorString(), + testFile.toString() +":46 module \"Test\" is not installed\n"); + + delete engine; + delete component; +} + +QTEST_MAIN(tst_qqmlenginecleanup) + +#include "tst_qqmlenginecleanup.moc" diff --git a/tests/manual/qmltypememory/main.qml b/tests/manual/qmltypememory/main.qml index 7bc9006aec..fa78381601 100644 --- a/tests/manual/qmltypememory/main.qml +++ b/tests/manual/qmltypememory/main.qml @@ -51,4 +51,5 @@ QtObject { property TestType tt //No object, although it should be properly parented if there were one property TestTypeCpp tt2 //No object, although it should be properly parented if there were one property TestTypePlugin tt3 + property Item it } |