Commit Graph

9254 Commits

Author SHA1 Message Date
Oswald Buddenhagen
b32f3ba9e4 remove pretenses of supporting projects on stdin
this may have worked a decade ago, but now it only produces funny
Makefiles (and needs hacking main.cpp). the feature doesn't seem *too*
important, so just clean it out.

Change-Id: I50a60b0e30341f0b523e4a5731c770c9c1013f8b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-05 03:03:12 +02:00
Oswald Buddenhagen
791cb02463 make QMakeMetaInfo a little less inefficient with libtool .la files
don't read the spec from scratch for every library just to get
QMAKE_LFLAGS_RPATH. we can perfectly use our current project for that
purpose.

Change-Id: I4e408b3fd5de81652181df032aa53cd8f2f8f806
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-05 03:03:10 +02:00
Oswald Buddenhagen
09df6bec73 pre-initialize more invariant properties
Change-Id: I0add2e7ead5a3d63124ef7ff85362895dd64bd23
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-05 03:03:08 +02:00
Oswald Buddenhagen
19e3441b7c remove QMAKE_MKSPECS property from qmake -query's view
it's a dynamic property which is something between meaningless and
misleading when used outside a project file.
also, experience from creator shows that people would consistently
abuse it (not handling it as the list it is).

Change-Id: Id52cd40da5c38c0c74535d0701fdae53dfa39cad
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-05 03:03:06 +02:00
Sergio Ahumada
56d5c909af Use true and false in preference to TRUE and FALSE
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>
2012-09-05 03:03:05 +02:00
Sergio Ahumada
10ed50002c test: Check for null string comparison
Do not compare a QString to QString(). Instead use the .isEmpty() method.

Change-Id: I8bb5e64563bf173abe7288bb9e35375bee1fe445
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-05 03:03:02 +02:00
Milian Wolff
0102f34f1e Optimize QTextLayout/QTextEngine usage outside of QTextDocument.
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>
2012-09-05 03:02:59 +02:00
Jonathan Liu
3fe5715b9a Fix Windows platform plugin narrowing conversion compile errors
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>
2012-09-05 03:02:23 +02:00
Robin Burchell
90e4a5b5f0 Remove custom sort implementation in QTriangulator in favour of std::sort.
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>
2012-09-04 20:47:20 +02:00
Mitch Curtis
e525df612c Correct the QFileDialog's delete warning message.
"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>
2012-09-04 20:47:20 +02:00
Mitch Curtis
917b4bec21 Clarify QDateTime::secsTo and QDateTime::msecsTo documentation.
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>
2012-09-04 18:29:10 +02:00
Sean Harmer
219ba05b2a QNX: Move qpa-based mkspecs out of the unsupported directory
RIM is committed to supporting Qt on its platforms and the port works
well.

Change-Id: Id6bfea2dbc178800adad89d436ce31c40d3eb652
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-04 18:17:23 +02:00
Oswald Buddenhagen
f8f78a4f6f fix QT_{BEGIN,END}_INCLUDE_NAMESPACE mixup
Change-Id: Id25b6aa56681b5bb5989472a96128789c0c4e73a
Reviewed-by: hjk <qthjk@ovi.com>
2012-09-04 10:30:33 +02:00
Rafael Roquetto
3d4fc578bd Auto test for 'qmake -project' use case.
Change-Id: Ifb6d64828ba1cb42fd64299438b7eec302112edf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-04 10:30:33 +02:00
Morten Sorvig
53d0829aa1 Fix indentation.
Change-Id: I0e53df9e1903c8cdc79d50c16cfe7f90ae6e1d6f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-04 10:30:33 +02:00
Jonathan Liu
e5ebcbc634 QWizard/Win: Fix vista helper cache state invalidation
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>
2012-09-04 08:20:48 +02:00
Robin Burchell
8486a510d5 graphicsview: use std::sort instead of qSort
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>
2012-09-04 02:03:23 +02:00
aavit
ce2a8bdc13 Doc: fix yet more errors reported by qdoc
Change-Id: I67ac081ce95235912784bbbc347dd8f80fdebbde
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-09-04 02:03:23 +02:00
Sean Harmer
e322455427 QNX: Tidy up QMAKE_LFLAGS in qnx mkspecs
We do not need to include -lang-c++ more than once in QMAKE_LFLAGS*
variables. The fact that this was not appearing more than once was due
to QMAKE_LFLAGS being overwritten (rather than appended to) in
qcc-base-qnx.conf and a weird coincindence in qmake's code to dedupe
libraries passed in to QMAKE_LFLAGS. The deduping was working based
upon options beginning with "-l", including the -lang-c++ option here.

Change-Id: I983f216c0e362a9fe6a924074c5d84aaa659a14f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-03 20:33:48 +02:00
Stephen Kelly
5a1fa8860c Generate includes for Qt containers used as auto-metatypes.
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>
2012-09-03 20:05:04 +02:00
Oswald Buddenhagen
6efec23b10 remove handling of QMAKE_FILETAGS
it was unused for a decade. and broken, of course.

Change-Id: I9713d595d95c5b074ef96dfe9b1c314b9198bd7e
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-03 19:39:02 +02:00
Oswald Buddenhagen
b2d574e83f remove unnecessary QMAKESPEC fallback code
QMAKESPEC is now always set

Change-Id: Ib3f7356a9260d42315747095e28db6604b2dcfe9
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-03 19:38:58 +02:00
Oswald Buddenhagen
001d4763b5 remove pretenses of manual dependencies
now that "make depend" actually works again, just clean out the gunk.

