summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Use true and false in preference to TRUE and FALSESergio Ahumada2012-09-0524-71/+71
| | | | | | | | The TRUE and FALSE macros are obsolete and should be replaced with true and false (all lower case) respectively. Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Optimize QTextLayout/QTextEngine usage outside of QTextDocument.Milian Wolff2012-09-052-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QTextLayout is used in a QTextDocument, many code paths use special caches and thus greatly outperform the raw QTextLayout version that operates directly on a QString. This patch brings some of these optimizations also to the raw version. We now also use a QFormatCollection in such cases and enable the functionality of QTextEngine::indexAdditionalFormats() and QTextEngine::resolveAdditionalFormats(). Thanks to that, we can greatly speed up QTextEngine::format(), which now uses an amort O(1) hash table lookup instead of a O(N) linear search. The added benchmark shows a gain in the order of one magnitude: ./tst_bench_QText formattedLayout:long-many before applying the patch: 378.19 msecs per iteration (total: 37,820, iterations: 100) after applying the patch: 25.80 msecs per iteration (total: 2,580, iterations: 100) Note: This change is source-incompatible for applications using the private QTextEngine API. Task-number: QTBUG-8389 Change-Id: Ifcf7a8902a394428979ea06a6d955f886ee739c7 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix Windows platform plugin narrowing conversion compile errorsJonathan Liu2012-09-052-2/+2
| | | | | | | | Implicit conversions from int to BYTE (unsigned char) result in compile errors when compiling with the GCC -std=c++0x option. Change-Id: Iaf8190426207bf15ab4b337300510596d70659ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove custom sort implementation in QTriangulator in favour of std::sort.Robin Burchell2012-09-041-126/+3
| | | | | | | | | | | | | | qSort has terrible performance, especially on mostly-sorted input, which is presumably why a custom implementation was created. However, std::sort has much better performance than qSort in many cases. Benchmarking shows that std::sort beats out the custom sort by a very narrow margin (21-22ms for qSort, 14-15ms for sort, 14ms for std::sort) in a simple benchmark of sorting. Change-Id: If7e57fdfaf98e741d1621969461537c82f9169fe Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Correct the QFileDialog's delete warning message.Mitch Curtis2012-09-041-3/+3
| | | | | | | | | | | "Are sure you want to delete '%1'?" should be: "Are you sure you want to delete '%1'?" Title of the message box should be Delete, not Open. Task-number: QTBUG-26851 Change-Id: I40933c5e1b231d3d2e3274b4d669267d26ba8cfc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Clarify QDateTime::secsTo and QDateTime::msecsTo documentation.Mitch Curtis2012-09-041-2/+2
| | | | | | | | | | | Changed: "Returns 0 if either time is invalid." to: "Returns 0 if either datetime is invalid." Change-Id: I52d291459f215c1bb7fc78e70eaac90b2498158b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* fix QT_{BEGIN,END}_INCLUDE_NAMESPACE mixupOswald Buddenhagen2012-09-041-0/+2
| | | | | Change-Id: Id25b6aa56681b5bb5989472a96128789c0c4e73a Reviewed-by: hjk <qthjk@ovi.com>
* QWizard/Win: Fix vista helper cache state invalidationJonathan Liu2012-09-041-1/+2
| | | | | | | | | | If the cached state is not dirty and the instanceCount is zero, when the instanceCount is incremented the cached state will not be correct. To fix this, reset the cached state to dirty if the instanceCount is incremented from zero. Change-Id: Ic49eef7f83b1289a939f998817b1b2b5f5a2a45f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* graphicsview: use std::sort instead of qSortRobin Burchell2012-09-045-15/+15
| | | | | | | | | | | | In almost all cases, std::sort is wildly faster than qSort - but especially in the case where the input data is already sorted. in some stress tests which ran through the index with a lot of items, this commit provides huge speedup (684ms down to 10ms for painting 15001 empty items on the provided benchmark), for me. Task-number: QTBUG-11022 Change-Id: I5551f8e320c33ba13d464bf22047a665c81f3b74 Reviewed-by: Peter Kümmel <syntheticpp@gmx.net> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Doc: fix yet more errors reported by qdocaavit2012-09-045-17/+90
| | | | | Change-Id: I67ac081ce95235912784bbbc347dd8f80fdebbde Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Generate includes for Qt containers used as auto-metatypes.Stephen Kelly2012-09-031-0/+42
| | | | | | | | | | | | Otherwise the containers might be forward declared in the moc file, and when the moc file is compiled in a standalone translation unit, the full definition of it would not be available. This results in odd compile errors, so instead generate the includes if required. Change-Id: Ie01c5a5d45314daad0b00dec03b3e1e18cdbae64 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Cleaner support for window flags in QCocoaWindowGabriel de Dietrich2012-09-032-37/+75
| | | | | | | | | Window flags were not properly forwarded to the platform window instance. Particularly in the use cases found in QtQuick desktop components. Change-Id: Ibeadfee7de95ba497e9c0f765acee77c84884466 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Use QStringList::join(QChar) overload where applicable [QtSql]Marc Mutz2012-09-032-2/+2
| | | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: Ie395d82d17710683968d006d22de313ef49dc6e5 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Clarify QDateTime documentation re timeSpec conversion.Mitch Curtis2012-09-032-2/+52
| | | | | | | | | Clarify the documentation for setTimeSpec, toTimeSpec, toUTC and toLocalTime, to be clear on which ones return the same point in time, and which one simply changes the timezone. Change-Id: Ic47dd8876ea733f1df0f64eca5bdf00d04f8d0d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Need #include <string.h> to use memcpyShawn Rutledge2012-09-031-0/+1
| | | | | | | | Caused a compile failure in qtmultimedia. Change-Id: I73652d93848c2005c0132d24bb0d269e7b450396 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fix docs of qAbs to have the correct function signature.Jan-Arve Saether2012-09-031-1/+1
| | | | | Change-Id: I984032dc58387ae8f28318beeb053af28ccc8885 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* fix a mismatch of using QT_NO_NETWORKPROXYJing Bai2012-09-031-0/+3
| | | | | | | | To fix a compile error when QT_NO_NETWORKPROXY is defined. Change-Id: If0433387cff2e6574fe24721a0ce2bfc41b0eb47 Reviewed-by: Markus Goetz <markus@woboq.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QStandardPaths should still work without desktop serviceJing Bai2012-09-031-4/+0
| | | | | | | | | To fix a compile problem when QT_NO_DESKTOPSERVICES is defined. We should enable QStandardPaths on Mac even without desktop service, since it doesn't rely on desktop service and it is used in other files. Change-Id: I29267ebfe81b79c598043f8287fd2bb419573570 Reviewed-by: David Faure <faure@kde.org>
* QDBusPendingCallPrivate: save 8 bytes on 64-bit archsMarc Mutz2012-09-031-2/+1
| | | | | | | | | | Moved waitingForFinished out from between two large-type variables to save eight bytes per QDBusPendingCallPrivate on 64bit platforms. Many a mickle makes a muckle. Change-Id: I5612ad8bb907c6770be0245e667bdb2add30d38b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusPendingCall: remove unneeded volatile qualificationMarc Mutz2012-09-031-1/+1
| | | | | | | | The variable waitingForFinished is only ever read under mutex protection, so a volatile qualification isn't necessary. Change-Id: I17ce3fbfb090c8ae5e43dd2a93e4f48810dbbff3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusPendingCall: add a missing QWaitCondition::wakeAll() callMarc Mutz2012-09-031-0/+1
| | | | | | | | | | In QDBusConnectionPrivate::waitForFinished(), threads that see pcall->waitingForFinished == true go to sleep on pcall->waitForFinishedCondition, but there was no call to waitForFinishedCondition.wakeAll() anywhere in the code, so add it. Change-Id: I8d068dc0cc4f20786eb40fd7e2bb9840d8b70c7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringList::join: add an overload taking a single QCharMarc Mutz2012-09-032-5/+17
| | | | | | | | | | | | | | This overload avoids the needless heap allocation that the traditional overload incurs due to the implicit QChar -> QString conversion involved there. In order to share the implementation between the two overloads, QStringList_join now takes the separator as a (Char*,int) tuple instead of as a QString. Change-Id: I92961f13a3f19099de2a6e2df9f4789a12fc83a0 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the package macros from qglobal.hThiago Macieira2012-09-031-4/+0
| | | | | | | It's the wrong place to have these. Change-Id: I3b716317ba02ea2baf0f7053c8b16128e4c88e17 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Change SChar to metatype id 40.Stephen Kelly2012-09-032-5/+4
| | | | | | | | | This fills the gap left by QWidgetStar, making the sequence between FirstCoreType and LastCoreType contiguous, which some benchmarks assume to be true anyway. Change-Id: I2d5d202b6246a9065fdf77f325a4a04279dbe4b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix docsFrederik Gladhorn2012-09-034-12/+14
| | | | | | Change-Id: Id57b7932afb89fe9d3f4f6e6c3b558265475d77b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* doc: fix example linkFrederik Gladhorn2012-09-031-1/+1
| | | | | Change-Id: Ie0235281c3a4d5e5dadc6e5823bbf722b7ca411f Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix doc errors in QScreen.Jason Barron2012-09-031-15/+13
| | | | | | | | | - Ensure all args are documented - Remove signals from \sa tag - Ensure return values are documented Change-Id: I1db111d082ee47f046598695bc3fa53d67798333 Reviewed-by: aavit <qt_aavit@ovi.com>
* QWizard/Win: Fix incorrect cached state after all wizards destroyedJonathan Liu2012-09-032-1/+5
| | | | | | | | | | | | | | | | | | | | | If a QWizard is shown when Aero is enabled, the current visual style is cached in a static member of QVistaHelper. The cached state is updated by QVistaHelper when it receives WM_THEMECHANGED or WM_DWMCOMPOSITIONCHANGED events from Windows. If all QWizard instances are destroyed, there are no instances of QVistaHelper to receive these notifications and update the cache. If Aero is now disabled, the cached current visual style in QVistaHelper isn't updated. If a wizard is now created and shown, a large black rectangle is shown in the titlebar. A static instance count is added so that when no wizards are running, the cached state is not used. Task-number: QTBUG-27004 Change-Id: Iefe4c8552388280219c9726418ed7476b8ebb15a Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix MinGW-w64 GCC 4.6.3 compilationJonathan Liu2012-09-031-2/+2
| | | | | | | | Several IShellLibrary constants and the COMDLG_FILTERSPEC struct are already defined in newer versions of the MinGW-w64 headers. Change-Id: I614b35c835123484aeeb4e61e0bae24261584da0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Private slots should be named starting with _q_Sergio Ahumada2012-09-039-18/+19
| | | | | | | | | | | | | This is to reduce the risk of collisions with signals/slots in user classes q_updateFocusObject(QObject *object) => _q_updateFocusObject(QObject *object) q_checkFocusObject(QObject *object) => _q_checkFocusObject(QObject *object) q_connectFocusObject() => _q_connectFocusObject() emitActivated(QPlatformSystemTrayIcon::ActivationReason) => _q_emitActivated(QPlatformSystemTrayIcon::ActivationReason) Change-Id: I148913f1e24a80fe5cacfd737d1b455b805cfced Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* qpa: incorrect rendering when stretching and clippingJulien2012-09-031-5/+17
| | | | | | | | | | | When using QBlittable with SourceOverScaledPixmapCapability, rendering through clipAndDrawPixmap is incorrect when stretching: source pixmap rectangle has to be corrected using scaling factor. Change-Id: I7026987f5c47094a4578c0da4ccb67a0241d64bd Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Julien BRIANCEAU <jbrianceau@nds.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Fix moc generating invalid code for slots with reference types as argument.Volker Krause2012-09-021-2/+2
| | | | | | | | | | | We can't have T& declared/registered as a metatype (wont compile), but using it as type for a slot argument is possible. With the recent introduction of metatype auto-registration we have to make sure that moc doesn't attempt to auto-register those. Simple types are handled correctly already, this fixes containers and smart pointers. Change-Id: Id96857c57d6ebf158a67e9d527c89dc195473b1b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Introduce hook for text cursor changes in QTextEdit and QPlainTextEdithjk2012-09-024-1/+24
| | | | | | | | | | | Currently it is hard for Q{Plain}TextEdit subclasses to keep track of changes of the text cursor by direct calls to setTextCursor from arbitrary code. By redirecting the setTextCursor to a virtual function subclasses get the chance to intercept such calls. Change-Id: Id92d9c86928b97285b0f5b7b39790442dfac3e50 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* checkForCodecs is not used when QT_LOCALE_IS_UTF8 is definedJiang Jiang2012-09-021-1/+1
| | | | | | Change-Id: I3d82863cbd123dbf73eb8f5721ef9294e6365de6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Find qdoc indexes in relative paths.Frederik Gladhorn2012-09-011-1/+1
| | | | | Change-Id: Ie717e85bfc3d49173d1ae4caf2a01ad6e9b8b625 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Use QString() instead of "".Frederik Gladhorn2012-09-017-58/+58
| | | | | Change-Id: I42c55344663808b8362e2c9185273a00fc1c70b0 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Don't reference widgets/widgets in example doc.Frederik Gladhorn2012-09-011-3/+3
| | | | | Change-Id: Ie1fe516f75ca8c1b2233dc6bb2b887b55593e730 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Doc: Fix docbuild when not using -developer-build.Casper van Donderen2012-09-0111-22/+22
| | | | | | | | https://codereview.qt-project.org/#change,33974 only works in the case of a developer build. Not in a normal prefix build. Change-Id: I3a3e5029cefaa9f83c5deb71665f0efa9d812819 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Fix address book example.Frederik Gladhorn2012-09-011-1/+1
| | | | | Change-Id: I2e0cb03bb7e9585edf44d4464af17848069337ee Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Fix graphicsview docs.Frederik Gladhorn2012-09-011-12/+11
| | | | | Change-Id: I9438e64dbbc859fc60eb41a1bc664af35b762894 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Moved gui example documentation to the proper location.Samuel Rødal2012-09-013-303/+8
| | | | | | | Gui example documentation should be in examples/gui/doc/ Change-Id: I3cd196a2bb5d76b6e275f336b29a2ad1811159dd Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Doc: Fix some documentation issues.Kim Motoyoshi Kalland2012-08-314-14/+93
| | | | | Change-Id: I21bba7b8a1808cf214cae1b7d3b6b5e41e36e3ba Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Doc: Add documentation for deprecated function.Kim Motoyoshi Kalland2012-08-311-0/+7
| | | | | Change-Id: If1e76e4ac7f1da5f0362a7774b3341a4fedb31b0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Doc: Fix wording in \brief section.Kim Motoyoshi Kalland2012-08-311-2/+2
| | | | | Change-Id: I60748a681cce6bd61805376b2a2cd38d2020e68e Reviewed-by: aavit <qt_aavit@ovi.com>
* Doc: Remove documentation for removed function.Kim Motoyoshi Kalland2012-08-311-8/+0
| | | | | Change-Id: I3d2b4078f7c442b636e4848048c41f9f8223c98b Reviewed-by: aavit <qt_aavit@ovi.com>
* Moved snippets from widgets to gui so that they are found by qdoc.Kim Motoyoshi Kalland2012-08-312-0/+0
| | | | | Change-Id: I3245366c26dfffc6c2eb062e9710460c32e4b8d8 Reviewed-by: aavit <qt_aavit@ovi.com>
* add macro wrap for QXmlStream related codeJing Bai2012-08-312-0/+13
| | | | | | | | To fix a compile error when QXmlStream is removed by defining macro, but it is still used in some files. Change-Id: I776c799732212b7401767440448248fc7b5dc480 Reviewed-by: David Faure <faure@kde.org>
* QDoc: Write SHA1 of .qhp to file.Casper van Donderen2012-08-313-1/+18
| | | | | | | | | QDoc should generate a SHA1 hash of the .qhp file to be able to use that file as a search index. The idea is that we can use the hash as an identifier to check if the search index was updated. Change-Id: Ifd19571bcebf7d735ef452dca6c046a14fedc0e2 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QXxxStyle: override standardIcon() & layoutSpacing()J-P Nurmi2012-08-3125-160/+127
| | | | | | | | QStyle::standardIconImplementation() & layoutSpacingImplementation() are removed, and standardIcon() & layoutSpacing() made pure virtual. Change-Id: Ibf43323d0cf6c3b6cec4547afe8e826e120f74ba Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
* QStyle: make standardIcon() & layoutSpacing() virtualJ-P Nurmi2012-08-312-119/+14
| | | | | | | | Removes standardIconImplementation() and layoutSpacingImplementation() that were added in Qt 4 as a workaround for binary compatibility reasons. Change-Id: I45292dc6802310d6cda4f443bb7484b061af0138 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>