summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Move threading overviews from qtbase.git to qtdoc.gitSze Howe Koh2013-11-084-1072/+0
| | | | | | | | | | | | | - This topic is relevant to multiple modules, as illustrated by the "Thread-Support in Qt Modules" page. Multithreading can be done in both C++ and QML. - Moving also fixes links to QML-related pages. - Snippets are copied, not moved. QThreadStorage docs need them. - QDoc: "DEPENDS += qtdoc" added to keep the "\reentrant" command working. It creates a link to the "reentrant" keyword. Change-Id: I2cdf6139e62d66911561c30fcca7aab160a694b1 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Prevent clang from warning about unused variablesKai Koehne2013-11-081-0/+3
| | | | | | | | Fixes a compiler warning introduced by 79b975756a100cc46182 Change-Id: Ie9bc677d061f0bb0530eae88715069042b2ab440 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* 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>
* qfeatures.txt: add section about XML schemaPeter Hartmann2013-11-071-0/+7
| | | | | | | | ... so the XML schema part can be disabled in the xmlpatterns module, while still using other functionality (e.g. XPath). Change-Id: I3599ea8f915d34e0b1ba5d6a30f3f6269a4c992e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Revert "Add tracing to logging framework"Kai Koehne2013-11-079-642/+9
| | | | | | | | | | | | | | | | | | | The tracing API still misses some real-world exposure. Let's re-do this in dev to have more time. This reverts parts of following commits: 466e0dff4bb686e51d0ab3f905631fcb7dd8bfef 7a47aebe9ed41d6cd9c9bcd45758d4d553668e99 a652bab6a7ebf78b029fea95c2801deb6f4f524a 8f0654ceb878b6c8a08c7f5b790027c26e007c13 4162522edd9d31bd2798ab37f083adff818d886e 32f27b4367c4e042a3f0cda671579494e31c1d69 9ff81bdc1ab4e3d14914192cd63ae625a507fe90 Change-Id: If97340c37b8b3363f597683336a8390d5ff386f1 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Add missing Q_INIT_RESOURCETor Arne Vestbø2013-11-071-0/+6
| | | | | | | | | | | The library needs to do Q_INIT_RESOURCE for all resources it uses internally, otherwise static linking will fail, and the user has no idea how to rectify it as the name of the missing resource is not known. The Q_INIT_RESOURCE needs to happen outside of any namespace, hence the use of static initResources() functions. Change-Id: I8f7d36b440b05809d97dd489cf8789f345633cec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrlTwoFlag: add two missing constexprMarc Mutz2013-11-071-2/+2
| | | | | | | | | The other member functions that can be constexpr already are, only these were missing. Change-Id: I717c74b210b45cfb8af9168d61e27e3ff2f6a9c9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q(UrlTwo)Flags: avoid undefined behaviorMarc Mutz2013-11-072-21/+21
| | | | | | | | | | | | | | Loading an enum with a value that isn't in the enum is undefined, according to Clang's usan. So when doing logical operations on QFlags<E>, don't go through the QFlags(E) constructor, but via QFlags(QFlag) (=int) instead. Apply the same change to QUrlTwoFlags. Change-Id: I5f27e22c4d831482fcbba88b97cb124fb005e3fd Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix cross-module linksSze Howe Koh2013-11-062-5/+2
| | | | | | | | | | - Remove Active Qt -- it's not really plugin-related - Add QDoc dependencies - NOTE: Can't add Qt QML because QDoc would get confused between the C++ and QML "Qt" namespaces. Change-Id: I15a76dbd5235f13598a3802a815f7f49b80eac8a Reviewed-by: Jerome Pasion <jerome.pasion@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>
* Clarify Q_INIT_RESOURCE in relation to namespacesTor Arne Vestbø2013-11-061-0/+4
| | | | | | | | | | The constructor functions generated by rcc are put in the global namespace. As there is no way to forward-declare a function in the global namespace from within another namespace, Q_INIT_RESOURCE must always be called from the global namespace. Change-Id: I8b8b9451271cf2f9147164696a6df7615678ab03 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Updated url variable in qdocconf files.Jerome Pasion2013-11-061-1/+1
| | | | | | | | | | | | | | In 5.2, the HTML output is in a flatter structure and when they are hosted in qt-project.org/doc, the documentation will be found at http://qt-project.org/doc/qt-$QT_VER The url variable is used by projects outside of Qt 5 which need to link to Qt 5 documentation, such as Qt Creator. Task-number: QTBUG-34584 Change-Id: Ifa55fcd9e402b0e184a41e316340e46aeb7101de Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* QGlobal: static_assert that sizeof(int) == 4 and UCHAR_MAX == 255Marc Mutz2013-11-061-0/+8
| | | | | | | | | According to Thiago, Qt assumes this in a lot of places, so make it explicit. Change-Id: I3f4a55699379fd9fe4d792061c80b3b589c10c53 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Force length fo licensee literals to be computed at runtimeKai Koehne2013-11-061-2/+2
| | | | | | | | | | Prevent compilers from computing strlen() at compile time by passing a volatile pointer. Task-number: QTBUG-34261 Change-Id: I5e5e80181024d57496907918d2a43d7c83841082 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Add a little more information about current dirsThiago Macieira2013-11-061-2/+5
| | | | | | Task-number: QTBUG-34300 Change-Id: Ib71d6ace77b525942ca40645299cdfd87b753d70 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Add missing \since 5.1 for QVector::takeFirst() and ::takeLast()Pekka Vuorela2013-11-051-0/+2
| | | | | Change-Id: Ic2d7e82187a17e21c2ed0e81318294730c3a0930 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QStandardPaths: add GenericConfigLocationDavid Faure2013-11-057-6/+20
| | | | | | | | | | | | | | | | This is what ConfigLocation was meant to be. A directory shared by all applications. Unfortunately when I wrote the fallback on Windows, I picked DataLocation (which is app-specific) instead of GenericDataLocation (which is shared between apps). This makes it impossible to have config files shared between apps, e.g. for libraries. It also makes ConfigLocation quite inconsistent (on Windows one cannot use it to load another app's config file, while it works everywhere else). All this is fixed by GenericConfigLocation, which is shared between apps. Change-Id: I23a755131061d4fea01e13dd1038fbd8ef333a5d Reviewed-by: Alex Richardson <arichardson.kde@googlemail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Declare Cocoa conversion funcs in objc-mode only.Morten Johan Sørvig2013-11-052-2/+10
| | | | | | | | | | | | | | | | | In practice, there are several ways to forward-declare objective-c classes. Qt uses "struct objc_object", other projects may use a plain "class". Mismatched forward declarations will lead to compile errors, and this is a form of header pollution. dd5e40d9 added a workaround where Q_FORWARD_DECLARE_OBJC_CLASS can be predefined in order to sync up the declarations. Make forward declaration clashes less likely by forward-declaring in objc-mode only. Change-Id: I9f7a399d64dc88bfe05d5385b3d46b5302112aef Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Remove Q_INIT_RESOURCE_EXTERNTor Arne Vestbø2013-11-051-3/+0
| | | | | | | | | | | It's not providing any convenience over using Q_INIT_RESOURCE, which does its own extern, were never documented, and was added back in 2010 without any commit message justifying its existence. Change-Id: I1ca9a042d3f4fca34007d28b140661c50064f11b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Clarify use of Q_INIT_RESOURCETor Arne Vestbø2013-11-053-10/+43
| | | | | | | | | | | | | | | | | | | The Q_INIT_RESOURCE macro is needed if a library itself uses resources, in which case the Q_INIT_RESOURCE can and should happen in the library (like we do for eg. widget styles), or if a library exposes resources that are supposed to be used by the library clients, in which case the macro needs to be put in the application code. The distinction between the two, and the fact that resources built as part of the main executable do not need the explicit initialization, were not all that clear. This was evident by the lack of Q_INIT_RESOURCE in our own Qt libraries, and the various Q_INIT_RESOURCE calls in our examples where they are not needed. Change-Id: I40258458e9fdf9ee5502c212971fb3d90b4fc388 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* BlackBerry: Prevent superfluous removal of socket notifiersBernd Weimer2013-11-051-12/+11
| | | | | | | | | | | | File descriptors have always been removed from bps before adding them, which lead to an annoying warning. "QEventDispatcherUNIX::registerSocketNotifier()" needs to be called after "ioEvents()" to prevent this. Task-number: QTBUG-34536 Change-Id: If074ff7a6638fe234abc100c81d094e182de7537 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Add qcollator_p.h to the list of headers.Thiago Macieira2013-11-051-0/+1
| | | | | Change-Id: I91963843e10fe0c33e5f13c06562dc5f9fdc2b6d Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Doc: Fix broken linksSze Howe Koh2013-11-0510-21/+17
| | | | | | | | Task-number: QTBUG-33360 Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Doc: Clean up threading examplesSze Howe Koh2013-11-052-124/+3
| | | | | | | | | | | | | | | | | | | | | | | | | - Example 3 (Clock) is a collection of anti-patterns. - It implements a slot in a QThread subclass and then forces the new thread to use Qt::DirectConnection to invoke the slot in the "wrong" thread. - It talks about getting away with non-thread-safe usage - It uses a thread as a timer and then admits that it's an over- complicated approach. - Example 4 (Permanent Thread) is over-complicated yet incomplete. A better one exists in the QThread class ref. - Example 1 (Thread Pool) is covered by the QThreadPool class ref. - Example 2 (QtConcurrent::run()) is covered in the "Threading and Concurrent Programming Examples" page and the "QtConcurrentRun" page. - The undocumented "Hello Thread" example is covered in the QThread class ref. - These examples cannot be accessed from Qt Creator's Examples tool. - These examples are neither widget-related nor tutorials, contrary to their source paths. Task-number: QTBUG-33360 Change-Id: Ic79cb764ee925ddbcbeafee8e1d01db7fe0f6cfe Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Silence compiler warningMarcel Krems2013-11-041-1/+1
| | | | | | | | | | warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] Change-Id: I15e283023918cd4ebc27e91812eadf95ba156d71 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* fix warnings about unused variables & parametersOswald Buddenhagen2013-11-041-1/+3
| | | | | Change-Id: Ia5816671267ea21dae0d90560b239c4498f9156c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* CMake: Add the qreal typedef type to the Qt5::Core target.Stephen Kelly2013-11-041-1/+2
| | | | | | | | | | This way, a Qt compiled with qreal=float and one linked with qreal=double can not be linked by a single downstream. That is diagnosed at cmake-time. Change-Id: I9183dbcfef181fadea5321d3154948e8258e4a2a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Ensure QLocale's shared C-locale QLocalePrivate is never deletedTor Arne Vestbø2013-11-041-3/+7
| | | | | | | | | | | | | | | | | Other static data such as QTextStream might be initialized before the static C-locale, in which case QLocale would adopt c_private and bump the ref-count to 2, only to see it reset back to 1 when the c_locale's static initialization happened. The result was that at application shutdown the ref-count would fall down to 0, and we tried deleting the static data. This issue was observed with clang in a debug build, where the c_private is initialized at runtime. Change-Id: If05221a5e87886e1805ad3c1b1520483f425c0fb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Better check for host builds for fails on QT_POINTER_SIZEAndreas Holzammer2013-11-041-1/+1
| | | | | | Change-Id: I9949565617cb62e34dd4db93acc4162b24c99ff9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* QBasicAtomicInt: fix wrong comment about non-atomic APIDavid Faure2013-11-021-3/+2
| | | | | | | | | | | | The public documentation for load() and store() says it's atomic, and it is: * using _q_value.store(newValue, std::memory_order_relaxed) in the C++11 implementation * using a simple assignment otherwise, which is atomic (and relaxed, no memory barriers) on all the existing C++ ABIs. Change-Id: I40faa47120163225bd11c3a32514ac97ef8bbbd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Avoid re-creating Random objects.Christian Strømme2013-11-011-14/+20
| | | | | | | | | We where re-creating a Java Random object each time the seed was set, this causes unnecessary overhead as the old objects becomes subject for garbage collection. Change-Id: I7aa48f5380f86d6c0d57eaeadc71b9b2b146034d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* make qreal double by default on all platformsLars Knoll2013-10-311-3/+0
| | | | | | | | | | | | | | On modern ARM CPUs there is no speed difference between float and double anymore, so let's rather use double for qreal to avoid rounding and precision issues. Like this we also get much better compatibility with our desktop OSes. This is not binary compatible on ARM, but the old behavior can be restored by passing -qreal float to configure. Change-Id: I2a4b61e19a3dfa6b0bd76734cecf2634c97207fc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Optimize refreshDateTime()John Layt2013-10-311-4/+1
| | | | | | | | | | A small optimization to the private refreshDateTime() function, improves standard performance tests by 0.3 msecs per iteration for affected functions, e.g. isValid() and offsetFromUtc() improve from 5.4 to 5.1. Change-Id: Ie67812649ef244388b484af35848b09d92dee38a Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Optimize date() and time() methodsJohn Layt2013-10-311-6/+8
| | | | | | | | | | | | | | | | | Optimize the performance of date() and time(), resulting in a one-third improvement, and subsequent improvements in all date/time based functions. Tested over 1000 iterations of the standard benchmarks, in msecs per iteration: Before After date()/time() 0.3 0.2 setDate()/setTime() 0.9 0.8 daysTo() 0.6 0.4 Note original performance before msecs storage was 0.06. Change-Id: Ie838e560ddf7129281531dc965af56ac19cce91d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* use private linkage where possibleOswald Buddenhagen2013-10-311-1/+1
| | | | | | Change-Id: Ie8eaa71bee87654c21218a23efd7e9d65b71f022 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't cache QCoreApplication::appName.Robin Burchell2013-10-312-10/+5
| | | | | | | | | | | This isn't a hot codepath, there is no gain to doing this. It introduces unnecessary bloat (see e.g. https://www.webkit.org/blog/2826/unusual-speed-boost-size-matters/) and complicates boosting Qt application startup in cases where argv[0] is overwritten. Change-Id: I55b2b98b0de6b06fe7a049de262f3e19936b73db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Include unistd.h in the unix implementation source of QLockFileLaszlo Papp2013-10-311-0/+1
| | | | | | | | | | This is necessary to avoid hidden dependencies for int gethostname(char *name, size_t namelen); This was revelead while backporting the class to Qt 4 for QtSerialPort. Change-Id: I1c477d295eeae90b3136fc6aae5d45982d5b1d73 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* iOS: Add standard paths implementation for iOSIan Dean2013-10-302-0/+137
| | | | | | | | | | | A standard paths implementation for iOS. The APIs used on iOS require that the source file be "Objective-C++" (with a .MM extension), as there are no APIs available in C++ for this. The implementation complies with the latest documentation on standard paths. Change-Id: I349d3c5d4ddb6fb1297a45dc9ae26b56ac528abb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Android: Fix problem with leaking local refs.Christian Strømme2013-10-303-8/+27
| | | | | | | | | In some cases we where not releasing the local references and since we no longer disconnect from the VM on each call, the number of local refs. would accumulating until it hit the hard-limit of 512. Change-Id: I6826620e4cb61a37af26d276667489e876080076 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Use Q_UNLIKELY in qCDebug, qCTraceKai Koehne2013-10-301-2/+2
| | | | | | | | By default debug, trace is disabled, so this can be marked as unlikely. Change-Id: I221a688c953c1ff1fdfda65d2d99457785d3ff47 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix miscellaneous typosSze Howe Koh2013-10-304-6/+6
| | | | | | Change-Id: Iaf0dd8974c3ad78beffa995c596a76fb3e4cceab Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Issue correct warnings with QObject::startTimer()Sze Howe Koh2013-10-301-2/+2
| | | | | | | These are not specific to QTimer Change-Id: Idcffab51a3277413889a727afa1cf7ce15171ec9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* remove qt_windows.h include from qwineventnotifier.hJoerg Bornemann2013-10-291-1/+1
| | | | | | | | | | | We must not include qt_windows.h in public headers, otherwise we're cluttering the environment with a colorful bouquet of Windows API preprocessor macros and typedefs. Task-number: QTBUG-34058 Change-Id: I415717ea2a47f39e7f4b7ce1c1df9d49afc99278 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make the localHostName() copy function return QByteArrayThiago Macieira2013-10-291-8/+8
| | | | | | | | | | This avoids one extra memory allocation when creating the lock file. The number of memory allocations when checking the file are still the same. Change-Id: I16a2fdb7a5458bdc66f8ad1c602582b5698a5b5c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* generate qfeatures.h at build timeOswald Buddenhagen2013-10-293-688/+2
| | | | | | | | | much more elegant than the checked in file. and less chance to get it wrong, as people often enough do. Change-Id: I975a62dfd83ce4f15947ce54f3c40931b1badae0 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* give XMLSTREAM a NameOswald Buddenhagen2013-10-291-1/+1
| | | | | | Change-Id: I4759d8d64f90db580cd15cad6edeed77411c0c33 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix "markup"Oswald Buddenhagen2013-10-291-20/+12
| | | | | | Change-Id: I447175adf1c00e4e20b36747ee035e30a74a50f8 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* purge references to non-featuresOswald Buddenhagen2013-10-293-43/+0
| | | | | | | | | | | | due to modularization, svg and activeqt do not belong here any more. note that concurrent and dbus are staying for the time being, because being part of qtbase and configure lacking support to switch them off, this is the only way to disable the modules. Change-Id: Idbc0d2f7db23f7e797fc301ab1136f69f9049b27 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* purge vestiges of dead QT_NO_* definesOswald Buddenhagen2013-10-296-308/+1
| | | | | | Change-Id: I6be54e8ce4c2522b3907a645506b695fab3aebd9 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>