Change-Id: Ia1858a2474c9a4544ae16c53349aa7ae09e0c685
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-03 19:36:16 +02:00
Oswald Buddenhagen
07a6b2968e unbreak "make depend" for shadow builds
Change-Id: Ib79ba79e41cfeac9350852395b03c331dc4fe2a3
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-03 19:36:12 +02:00
Oswald Buddenhagen
279c4de35a unify c*flags in the hand-written makefiles somewhat
Change-Id: I7a7139fd71bce879b3ee4d9e26e30d2ca63da69e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-03 19:36:06 +02:00
Oswald Buddenhagen
aeebe1db79 fix assignment of MSVCPROJ_TARGET
i'm only guessing what was intended here.

Change-Id: I72bfa3b5fad63f5b144d34762152e4dd851197ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-03 19:36:03 +02:00
Gabriel de Dietrich
fac7c8570b Cleaner support for window flags in QCocoaWindow
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>
2012-09-03 19:35:35 +02:00
Marc Mutz
cb8424b381 Use QStringList::join(QChar) overload where applicable [QtSql]
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>
2012-09-03 19:35:25 +02:00
Mitch Curtis
1b4ab3764b Clarify QDateTime documentation re timeSpec conversion.
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>
2012-09-03 15:58:08 +02:00
Shawn Rutledge
c9819493d3 Need #include <string.h> to use memcpy
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>
2012-09-03 15:58:08 +02:00
Jonathan Liu
d6d67d9011 configure: Fix infinite loop displaying config.summary
Displaying config.summary sometimes results in an infinite loop because
the loop condition only checks that failbit and badbit are not set.
The eofbit may be set with failbit and badbit not set.

Change-Id: I209480fbf114365fd4fdf1289c988a386f9f2562
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-03 13:41:55 +02:00
Jan-Arve Saether
be71325421 Fix docs of qAbs to have the correct function signature.
Change-Id: I984032dc58387ae8f28318beeb053af28ccc8885
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-09-03 13:41:55 +02:00
Jing Bai
3981961035 fix a mismatch of using QT_NO_NETWORKPROXY
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>
2012-09-03 13:41:55 +02:00
Jing Bai
ae2686717e QStandardPaths should still work without desktop service
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>
2012-09-03 13:41:55 +02:00
Marc Mutz
d7e29682b5 QDBusPendingCallPrivate: save 8 bytes on 64-bit archs
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>
2012-09-03 13:41:55 +02:00
Marc Mutz
9d4d0708ec QDBusPendingCall: remove unneeded volatile qualification
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>
2012-09-03 13:41:55 +02:00
Marc Mutz
20d7763b19 QDBusPendingCall: add a missing QWaitCondition::wakeAll() call
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>
2012-09-03 13:41:55 +02:00
Marc Mutz
68e04c3ac1 QStringList::join: add an overload taking a single QChar
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>
2012-09-03 13:41:55 +02:00
Danny Boelens
64a8c78538 Rename MAC_CONFIG_TEST_COMMANDLINE to MAC_SDK_FLAG
The Mac OS X SDK is the only thing that variable is
used for, so give it a name that better fits its use.

Change-Id: Ifd9866bc19edda0e9f0bcb17270eb26a8849401e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-03 13:41:55 +02:00
Thiago Macieira
a2f705029c Remove the package macros from qglobal.h
It's the wrong place to have these.

Change-Id: I3b716317ba02ea2baf0f7053c8b16128e4c88e17
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-03 13:41:55 +02:00
Stephen Kelly
dcf4d152b5 Change SChar to metatype id 40.
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>
2012-09-03 11:05:49 +02:00
Shawn Rutledge
d6d7aebd03 Command-line-only examples should not build as .app bundles on OSX
It's confusing when you double-click it and nothing happens.

Task-number: QTBUG-26976
Change-Id: I50c5625a41881bdbcbf29001197ed15da4ee0a28
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-09-03 11:05:49 +02:00
Frederik Gladhorn
812bad17df fix docs
Change-Id: Id57b7932afb89fe9d3f4f6e6c3b558265475d77b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-09-03 11:05:49 +02:00
Frederik Gladhorn
fa1738bddf doc: fix example link
Change-Id: Ie0235281c3a4d5e5dadc6e5823bbf722b7ca411f
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-09-03 11:05:49 +02:00
Jason Barron
931c329153 Fix doc errors in QScreen.
- 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>
2012-09-03 11:05:49 +02:00
Jonathan Liu
952ea029f4 QWizard/Win: Fix incorrect cached state after all wizards destroyed
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>
2012-09-03 11:05:49 +02:00
Jonathan Liu
6960fb2f6e Fix MinGW-w64 GCC 4.6.3 compilation
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>
2012-09-03 11:05:49 +02:00
Sergio Ahumada
8cba00ebf5 Private slots should be named starting with _q_
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>
2012-09-03 11:05:49 +02:00
Julien
a36efc37a1 qpa: incorrect rendering when stretching and clipping
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>
2012-09-03 08:37:50 +02:00
Mitch Curtis
ec57b20b65 Properly reflect format changes in calendarwidget example.
This patch ensures that May 1st and the first Friday of each month also
have their formats updated when the corresponding checkboxes are
unchecked instead of just checked.

Task-number: QTBUG-26936
Change-Id: Ib5f77daf8d9000eeb18663b2e07e4842a70d22b6
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-09-03 02:40:54 +02:00