summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* FocusAboutToChange event to be send before focus changesPekka Vuorela2012-03-221-0/+1
| | | | | | | | | | | | | | Focus change happen as: FocusAboutToChange event -> focus change -> FocusOut event -> FocusIn event. Input method need to have focus when calling commit(). Notification on focus about to be lost allows QWindow implementations to commit in time. Also changes QWidget documentation to match code reality. Change-Id: I17a8a374a33dd700909f79e370b42348869261a6 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix a memory leak in template QMetaObject::Connection.Jędrzej Nowacki2012-03-191-1/+8
| | | | | | | | | QObject::QSlotObjectBase instance given as argument to QObject::connectImpl was not dereferenced in case of an unsuccessful connection. Change-Id: I206b14e986690c027aafc2593762d85dc619e0e6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QPointer: update its document and changes-5.0.0Debao Zhang2012-03-181-7/+1
| | | | | | | | | | | | QPointer has been un-deprecated and one behavior which slightly different from Qt4 has been fixed. see SHA: b8773165d76e0d5d46287d92f9d6bdbbd2110180 and SHA: 497622cafe235eadb5dd5056b196d8451ee89071 Change-Id: I4bae2cce3ebfebd8f59b18b5a6a7a7226b8353b9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Un-deprecate QPointer per mailing list discussion.Robin Burchell2012-03-152-6/+1
| | | | | | | | | | Now that QPointer is implemented in an efficient manner, there is really no need to avoid it, deprecating it just adds a large amount of churn. Change-Id: I32116faf14c3b07631d59ba9585f9ce422531646 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Simplify QMetaObject::newInstanceJędrzej Nowacki2012-03-141-3/+3
| | | | | | | | | To create space on stack for a QObject pointer QVariant is not really essential. Change-Id: Iaf04a4f77005e33823f0e14bfdc6fe927cb59867 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Reimplement QMetaType::create method.Jędrzej Nowacki2012-03-141-228/+55
| | | | | | | | | The method was reimplemented using QMetaTypeSwitcher. That should reduce maintenance costs, because types list is populated automatically now. Change-Id: I6637f7b928218ce60b2ec7436079a44089f0e00f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix a memory leak in QMetaObject::connectSlotsByName function.Jędrzej Nowacki2012-03-141-1/+1
| | | | | | | | QObjectPrivate::Connection time life should be controlled by QMetaObject::Connection handle. Change-Id: Ie7fcd950082a3e6cebc29ecc0622007470914edb Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Unify QMetaType::TypeFlags detection.Jędrzej Nowacki2012-03-143-21/+15
| | | | | | | | | Duplicated code was removed. As an side effect: - one runtime flag check was replaced by a compile time check. - is enum flag can be used together with built-in types. Change-Id: I54173e7b07ce7e487d3cc21ba24dcccd28b5d049 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Restore some source compatibilityLars Knoll2012-03-121-1/+5
| | | | | | | | | | | Add an implicit #include back in to avoid needless SC and compilation breaks. Add some deprecated method for codecForTr, until all other modules are ported to mot use it anymore. Change-Id: I5334b47a0c32819b9eb6b7203cc98ce4e6073a64 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add Q_IS_ENUM(), and provide as flag in QMetaType::typeFlags()Glenn Watson2012-03-111-1/+5
| | | | | | | | | | | | | | Add Q_IS_ENUM() macro to determine if a given type is an enumeration. Use information from that in QMetaType::registerType() to store whether custom registered metatypes are enums or not. This information can then be accessed by calling QMetaType::typeFlags(int type). This is used by the declarative code to determine whether a custom type in a variant can be safely cast to an integer, which is required to allow passing non-local enums as signal/slot params. Change-Id: I9733837f56af201fa3017b4a22b761437a3c0de4 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Crash fix in QMetaType::typeFlags.Jędrzej Nowacki2012-03-111-1/+1
| | | | | | | The function is public, so it should validate input instead of crashing Change-Id: Id67463b0b61ab74a76c1ede7f052bdbed37822b6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* misc: Fix some random typos and grammar while reading code.Holger Hans Peter Freyther2012-03-091-4/+4
| | | | | | | | | | | | Typos: recieve -> receive descrived -> describe Grammar: this types -> these types Change-Id: Iedacc51a6322996f423ac9472af0a597424a4fed Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Crash fix in QMetaType::typeName.Jędrzej Nowacki2012-03-081-2/+3
| | | | | | | The function is public, so it should validate input instead of crashing Change-Id: Ifd9f1110f8631f942929d85db6a57eee7afffb6a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix crash in QVariant::canConvert.Jędrzej Nowacki2012-03-081-0/+2
| | | | | | | | The function was crashing when an unsupported type id was given as an input argument. Change-Id: I2b0e3e6d43f6f248dc71532f8e6485efe68e8120 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.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>
* 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>
* Cleanup QThread::initialize and QThread::cleanupOlivier Goffart2012-03-061-5/+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>
* 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>
* Remove codecForTr().Robin Burchell2012-03-064-19/+10
| | | | | | | | | | 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>
* 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 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>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-047-21/+45
|\ | | | | | | | | | | | | | | | | | | 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>
| * 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>
| * Make qobject_p.h not need qvariant.h.Stephen Kelly2012-02-293-10/+12
| | | | | | | | | | | | | | | | | | | | 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>
| * Merge master -> api_changesRohan McGovern2012-02-2912-208/+145
| |\ | | | | | | | | | | | | | | | Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac. Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
| * | Allow moc to handle symbols that have been redefined.Matthew Vogt2012-02-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow moc to produce the desired identifiers when used with C++ symbol names that have been redefined, for example by -Dfoo=bar. Two changes are required: firstly, when encoding a type name, the components of the name must be checked for substitutions that have been defined for that token (note that this is not done here by correct pre-processing, but only by processing the resultant table of definitions). Secondly, the arguments to the SIGNAL, SLOT and METHOD macros must be allowed to be substituted during macro expansion rather than stringized directly. This is a temporary change to prevent breaking existing projects that depend on the declarative module. After clients have had an opportunity to update their code to the use the new interfaces, it can be removed. Task-number: QTBUG-23737 Change-Id: I39e6844cebf6ca7984af6028160b8a3797ac44a5 Reviewed-by: Martin Jones <martin.jones@nokia.com>
| * | QByteArray: deprecate QT_NO_CAST_FROM_BYTEARRAY-protected operatorsMarc Mutz2012-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QByteArray::operator const {char,void}*() implicit conversions are a source of subtle bugs, so they right- fully can be disabled with QT_NO_CAST_FROM_BYTEARRAY. const char *d = qstring.toLatin1(); // implicit conversion while ( d ) // oops: d points to freed memory // ... But almost no-one ever enabled this macros in the wild and many were bitten by these implicit conversions, so this patch deprecates them. I would have liked to remove them completely, but there are just too many occurrences even in Qt itself to hope to find all conditionally-compiled code that uses these. Also fixes all code that needs to compile under QT_NO_DEPRECATED (in qmake/, src/tools/). I984706452db7d0841620a0f64e179906123f3849 separately deals with the bulk of changes in src/ and examples/. Depends on I5ea1ad3c96d9e64167be53c0c418c7b7dba51f68. Change-Id: I8d47e6c293c80f61c6288c9f8d42fda41afe2267 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | | Fix documentation of the new connect functions.Olivier Goffart2012-03-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Make sure that qdoc can find the same function signature in the header than in the \fn tags in qobject.cpp Change-Id: Iccf2ba4e8f6384e9c3bfc878a446120f03e8a813 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* | | Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-0213-125/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | | QBoolBlocker: make constructor explicit and disable copyingMarc Mutz2012-03-011-1/+2
| | | | | | | | | | | | | | | Change-Id: If294eff3f84f837ed554c572527d46a89660de9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove Mac qDebug ifdefs.Morten Johan Sorvig2012-02-291-23/+0
| | | | | | | | | | | | | | | | | | | | | Make qDebug work again with the new logging framework. Change-Id: Ib88a83182429636b274d6284933d5ea00db7279c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* | | Add support for QT_NO_SIGNALS_SLOTS_KEYWORDSStephen Kelly2012-02-291-2/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QT_NO_KEYWORDS can be used for example to ensure that foreach can not be used, but Q_FOREACH must be, that slots must not be used but Q_SLOTS must be, etc. Typically they are used to avoid symbol conflict with other libraries that may use the same keywords (I think boost uses signals). For 3rd party libraries, it makes sense to use Q_SLOTS and Q_SIGNALS instead of slots and signals, so that downstreams can still choose to use QT_NO_KEYWORDS in their code. The most convenient way to enforce that currently is to define QT_NO_KEYWORDS when building the 3rd party library. However, that has the inconvenient side effect of making foreach, forever and emit not usable within the library implementation. This patch makes it possible for the 3rd party library to use QT_NO_SIGNALS_SLOTS_KEYWORDS to exclude signals and slots without affecting whether the other keywords can be used in the library implementation. Change-Id: If1e16a4fa384bd3a2ddd737143499f8b587bc4f8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | Detect QMetaType::QReal from the definition of qrealOlivier Goffart2012-02-271-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying to complex preprocessor expression that need to be maintained to be kept the same as in qglobal.h This aslo fix the case where QT_COORD_TYPE is defined (It is meant to be defined to float or double, any other type would not make sense) So now there should hopefully be only one place to change if one need to adjust the type of qreal Change-Id: I778312112603173562dbe675ab491b53d6cd2174 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* | Simplify QMetaTypeSwitcher.Jędrzej Nowacki2012-02-272-26/+8
| | | | | | | | | | | | | | | | | | | | We do not need to distinguish between different types in the switcher. Before this patch it was not possible to overload DelegateObject::delegate with a pointer type. Now it is fixed. Change-Id: Icd73a53e73e5e66b1b6f6407ba4e0f79e584d930 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Optimize space for the QEventLoopQuitLocker.Stephen Kelly2012-02-271-9/+23
| | | | | | | | | | | | | | Use a union and a type enum instead of three pointers. Change-Id: I02b11733a4f2e95099064fa9325497d4e04ac615 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* | Reduce QtCore lib binary size by around ~3KB, by removing template codeJędrzej Nowacki2012-02-273-84/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reusing a template is much better then creating a new one, even if it should inline the same code. For some reason replacing T* by void* force gcc to remove a few bytes per template instantiation too, it is not really significant, but it alows us to simplify the code. Benchmarks don't show any regressions. Change-Id: I4fdf1e4dc311b23021eb5758605602937d05b183 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Cleanup usage of QVariant::Type.Jędrzej Nowacki2012-02-272-43/+43
| | | | | | | | | | | | | | | | | | QVariant::Type is marked as obsolete. It is not possible to get rid of it completely, in a source compatible way, but at least we can remove it safely from a method arguments list. Change-Id: I26b58099bfa6d32f3a583a8ae0047f0bb36bcd0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | RemoveRef should not remove the constOlivier Goffart2012-02-261-1/+0
| | | | | | | | | | | | | | | | | | This does not fix anything, because AreArgumentsCompatible already do all the type checks. But it make RemoveRef consistant with std::remove_reference Change-Id: Ic42c872356172d7f5ea10de050254b5d10e50a6e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Bump the moc output revisionKent Hansen2012-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit aee1f6cc413f56bf4962324799ee3887c3dd037f changed the values of some built-in meta-type ids. Since the ids of built-in types are directly encoded -- not as the symbolic QMetaType::Type name, but as a raw integer -- in the flags for meta-properties, the moc output prior to that change is incompatible with the current output. Change-Id: I970484825137a4f19c80726cfe2024e741e3e879 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove QT_ASCII_CAST_WARN_CONSTRUCTORStephen Kelly2012-02-231-1/+1
| | | | | | | | | | | | | | GCC version < 3 which it was created for is not supported anymore. Change-Id: I0b4df4c99600cacbaafbf0bc4270cd4978600956 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Rename QMetaTypeSwitcher::UnknownType to NotBuiltinType.Jędrzej Nowacki2012-02-233-11/+11
| | | | | | | | | | | | | | | | UnknownType suggest that a type is unknown to QMetaType, but QMetaTypeSwitcher is not checking for custom types. Change-Id: I6b8b692e0f20bed286c713672b35fb15757d389e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Add the quitlock feature to QThread.Stephen Kelly2012-02-232-2/+18
| | | | | | | | | | | | Change-Id: Ib44ee9739499ba4c5f0fecbef3976251ea22836d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove use of Q_BROKEN_DEBUG_STREAM.Stephen Kelly2012-02-223-25/+7
| | | | | | | | | | | | | | | | No supported compiler defines it, and it was not used consistently so it didn't work anyway. Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove custom text codec for C strings.Robin Burchell2012-02-221-4/+2
|/ | | | | | | | | | This setting is extremely harmful, as code cannot know whether or not to expect it. It also made the behaviour of QString::fromAscii and ::toAscii unintuitive, and caused a lot of people to make mistakes with it. Change-Id: I2f429fa7ef93bd75bb93a7f64c56db15b7283388 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* replace 'const QChar &' with 'QChar ' where appropriateKonstantin Ritt2012-02-212-3/+3
| | | | | | | | | as QChar is actually an ushort and there is no point in taking its address. Merge-request: 69 Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merges several overloaded functions in QCoreApplication.Xizhi Zhu2012-02-202-63/+6
| | | | | | | | The source compatibility is kept. Change-Id: If66053b271d65062b3c0ce6ec66c8394a37b4e3e Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QMetaMethod::parameterTypes() implementation to helper functionKent Hansen2012-02-202-18/+30
| | | | | | | | | | Because of an upcoming change to the meta-object data format, the ability to extract parameter types from a signature will be needed by meta-object builders (such as QMetaObjectBuilder) soon. Change-Id: I1f21b2be41761a5db2f1a05976fad29eb3aebb03 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QMetaMethod::isValid() functionKent Hansen2012-02-202-0/+10
| | | | | | | | | | | | This function provides a proper way of determining whether a function returned by QMetaObject::method() is valid. (Checking whether signature() returns a 0 pointer, which e.g. testlib does, is not an ideal API -- especially given that signature() will soon be removed and replaced by a function that returns a QByteArray.) Change-Id: I644f476b09904925f2042945f5d0ad744482b682 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't call metaObject() several timesKent Hansen2012-02-201-5/+6
| | | | | | | | It's sufficient to call it once per invokeMethod. Change-Id: I1db826027eca87c799f216d65e27c801a23e64e2 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>