summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Replace obsolete types with their newer counterpartsSze Howe Koh2014-02-251-4/+4
| | | | | | | | | This patch ignores: - Docs for obsolete types themselves - Comparisons between new and obsolete types Change-Id: Id9b1e628255113e7c44520abe0f8a4e0db4a283d Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QAssociative/SequentialIterable: add missing \since 5.2J-P Nurmi2014-02-251-4/+4
| | | | | | Change-Id: Ia78fa0d70c85f06f48c3bbab47370e15008abe03 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| * Doc: Fix broken linksSze Howe Koh2014-02-041-3/+3
| | | | | | | | | | Change-Id: Ic275dfbf0b332fc34ea0fac1c31c4935ad961527 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-261-13/+49
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * QVariant: Convert automatically from enum types to integral types.Olivier Goffart2013-11-081-12/+45
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QVariant] Variant containing enum types can now be converted to integer Change-Id: Ibbbc9ae29ab45d67c582fa2d406afc19c5dc41ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * Fix QVariant::canConvert with longlongOlivier Goffart2013-11-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | Add few cases where conversion to or from LongLong was missing We need to make it work if we want to use variant.canConvert<qint64> [ChangeLog][QtCore][QVariant] Fixed QVariant::canConvert with longlong Change-Id: I0f65073802b62d99250601dd90a8cd2e4d934b60 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * QMetaType: Fix conversion between module types.Stephen Kelly2013-11-061-1/+2
| | | | | | | | | | Change-Id: I7215b4599c3f0459139b32b6571f0a9e60182ee9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Make use of the internal space for enum in QVariantOlivier Goffart2013-11-081-1/+1
|/ | | | | | | | Enums are movable even if they have not been tagged as such, and therefore can safely make use of the internal storage. Change-Id: I3bec8556bfeb4a07cb30d918f8d1dd2565d6d94a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Account for QPolygonF type when loading/saving the QVariantAndy Shaw2013-10-151-1/+6
| | | | | | | | | | | When the QPolygonF type was added to QMetaType it did not bump up the values in load() and save() for QVariant. Task-number: QTBUG-33981 Change-Id: I7ad99cda70620c5449c15527c3daf920972d047f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-30/+30
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-271-0/+17
| | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* MetaType: de-inline the container iterables.Stephen Kelly2013-09-201-77/+340
| | | | | | | | This means the *Iterables and corresponding const_iterators need to be exported. Change-Id: Ic93283616bda96e0d7752b0e881bf0230a5c2146 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* MetaType: Add assignment operator to the container iterators.Stephen Kelly2013-09-191-0/+8
| | | | | Change-Id: Ib4f2197a0ab6bd41c91de667cd3087fb40e44097 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QVariant::canConvert: Use the old type when checking for QObject* conversion.Stephen Kelly2013-09-051-1/+1
| | | | | Change-Id: I8450c74ecfdeee96e73b82438c5ef83c3acf4444 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-201-0/+48
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp tools/configure/configureapp.cpp Change-Id: I3092bd3276af14304b7ab3ae1e1cc05d11cdede0
| * Add basic conversion functions from QVariant(QJsonValue).Jędrzej Nowacki2013-06-141-0/+48
| | | | | | | | | | | | | | | | There is a mismatch how QML and C++ converts QJsonValue. This patch unifies conversions by adding QJsonValue support in QVariant::convert(). Change-Id: I8a1db3d77c517945ef48064b4b66ba03aa4f2fd0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Don't convert built-in types to strings for qDebug.Stephen Kelly2013-06-071-2/+4
| | | | | | | | | | | | | | | | | | This was introduced by 7ed15da3 (Core: QDebug and comparison operator support metatypes,, 2013-03-20). Change-Id: Id89aaffeee8d519ca73f0b52b1ac8b9d233cb5f1 Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Core: QDebug and comparison operator support metatypes.Christoph Schleifenbaum2013-05-271-11/+128
| | | | | | | | | | | | | | | | This patch adds a way to enable operator<, operator== and operator<< into QDebug for QVariants with custom types. Change-Id: I3d12d891bd7252ad2b8f1de69bced354800a1f29 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Make it possible to access QPair and std::pair elements from a QVariant.Stephen Kelly2013-05-201-0/+6
| | | | | | | | | | Change-Id: I9dc73748073d0d1e43bdadbce73339dfcc1bc647 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Add container access functionality for associative containers in QVariant.Stephen Kelly2013-05-201-1/+188
| | | | | | | | | | Change-Id: I4763a4c157e52918a0a68cba63624c0649aca235 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Add automatic container access registration for built-in containers.Stephen Kelly2013-05-081-7/+3
| | | | | | | | | | Change-Id: I4d590c23e072994930922ff73367600f848fbcf0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Add QVariantList extraction from a QVariant with a sequential container.Stephen Kelly2013-05-081-0/+7
| | | | | | | | | | Change-Id: Id9fac7bf47ed3fbb385222b25941215ac24b8b88 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Add QVariant container iteration API.Stephen Kelly2013-05-081-1/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new set of classes is introduced for iterating over the contents of a container within a QVariant without knowing the exact type of the container, but with the guarantee that the element type within the container is a metatype. The implementation of the iterable interface uses the stl-compatible container API so that we can also iterate over stl containers, or any other container which also conforms to stl norms. This enables the functionality in the bug report. Task-number: QTBUG-23566 Change-Id: I92a2f3458516de201b8f0e470982c4d030e8ac8b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Core: Support for converting user defined QVariant types.Christoph Schleifenbaum2013-05-081-3/+44
|/ | | | | | | | | | | | | | | | | This patchs allows the user to convert defined QMetaType types like MyType to be converted by using e.g. QVariant::toString(), mapping to MyType::toString(). Also all the other QVariant::toXYZ() methods are supported so far. The patch adds static methods QMetaType::registerConverter supporting: - implicit convertion - conversion using member method of source type - conversion using unary functor Change-Id: I4f1db83d9c78bcc9df5c42f82f95cce0480cdcc3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Replaced canConvert() with canConvert(Int)Venu2013-04-031-1/+1
| | | | | | | | | | | This change amends my earlier change to make the function reference relevant to the example being discussed. Task-number: QTBUG-28204 Change-Id: I841a561ba117f83a96b8b4a3661cea2a7a3e47da Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Doc: Replaced canConvert() with canConvert(int)Venu2013-03-291-1/+1
| | | | | | | | | | This change makes the function reference more relevant to the example being discussed. Task-number: QTBUG-28204 Change-Id: I50bea45f1e11d7e1eef4bc6726ebb329151fbc3d Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Merge remote-tracking branch 'gerrit/release' into stableSamuel Rødal2013-03-211-115/+165
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/features/qt_module_headers.prf mkspecs/features/qt_tool.prf src/angle/angle.pro src/tools/bootstrap/bootstrap.pro tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
| * Make QVariant docs refer to QMetaType::Type.Mitch Curtis2013-03-191-115/+165
| | | | | | | | | | | | | | Task-number: QTBUG-30014 Change-Id: Ie4c0df92345bcb79ef44fb6f345cba9fc934d32f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-141-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * Doc: Fix broken \keyword linkSze Howe Koh2013-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix 19 counts of "Can't link to 'default-constructed value'" warnings. There was only one link to "default-constructed values", so the cleanest solution was to change the keyword. Also included a related typo fix. Change-Id: I84b47743ecb72a1b2731ef65080fa1e630d478a4 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-281-2/+2
|\| | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| * Doc: Fix module name formatSze Howe Koh2013-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Rename QRegularExpression-related feature defs to QT_NO_REGULAREXPRESSIONGiuseppe D'Angelo2013-01-071-4/+6
|/ | | | | | | | | | | | QRegExp and QRegularExpression are totally independent, therefore using two different defines is the right thing to do. Also, document the new define in qfeatures.{txt,h}. Change-Id: Ice4826ea543f4b22f1cc27bf31ed6e043d0c43b0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Remove QUUID_STRING from qfeatures.{h,txt}Tasuku Suzuki2012-12-051-4/+0
| | | | | | | It is too specific and relatively small Change-Id: I55ec15ecaac0692741996a5c15a111db696490cf Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix QVariant streaming in Qt3 compatibility mode.Jędrzej Nowacki2012-11-241-3/+3
| | | | | | Task-number: QTBUG-27700 Change-Id: I0408293e43c3330dbc4746198a19709e795f552a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make documentation of QVariant::isNull more explicit.Jędrzej Nowacki2012-09-291-1/+11
| | | | | | Task-number: QTBUG-22933 Change-Id: I1d8d3fc778ba00bcad11caaaf8af7d87186f18e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+1
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* De-inline QVariant(float)Harald Fernengel2012-08-231-0/+3
| | | | | | | | | All QVariant constructors are not inline, so change QVariant(float) as well. This allows for refactoring of QVariant during lifetime of Qt 5 without breaking QVariant(float) case. Change-Id: Icd1fc331a1ef8a2872be811aa7d1160406038f06 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Doc: Work on QVariant's equality operator.Geir Vattekar2012-08-201-2/+13
| | | | | | Task-number: QTBUG-26018 Change-Id: I6627456d166bc0a036cadeee7bd51aa8e576a818 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove QWidgetStar.Stephen Kelly2012-08-181-3/+1
| | | | | | | | | | | | This allows us to remove the odd hacks to get the static metaobject for the QWidget* metatype. The QWidget* is still an automatic metatype thanks to the QObject partial template specialization. It is registered as a metatype at runtime automatically in qwidgetsvariant.cpp. Change-Id: Ie01b69eadf2cbe87af1a86c3284550f60dcf9e94 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make the "\internal" qdoc command stand on its own lineLaszlo Papp2012-08-151-4/+9
| | | | | | | | | | The qdoc manual currently claims that the command must stand on its own line. The change follows the consistency with the rest and how the example looks like inside the qdoc manual for this command. Change-Id: I6b653dc95cf9d84e4adf32220dace5d313678419 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Speed up construction of basic QVariantsHarald Fernengel2012-08-151-37/+92
| | | | | | | | | | | | | | | | | Instead of first creating an initialized Private struct, then overwrite the member variables, we added an internal constructor that initializes the private struct sanely. In the new (inlined, internal) constructor, both the MSB bits in the bitfield are 0, and since the value of internal meta-type ID is so low that the two MSB bits should never be set, the compiler can (hopefully) optimize away the bit-fiddling initialization of the bit-field. Callgrind shows about 33% speed-up in e.g. QVariant::QVariant(int) Change-Id: I706773a71c0d8dcbe119ad15411578b81892deb5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix crash in QVariant::canConvert().Volker Krause2012-07-271-1/+4
| | | | | | | | | When containing a QObject (or sub-class) pointer and trying to convert to a QObject pointer canConvert() did dereference the pointer without checking for it being null. Change-Id: Ie274e54f2f817f2b6c5df64504f8af6359b8f38d Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* fix QVariant qdoc error - mark const QVariant::data_ptr() internalJeremy Katz2012-07-271-0/+5
| | | | | | Change-Id: I1df93780f271ce06c3aa10c4bdcc1c2a43097b72 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Implement implicit constructors for built-in classes.Stephen Kelly2012-07-271-0/+126
| | | | | | Change-Id: I6b0b104bc1da3252d014615c50b81830de42e722 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Clarify ambiguous sentence in QVariant::toBool() documentation.Mitch Curtis2012-07-231-2/+2
| | | | | | Task-number: QTBUG-26482 Change-Id: Id9158ba1f7ffa5af169f808aed4559f7a0470e20 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>