summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Move QScopedLoopLevelCounter to qthread_p.hBradley T. Hughes2011-11-242-10/+12
| | | | | | | | | | ... and use it in QCoreApplication::notifyInterna() instead of "reinventing" the wheel there. The constructor and destructor for QScopedLoopLevelCounter are inline, so the class does not need to be exported. Change-Id: I7af5a4ef0987f277bcc50c1057f3c74152f3d79d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix QT_DEPRECATED_SINCE on windows.Olivier Goffart2011-11-231-2/+7
| | | | | | | | Apparently, MSVC preprocessor do not understand correctly the defined() in that macro (used in another #if) Change-Id: I9bd102eb4e0cbaa65bea48db786a45d861491ad7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Added build system support for installing tests.Rohan McGovern2011-11-232-1/+12
| | | | | | | | | | | | | Tests will install under $$[QT_INSTALL_TESTS]. TESTDATA may be used to install additional testdata required by the test. The default install rule may be disabled by CONFIG+=no_testcase_installs. Change-Id: I204de60c8e844775906ffd016ca50bffbb414142 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Code cleanup in QVariant and QMetaType.Jędrzej Nowacki2011-11-222-31/+69
| | | | | | | | | QMetaTypeGuiHelper was generalized and renamed to QMetaTypeInterface. From now all types will have common interface which can be used for basic operations. Change-Id: I50d67f4a8081fa0f75c9d530a8211593ec37bc55 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add spaces for string concatenation to work around C++11 source incompatibility.hjk2011-11-211-1/+1
| | | | | | Change-Id: I6acb7dca20d3bfcb24ea798c7ecd1a12464af5a6 Reviewed-by: QTBUG-22847 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add a roles argument to the dataChanged signal.Stephen Kelly2011-11-212-2/+7
| | | | | | | | | This allows more granular reporting of what has changed. This change is binary incompatible and source compatible. Change-Id: I7c5beaee651a24780cc94e41383f7a80210bc603 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add Q_ENUMS and Q_FLAGS to enumeration InputMethodQuery and flag ↵Joona Petrell2011-11-211-2/+3
| | | | | | | | InputMethodQueries Change-Id: If6f535a28af06e7e1790d8876f99dcb9ab8a3b41 Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Give better error message when using unsupported lookbehinds in QRegExpKjell Rune Skaaraas2011-11-181-0/+4
| | | | | | | Merge-request: 1456 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit e0383c9b8bd6f4e3d445d69690f84209cad42bb5) Change-Id: Ie0383c9b8bd6f4e3d445d69690f84209cad42bb5
* Fix QFile::copy() returning false but error() being NoErrorxiechyong2011-11-181-1/+4
| | | | | | | | | | | Calling close() after setError() will unset the error. Task-number: QTBUG-11982 Merge-request: 2712 Reviewed-by: ossi (cherry picked from commit 16f67b49ae5232d4d0fb19e0333f5e2ef2a65449) Change-Id: I16f67b49ae5232d4d0fb19e0333f5e2ef2a65449 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Build fix for WINCE to qfilesystemengine_win.cppjaanttil2011-11-181-1/+0
| | | | | | | Merge-request: 2662 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit f4f1b712e1389987e045bb8f6ba654ea9e11d24e) Change-Id: If4f1b712e1389987e045bb8f6ba654ea9e11d24e
* adding a getter cubicBezierSpline() to QEasingCurveThomas Hartmann2011-11-182-0/+13
| | | | | Change-Id: Ida722f013613d8633867a902660da30d28aeb918 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Windows: Adapt mkspec for MinGW / gcc 4.6.Friedemann Kleint2011-11-181-0/+7
| | | | | | | | | | | gcc 4.6 becomes the minimum required version in Qt 5. See also d4150975af620e2889cc58bd476bac6b4d101db3 in Qt 4.8. Change-Id: If66ce0be755263c20b0a4371523c6590592d962d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Document new input method hints introduced in Qt 5Joona Petrell2011-11-181-0/+6
| | | | | | Change-Id: Ic6aa77b410ed8189c2b100ca527a7019cdaf3b8b Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Resolve a number of compilation issues with INTEGRITYRolland Dudemaine2011-11-182-1/+7
| | | | | | | | | | | | | | First, #ifdef'ed out getpwuid_r() and getpwgid_r() usage since users/groups support is not in in single-process Posix mode. Also, correct a typo and add missing files to io.pri. Update documentation to disable libtiff which won't compile until ibtiff itself is updated, and add back -no-exceptions in the sample command line. And add a line to compile host tools. Add a dummy QT_OPEN_LARGEFILE definition in qplatformdefs.h since there is code that requires it. Move definition of getGlyph() after the definition of qHash(GlyphAndSubPixelPosition). Merge-request: 2686 Reviewed-by: ossi (cherry picked from commit 8fe04a14b1f3688c9ce0933ebec0c28616595d93) Change-Id: I8fe04a14b1f3688c9ce0933ebec0c28616595d93 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* fix doc typoOswald Buddenhagen2011-11-181-1/+1
| | | | | | | (cherry picked from commit 9c86b3b0028d79cbca129afafa33d72d624d65c3) Change-Id: I9c86b3b0028d79cbca129afafa33d72d624d65c3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* qtbase: Warnings fixes.Friedemann Kleint2011-11-181-1/+1
| | | | | Change-Id: Ie97e36bc168b3de3cae2d0eb615e777884529a06 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix tst_Moc::oldStyleCastsOlivier Goffart2011-11-171-2/+2
| | | | | | | | | This tests that the moc generated file produces no warnings with very pedentic compilation flags. In that case, there was a warning because of the use of the C casts Change-Id: Ie79c6d053ff35c55276a07212c5d60f759f693ee Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Reimplement some QMetaType methods.Jędrzej Nowacki2011-11-171-369/+205
| | | | | | | | | Methods of QMetaType; sizeOf, construct and destruct were reimplement using QMetaTypeSwitcher. The change should have impact only on maintenance (by removing 3 type switches). Change-Id: Iac3eb52de75d46f12ac32f229a26aec5b5bc7af2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Reimplement QMetaType::typeName.Jędrzej Nowacki2011-11-171-97/+35
| | | | | | | | | New implementation is slightly faster (~30%) and it is not dependent on order of definitions in QMetType::Type. Which means that we do not have to maintain a separate type list. Change-Id: I0ceb8c919c08afaa55146fbc3f021b78ffc2c063 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix Qt namespace compilation.Toby Tomkins2011-11-161-0/+4
| | | | | Change-Id: I259b5fde8e4d75d28def8650c4c9208accdf0bbe Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Hide QVariant helper classes in a namespace.Jędrzej Nowacki2011-11-151-0/+2
| | | | | | | | | Moving these classes to an unnamed namespace reduced chances of a name conflict and size of executable. GCC 4.6 in release mode produces a 5kB smaller binary. Change-Id: Ie1819a88180f9db1cd32cc59ea6fe268ecbd5813 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Allow to create a custom event dispatcher for specific QThreads.Sven Anderson2011-11-158-29/+82
| | | | | | | | | | | | | | QAbstractEventDispatcher() does no longer install itself into the current thread. Instead the new methods QThread::setEventDispatcher() and QCoreApplication::setEventDispatcher() allow to install a custom event dispatcher into any QThread as long as there is no default event dispatcher created yet. That is, before the thread has been started with QThread::start() or, in case of the main thread, before QCoreApplication has been instantiated. Change-Id: I7367e13d8d8aebed5a5651260bb69b8818eb1b90 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Integrate testcocoon support into Qt build system.Rohan McGovern2011-11-151-0/+58
| | | | | | | | | | | | To instrument a Qt application or library with the TestCocoon coverage tool, do `CONFIG+=testcocoon' in the application .pro file. To instrument Qt itself with testcocoon, use the `-testcocoon' configure option. Change-Id: Ie77109a078d11ea51f7a073621e0df9c752c44ae Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Support 31 mouse buttons (with platform plugins xcb and xlib).Rick Stockton2011-11-141-1/+30
| | | | | | | | | | | | | This commit includes changes for mouse button support within the XCB and XLIB platform plugins. Support in other platform plugins will be added in the future. The namespace update is prerequisite to compile the the Plugins, and the update in qguiapplication.cpp is required for the enhancements to actually work. Task-number: QTBUG-22642 Change-Id: Ie18fca3b9c86d0b6abbf2103a4f8582e6ce83e7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* moc: support mapping pointers to member functions to indexesOlivier Goffart2011-11-141-1/+2
| | | | | | | | | | | | | This change adds QMetaObject::IndexOfMethod as a parameter to the qt_static_metacall function. It lets the moc generated code return the index of a signal or slot given its pointer to member function This is required to support the new connection syntax Change-Id: I39198c6699b5aa3599d3d282f7ac79b1e3684d33 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use deprecated functions on Mac OS XBradley T. Hughes2011-11-142-7/+7
| | | | | | | | | | | | | | | | io/qfilesystemwatcher_fsevents.cpp:346:15: warning: 'stat64' is deprecated [-Wdeprecated-declarations] if (::stat64(it->absolutePath, &newInfo) == 0) { ^ According to 'man 2 stat' on Mac OS X, the stat64() function is deprecated in 10.6 and above. Instead, we are supposed to define the _DARWIN_USE_64_BIT_INODE which enables the 64-bit ino_t member in the stat struct and uses function symbol suffixes to call the correct version of stat with 64-bit inode support. Change-Id: I697374186c7f4d69df783f06962ca5644222194d Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add a -force-asserts option to configureHarald Fernengel2011-11-111-3/+3
| | | | | | | | | | | We have the following scenario: Either you build a release package without asserts, or a debug package with asserts. However, in embedded development, we need asserts also in release packages. This flag allows you to build a release package, but Q_ASSERTs still fire. Change-Id: Icd1dd4dd63c3cafecf515b40741263d902ad42d1 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Prefer organizationDomain or CFBundleIdentifier for settings fileChris Meyer2011-11-111-0/+44
| | | | | | | | | | | | | Watch for attempts to write to "Trolltech" preferences and use QCoreApplication::organizationDomain() instead. If that doesn't exist, then fall back to CFBundleIdentifier if possible. If that doesn't exist, then follow the old code path and use the hardcoded string. This change eliminates extra files being created which helps Mac app store acceptance. Change-Id: I1ba3984b46cf3888f371d87f6ad8ea6c2f26d2ec Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* avoid type aliasingThomas Hartmann2011-11-111-9/+30
| | | | | | | | | | | | | | | | | For -O2 gcc activates -fstrict-aliasing. As a result the compiler is allowed to assume that pt[1]=px[1]/3+B1 does not affect t. Therefore the result of _fast_cbrt() was always 0. Using a union for casting avoids this issue. For more details see: http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-aliasing Also the updated code respect endianness. Change-Id: Id4bed16efac52e494e7357dc2f23f94e8c525df1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Removed include to qdatastream.h from qmetatype.hOlivier Goffart2011-11-101-4/+2
| | | | | | | | | | | | | | | Added forward reference to QDataStream instead In the new connection syntax, I want to include qmetatype.h from qobject.h, in order to handle metatype for queued connection. So qdatastream cannot be included here (as it inherit qobject) else it would lead to circular inclusion. QDataStream is only used in templated code that is dependent on the template parametter so it is fine to have it forward declared. Change-Id: I08ea479f481262a80451a277ee29533c42cb9f89 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix Q_STATIC_ASSERT on MacJoão Abecasis2011-11-101-1/+1
| | | | | | | | | | | gcc 4.2.1 complains about the use of C++-style cast in the macro. error: template argument 1 is invalid . Changing the bool-cast to a C-style cast makes the test compile. Change-Id: Ie9082a3adbfd53147bfd0bfe36dd9e7328e01ee8 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Updated Qt::InputMethodQuery documentationPekka Vuorela2011-11-101-7/+22
| | | | | Change-Id: Ibd27231366e4af2780bfe2f8f735da74dc04a1cf Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add isDebugBuild() query function to QLibraryInfoaavit2011-11-102-16/+21
| | | | | | | | Also cleaned up the doc, removing references to the buildkey() function that has been removed. Change-Id: I2cb403f93d93c0b2f71c8502818d669f7bfbfbec Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Correctly normalize timevals before calling select()Bradley T. Hughes2011-11-092-9/+5
| | | | | | | | | | | | | | | | When normalizing timevals, we need to bound the tv_usec member to 0-999999 inclusive, otherwise select() may return EINVAL. When rounding timevals to the nearest millisecond in the UNIX event dispatcher, pass the timeval through normalizeTimeval() when returning. As discovered on Mac OS X with tst_QFutureWatcher, starting a 10 second timer would end up calling select() with timeval = { 9l, 1000000 }, resulting in numerous "select: Invalid argument" warnings being printed to the console. Change-Id: Ic539e935bf847e0d4c22a73ad203e3a7a81d0690 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QVariant: Fix MSVC compiler warning about unused variable null.Friedemann Kleint2011-11-091-2/+1
| | | | | | | | | Use static method isnull(). Introduced by ca26fefc0624264262a2abe630568271cefa2753. Change-Id: I752f8d8a5ec473dcc5f50fbda47d061b8d3a7e13 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* [optimization] QVariants comparisonJędrzej Nowacki2011-11-091-2/+2
| | | | | | | | | | | QMetaType::isRegistered and QMetaType::typeName are quite expensive. To compare two custom objects we need to have their type name (for dereferenced comparison). If the name exist we know for sure that the type is registered and we do not have to call QMetaType::isRegistered anymore. Change-Id: Iba631e012504c8633868a902880fa30d38afb917 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add QPolygonF to metatype system.Jędrzej Nowacki2011-11-093-2/+8
| | | | | | | | That was strange that QPolygon was know to QMetaType class but QPolygonF not. Change-Id: I67bb99644b8b1d0fe1aec730619d8048cb78219b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make usage of internal QVariant space.Jędrzej Nowacki2011-11-093-413/+345
| | | | | | | | | | | | | | | | | | | | | | Each QVariant instance has internal storage which may be used for well-know basic types. This patch changes the behavior by delegating type dependent operation to QMetaType class which knows more types than QVariant itself. The patch significantly reduce amount of code in QVariant implementation. There are few side effects of this patch: - better performance: * for Core types when using Gui (QGuiVariant is able to construct Core types) * for small custom types (QVariant::Private::Data is used for all types that has size small enough) - comparing two QVariants can give different result for small custom types (binary comparison instead of pointer comparison) Change-Id: Ic17fa500d6a882110bfba896fd456c8e6c7a63a9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Implement QMetaTypeSwitcher.Jędrzej Nowacki2011-11-092-1/+103
| | | | | | | | | | | | | | | | | | | Currently one of the most common coding pattern, when working with QMetaType types, is to switch over all types ids to convert a given type id to a real c++ type. The pattern is not perfect, because of: - code duplication - to convert type id to a real type a user has to write own switch case - maintenance - adding new type to QMetaType::Types doesn't propagate to other parts of code. Proposed type switcher can solve the issue by switching type id and delegating found c++ type. The class is created for internal use only and was created to simplify common problems in QtDeclarative, QtScript and QVariant. Change-Id: I0567ef908024b3b05ee18126f98a73a74748fbd2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add QTypeModuleInfo template classJędrzej Nowacki2011-11-092-1/+118
| | | | | | | | | | | From time to time it is necessary to know from which module a type comes from. This information couldn't be part of QTypeInfo as id doesn't work for forward declared types. QTypeModuleInfo should stay for Qt internal usage only. Change-Id: Ia53747c88293fc0cdaffef919b94c653412779d3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Refactor QMetaType types.Jędrzej Nowacki2011-11-093-163/+155
| | | | | | | | | | | | | | | | QMetaType::Type enum is the main source of type ids. Currently there are many tasks that can be replaced by a smart macro that can iterate over all types. The patch introduces series of FOR_EACH_ macros that may be used for code generation. As the first step the macro was used for Q_DECLARE_BUILTIN_METATYPE to make sure that no type was forgotten. Second step was to use created macros in autotest to improve tests coverage. Change-Id: I34e9ad7bacf02b44b028bc1aad20b1241aacebd3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QGlobal: Define a default message handlerAurindam Jana2011-11-081-16/+26
| | | | | | | | | | | | | Currently, qInstallMsgHandler() does not return the handle to the default message handler. This patch defines a default message handler. This is returned by qInstallMsgHandler() when called for the first time. A call to qInstallMsgHandler(0) will restore the default message handler as was the case previously. Change-Id: I42f06654d45fb0e633f3c6d912fc8f05c23249aa Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add Q_DECLARE_PRIVATE equivalent for QDir, to be able to subclass itDavid Faure2011-11-084-15/+33
| | | | | | | | Apply the same solution to QFileInfo (no public detach(), but a non-inline d_func instead). Change-Id: I31c4c759f44a0649b97f7884b078b174c9c00f22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Bump QCoreApplicationPrivate::app_compile_version to 0x050000Bradley T. Hughes2011-11-071-1/+4
| | | | | | | | | The minimum compile version is 0x050000 now, it cannot be less. Remove checks for 0x040200 in the widget code, which provided compatibility in the 4.x series for binaries compiled with 4.0 and 4.1. Change-Id: Ia01da90de26dca6aeeb79d29c754cbeeecf809af Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* symbian epoc root code removedJoerg Bornemann2011-11-072-18/+0
| | | | | | | Change-Id: Ibc9f5e42c534a09a8a44a0c95789f467970d38a2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Reinstate and deprecate the two argument QMetaType::constructKevin Simons2011-11-051-0/+4
| | | | | | Change-Id: Id291f00ba13a39b4af022b75fd428b876d6dd9b0 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix usage of QtConcurrent headers with -Wshadow -WerrorDavid Faure2011-11-041-2/+2
| | | | | Change-Id: I172888518a3db01f89e61061eccf85f7f3387d07 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Revert "Use standard spelling for two languages"Lars Knoll2011-11-042-49/+49
| | | | | | | | | | | This reverts commit 9358f7eaa4b773bdbfa45b08ab92a89096954881. The change is source incompatible and hasn't been agreed upon. Revert it even though it's correct in principle. It's simple to keep the old enums around for compatibility. Change-Id: I8d9d33868e44d0299a3f081833b06cedf0ed4345 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPaths: add DownloadLocation.David Faure2011-11-045-3/+13
| | | | | | | | | Only properly implemented on unix (XDG), falls back to Document location on Mac and Windows, because not easily available with the current API being used by either one. Change-Id: Id269f0e3c4e3a68e19205de96c0b39980fde80ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use standard spelling for two languagesJiang Jiang2011-11-042-49/+49
| | | | | | | | Singhalese -> Sinhalese Divehi -> Dhivehi Change-Id: I3faa7163202a4a9be14e3cf857da60aa4dd3196f Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>