summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix deadlock in QPropertyAnimationOlivier Goffart2012-03-071-0/+1
| | | | | | | | | | Commit 1e6514a714c1f55b9cb57d2b8b65bc2305c2e2c6 changed the mutex from recursive to non-recursive, which could introduce dead lock if the animation starts other animation (This is the case in QMainWindow layouts) Change-Id: I1b149b78a802748eb24b5700fffeca0b8555f005 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add nicer error message in qMetaTypeId function.Jędrzej Nowacki2012-03-071-0/+1
| | | | | | | | | | The function can be used only with a registered type and it would fail to compile for other types. By adding the static assert we can print an almost user friendly compilation error message. Change-Id: I59ab148cabf32afe0baef186b82cb03303b57780 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QRegularExpression: fix optimizePattern, document the issueGiuseppe D'Angelo2012-03-071-7/+24
| | | | | | | | | | | | | | The studyData pointer is atomically set by the pointer assignment, but another processor running a different thread might see the new studyData value but not the memory it points to. Therefore, the current studyData is returned from optimizePattern and used by that thread. Docs were added to optimizePattern to explain what's going on. Change-Id: I4502c336077bb98a1751011aa93ffd4f585ed101 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRegularExpression: fix documentation due to qdoc changesGiuseppe D'Angelo2012-03-071-16/+16
| | | | | | | Removes the usage of various qdoc macros which are now deprecated. Change-Id: I74fa70f8d2a2a1bff57cdb2bcc14a31a7198dea0 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fixed warnings from arm builds with -WundefRohan McGovern2012-03-071-3/+3
| | | | | | | | | Do not use the value of a macro before verifying that the macro is defined. Change-Id: I36bebe37da5f4e5e7af1e423b7f2b18091e35707 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix parsing of unicode escape sequencesLars Knoll2012-03-071-2/+2
| | | | | Change-Id: I63a7cd3a571fb47c97157bcb2ca29c4239c600ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed warning from gcc with -Wundef for some values of WCHAR_MAXRohan McGovern2012-03-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | Certain versions of system headers will declare WCHAR_MAX like: #define __WCHAR_MAX ( (wchar_t) - 1 ) #define WCHAR_MAX __WCHAR_MAX In particular on ARM (see e.g. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598937 ) In this case, defined(WCHAR_MAX) is true, but attempting to use the value of WCHAR_MAX in a preprocessor expression will not give the desired results - "wchar_t" is unknown to the preprocessor, so WCHAR_MAX silently (without -Wundef) evaluates to ( (0) - 1 ) == -1. A simple workaround is to avoid looking at WCHAR_MAX when the superior __SIZEOF_WCHAR_T__ is defined. Change-Id: I439b166cffb93416737ee19025fb6e8d51c27876 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Support legacy QDataStream serialization of QDate.Aaron McCarthy2012-03-071-4/+14
| | | | | | | | | | | Commit 8327fa7c11f6c84ccc66be4365ee282a76288788 changed the type of the Julian day member of QDate from quint32 to qint64. This changed the QDataStream format. Keep the old behavior, with the limited date range, if the stream version is less than Qt_5_0. Change-Id: I800448979a1891581069f39de7f9ab9c634e4f0e Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use #define before including SHA-2 3rdparty codeBradley T. Hughes2012-03-071-17/+15
| | | | | | | | Using typedef causes errors due to re-definition, so #define the types needed by the SHA-2 code to the q[u]int* equivalents instead. Change-Id: I6fc29788dd05aeee28723820f511527d482d31f2 Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
* QRegularExpression: const correctness fixesGiuseppe D'Angelo2012-03-061-9/+9
| | | | | | | Adding some const qualifiers to members which are never written. Change-Id: Ibb8953764c7b7790a419a5d48f2956751d5fc1f9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRegularExpression: add captureCount()Giuseppe D'Angelo2012-03-062-0/+15
| | | | | | | | QRegularExpression::captureCount() returns the number of capturing groups inside the regular expression pattern. Change-Id: Ib90ce67c67d06ab2966f0c98bd91da21defc156d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRegularExpression: do not use JIT in debug buildsGiuseppe D'Angelo2012-03-061-1/+41
| | | | | | | | | | | | | PCRE's JIT uses self-modifying code extensively, requiring full SMC checks enabled by tools like valgrind, which slow down the execution considerably; not enabling SMC checks lead to crashes. Therefore, JIT is now disabled by default in debug builds of Qt. Its usage (both in debug and release builds) can be controlled by setting the QT_ENABLE_REGEXP_JIT environment variable. Change-Id: Ib38952400e4219582942ce65ab9edcd89c432f3e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QRegularExpression: improve operator==, add dedicated autotestGiuseppe D'Angelo2012-03-061-1/+2
| | | | | | | | Trivial change: compare dpointers first, then the data. Added test function for operator==. Change-Id: I33ac64a59db4ccad56c30be17622187e42415f38 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QRegularExpression: QDebug support for pattern optionsGiuseppe D'Angelo2012-03-062-0/+38
| | | | | | | | | Added the proper QDebug operator to debug the QRegularExpression::PatternOptions flags. Change-Id: Icd00e93a0c6cc4345db528d494fc176624f7b7a2 Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QRegularExpression: add QRegularExpression* set of classesGiuseppe D'Angelo2012-03-063-0/+2275
| | | | | | | | | | | Added QRegularExpression, QRegularExpressionMatch and QRegularExpressionMatchIterator as PCRE-enabled, regexp classes. Documentation is included, as well as a first round of autotests. Task-number: QTBUG-23489 Change-Id: Id47031b80602c913ccd2fd740070e3024ea06abc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* fix relative default examples pathOswald Buddenhagen2012-03-061-1/+1
| | | | | | | | copy&pasto ... Change-Id: I73ab90f31f2a2250abe1ec9aeea975122ff319cb Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QProcess/Win: pointless Sleep call removedJoerg Bornemann2012-03-061-2/+0
| | | | | | Change-Id: I634c62d3a0f96bc074e815dfd4106b6187f4ba85 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Don't use QMutexPool in QEventDispatcherOlivier Goffart2012-03-061-3/+2
| | | | | | | Use a QBasicMutex, there is no extra cost of having a mutex for this. Change-Id: Ib5b01338649002c0c21f018b2c931a8cc68027f6 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Don't use QMutexPool from the animation frameworkOlivier Goffart2012-03-062-14/+13
| | | | | | | Use a plain QBasicMutex instead Change-Id: I1abd35b4fe4e9f0401e73c7c3f503b00bba2baa9 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Cleanup QThread::initialize and QThread::cleanupOlivier Goffart2012-03-065-41/+0
| | | | | | | | | | | The qt_global_mutexpool was private API deprecated long time ago. And there is no reason to call qt_create_tls because it is called in QThreadData::current that is called from the QObject constructor, even before QCoreApplication::init can be called. Change-Id: Idf3576d8591377811b727b12edc43dc898570ba4 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Make cache of opentype tables in Harfbuzz face lazyEskil Abrahamsen Blomfeldt2012-03-062-1/+7
| | | | | | | | | | | | | | | | | | | | The mechanism in fontconfig which determines if a certain character is available (FcCharSetHasChar()) may give false positives, in which case we would load and unload those fonts per every char for which FC gave us a false positive. This was a major performance regression. Specifically the false positives happened when looking at e.g. italic variants of certain multilingual fonts, since we only check the charset of the font family as a whole and not of the specific variant, which may only support a subset of the chars. To optimize this, we remove the deletion of the font engines after loading them, but also wait with loading the opentype tables until they are actually needed. This means that for the false positives, we will load the font, but the cached data for each unused font will be much smaller. Change-Id: Idfc794401a2080da5946bf65204eb947aeb635ed Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Improve safeness of QMetaType::registerType.Jędrzej Nowacki2012-03-061-2/+5
| | | | | | | | | | | | | | | This internal function is abused by some modules to create dynamic types in metatype system. In Qt5 more non-optional arguments were added to the function and to keep temporary source compatibility an overload was created. QMetaType code assumes that every known type has properly defined basic operations like creation and destruction. Setting a helper function pointer to null value is asking for a crash, because the code doesn't check for that value, the null pointer may be called. Change-Id: I5ca7454a70c308e01de26fab23481b3c94c22371 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* QMimeDatabase: Fix crash on empty filenameDavid Faure2012-03-061-0/+2
| | | | | | | | | This is due to the search in the suffix tree starting at position fileName.length() - 1. Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1 Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru> Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
* Remove codecForTr().Robin Burchell2012-03-067-66/+11
| | | | | | | | | | Similarly to change id I2f429fa7ef93bd75bb93a7f64c56db15b7283388, the capability to arbitrarily alter the encoding of literals is very destructive, especially in a world with libraries and plugins. Change-Id: If0d4cd8dcf89792e39c1984cbde6b036cebfc02f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Support new-style plugins without a "Keys" json propertyAlex Wilson2012-03-061-1/+12
| | | | | | | | | As per discussion with Lars, intent here was to allow plugins without a "Keys" property to still function correctly, but this particular if statement was blocking any such plugins from being detected. Change-Id: Icb343ca8bd95a508d62565cd816fe2a57a4f82bd Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Mark QMetaType constructor as explicit.Jędrzej Nowacki2012-03-061-1/+1
| | | | | | | | Implicit conversion from an int would look strange in this case. Change-Id: I2222a045c293595d7b83a2fb75ca646f5cf79bca Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove unused QThreadPoolPrivate::startFrontRunnable().Robin Burchell2012-03-062-26/+0
| | | | | Change-Id: Ie079aea3412a53cf9dccaa770fa64ff5b6b7b3b1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove AccessibilityPrepare event.Frederik Gladhorn2012-03-051-1/+0
| | | | | | | | | | | | | This event was completely unused. In addition it leads to crashes on linux when sending the Destroy accessibility update. The Destroy event on linux would still query an accessible interface. That in turn would trigger the event to be sent. Change-Id: I8915527de067b8b70ba41b1361e3ef5d12866d7d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Enable name of threads in release mode.Leonard Lee2012-03-051-1/+1
| | | | | | | | | | | Naming threads is very useful for release builds. Enabling only on Linux/Mac for now. The Windows port is using debugger specific API for setting thread names, so it has to remain debug mode only. Change-Id: I179521f65f215ff038e8230f958f6aa728ea4cbe Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-0436-248/+254
|\ | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| * Automatic metatype registration of two-template-argument types.Stephen Kelly2012-03-021-0/+22
| | | | | | | | | | | | | | | | | | | | | | This commit is complimentary to the commit which introduced a similar partial specialization for single template argument types: 6b4f8a68c8da1af7c5be7dc6075b688c9d6ca55f If T and U are available as metatypes, then QHash<T, U> is too. Change-Id: I09097b954666418b424c8c23577032beb814343a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * revamp -sysroot and -hostprefix handlingOswald Buddenhagen2012-03-012-4/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of being a variable added to the makespec (via qconfig.pri), QT_SYSROOT is now a property. the QT_INSTALL_... properties are now automatically prefixed with the sysroot; the raw values are available as QT_RAW_INSTALL_... - this is expected to cause the least migration effort for existing projects. -hostprefix and the new -hostbindir & -hostdatadir now feed the new QT_HOST_... properties. adapted the qmake feature files and the qtbase build system accordingly. Change-Id: Iaa9b65bc10d9fe9c4988d620c70a8ce72177f8d4 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
| * exclude some code from the qmake buildOswald Buddenhagen2012-03-011-0/+4
| | | | | | | | | | | | Change-Id: Ic989a2cc5106496a2c5f13c863a0a87d5cd2d963 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
| * dispose of BOOTSTRAPPING defineOswald Buddenhagen2012-03-011-8/+4
| | | | | | | | | | | | | | | | this is used only in qmake, not in other bootstrapped tools Change-Id: Ie2841e69dbd82c86d2297ddf51443ee75760766c Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
| * QtGlobal: remove qIsDetached()Marc Mutz2012-03-011-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's not a single in-tree user of this function, and the concept is a broken one in MT programs: By the time qIsDetached() returns, the result can already be different due to another thread taking a copy, or a copy in another thread being destroyed (note that this doesn't require mutex use by the user, since we promise (implicitly, if not explicitly) that you can copy from const objects without holding a lock). QTBUG-10813 talks about a use in QCache::trim(), but 677cf76340f88e0fe51c1f75aa512b6d835414ca removed it, so there's no reason to keep it anymore. Change-Id: I20380c12bdf00ac764b89d84392f0f34727b1971 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * QPair: specialise QTypeInfo based on the typeinfos of its argumentsMarc Mutz2012-03-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Specialise QTypeInfo<QPair<T1,T2>> based on the properties of T1 and T2: - If either T1 or T2 is Q_COMPLEX_TYPE, so is QPair<T1,T2>. - Otherwise, if either T1 or T2 is Q_MOVABLE_TYPE, so is QPair<T1,T2>. - Otherwise, QPair<T1,T2> is Q_PRIMITIVE_TYPE. Change-Id: I8aecbd37e3b7924f77f38967498deabf1a19ca24 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| * QEvent (and subclasses): make ctors explicitMarc Mutz2012-03-012-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Do this regardless of whether the event subclass is public API or only used in examples. Examples are examples, used by others as templates or even copied verbatim, so they should also follow sound engineering rules. Anyway, there's only one in examples/... Change-Id: I586ff16407a956c9e89288fdd4377eed73f45c0f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
| * QFlags: mark as Q_PRIMITIVE_TYPEMarc Mutz2012-02-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I originally tried to put Q_DECLARE_TYPEINFOs into Q_DECLARE_OPERATORS_FOR_FLAGS, to declare not only the flags type, but also the underlying enum as primitive, but too many users (arguably correctly) used Q_DECLARE_OPERATORS_FOR_FLAGS at (non-global) namespace scope where QTypeInfo would have been specialised in the wrong namespace. So specialise QTypeInfo for QFlags<T> only. Change-Id: I4af6e29aefbd9460a3d2bc6405f03cdf6b1096bc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Make loadAcquire const.Stephen Kelly2012-02-294-8/+8
| | | | | | | | | | Change-Id: Iad2d60d1abe363a3b85eaf152861d0979a997d81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QCryptographicHash: make constructor explicitMarc Mutz2012-02-291-1/+1
| | | | | | | | | | | | | | | | | | The copy constructor of QCH is disabled, so there's no point in providing an implicit conversion from the Algorithm enum anyway, so make the ctor explicit. Change-Id: I4ea74ffb0963b4f49415da17778c3e6050454a6b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * make qlibraryinfo table-drivenOswald Buddenhagen2012-02-292-94/+34
| | | | | | | | | | | | | | | | | | | | | | | | switch blocks are noisy. this is nicer. reshuffled the LibraryLocation enum to make table lookups possible and future-safe. using pointer-free tables to avoid adding data relocations. Change-Id: I70ec2c2142ce02a15e67284e4b285d754d930da3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * remove pointless ifdefsOswald Buddenhagen2012-02-291-23/+1
| | | | | | | | | | | | | | | | configure always defines all of these constants. the exception is SettingsPath which is unix-only, so make the #ifdef explicit about that. Change-Id: I339d2d7cb9d188a8e74d79310c3a80b5d4dbb806 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Allow QChar::SpecialCharacter with QStringBuilder.Stephen Kelly2012-02-291-0/+10
| | | | | | | | | | Change-Id: I3c91fd516bb13e5534aa6f26ee9df745c990dfb5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Make qobject_p.h not need qvariant.h.Stephen Kelly2012-02-294-10/+13
| | | | | | | | | | | | | | | | | | | | Move definition of ExtraData to the implementation file. As a side effect, we need to include qhash.h in some other places. Change-Id: I8bb4ec0940ae51c7d6961c9a51adb80fd444e1e3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Make qlocale.h not depend on qvariant.h.Stephen Kelly2012-02-296-2/+5
| | | | | | | | | | | | | | As a consequence, we have to add more explicit includes. Change-Id: Ib3137031f0554b846c7bbd08f1f7df10dfeb8e61 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * QScopedValueRollback: make constructor explicitMarc Mutz2012-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm not even sure whether you could implicitly convert a T& into a QScopedValueRollback<T>, seeing as the constructor takes a non-const reference, but it looks wrong without explicit and QObject o = new QObject(parent); also won't compile even with implicit QObject(QObject*) under a conformant compiler because of the disabled copy constructor, and we still make QObject(QObject*) explicit, so add it here, too. Change-Id: I722a6e8431644e450fe2b401ccfb707a8e982380 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
| * Remove include for no-longer-supported compiler.Stephen Kelly2012-02-291-6/+0
| | | | | | | | | | Change-Id: I162da3e373a0191f69e50e110114ef78c2d5fc66 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Merge master -> api_changesRohan McGovern2012-02-2947-690/+462
| |\ | | | | | | | | | | | | | | | Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac. Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
| * | Remove Q_DECLARATIVE_EXPORT and Q_QTQUICK1_EXPORTMatthew Vogt2012-02-271-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Theses definitions are no longer required in qtbase. Task-number: QTBUG-23737 Change-Id: Ib11e5840086b44120adabe83a1b068c991920f2f Reviewed-by: Martin Jones <martin.jones@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Move the QString comparison operator as non member functionOlivier Goffart2012-02-272-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The operator== and similar should not be member of the class. This ensure a symertry. Indeed, consider this code string == string1 + string2; string1 + string2 == string; The first line compile fine even if QStringBuilder is used, because QStringBuilder will be converted to QString implicitly. But the second line do not compile if the operator== is a member of QString, because the implicit conversion rules do not apply. For this reason, the symetric operators should not be declared as member. Change-Id: I3f7c11fab45a9133f7a424bdfcb894f97da9282b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>