Commit Graph

15130 Commits

Author SHA1 Message Date
Konstantin Ritt
02651060b6 Decrease code duplication in QFontDatabase-s
Move scriptRequiresOpenType() body right into QFontEngine::supportsScript(),
thus centralizing use of this performance cheat.

Change-Id: I5f494b086f8f900b631c491f41e9cb800002c0f6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 02:29:01 +02:00
Konstantin Ritt
741737b080 Implement QFontEngine::harfbuzzFont/Face() with HarfBuzz-NG
Change-Id: I5d4fed66d66e8aa650fe181e61dcc2345f0f907a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 02:28:48 +02:00
Konstantin Ritt
75d06db873 QFontConfigDatabase: Minor code clean-up
Get rid of duplicated includes, useless defines, and private enums
that just duplicate a public ones; avoid variable names collisions.

Change-Id: I540e812b6cd510eb1ed441d97e9af377611d804a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 02:28:41 +02:00
MyoungSeok Song
30a4114e60 QNX: new signals for foreign windows creation/closing
Implement the foreignWindowCreated and foreignWindow closed signals, emitted when foreign windows are created and closed, respectively.

Change-Id: I72dd5380e6061f191eb8362fda5dd8fb8e9ed06b
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2013-09-13 01:48:07 +02:00
MyoungSeok Song
fddf76f2ac QNX: add nativeResourceForScreen
Implemented nativeResourceForScreen api to return QObject* which can be used to connect  foreignWindowCreated, foreignWindowClosed signal in QQnxScreen.
Usecase is to connect signal in custom QML component as below
	QObject * obs = interface->nativeResourceForScreen("QObject*", screen);
	connect(obs, SIGNAL(foreignWindowCreated(void*)), d, SLOT(newForeignWindowCreated(void*)));

Change-Id: I512c3b6d188a2e90ef7b8e89c413ca420a29dd9b
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2013-09-12 19:43:33 +02:00
Gabriel de Dietrich
e30bad8b24 Windows style: Support underlined mnemonics from Qt Quick Controls
We use the usual accessibility + private property combo pattern.

Task-number: QTBUG-33030
Change-Id: I7fbb704c949ff2df163536534f6f46d2e226402d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-09-12 16:58:29 +02:00
Tor Arne Vestbø
40033ac299 iOS: Implement hasPendingEvents() in the event dispatcher
As we're using CFRunLoopIsWaiting() to check for the possible presence
of system events hasPendingEvents() will never return false if called
on the main thread. We assume clients will not use this function to
determine whether or not to call processEvents(), but instead use the
return value from processEvents.

Change-Id: Ifd63892c6d35bb7da204072616bfe3ee69ca1d85
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-09-12 16:48:00 +02:00
Tor Arne Vestbø
5d926657f4 iOS: Teach event-dispatcher to handle changes to run-loop mode at runtime
UIKit changes the run-loop mode during scrolling to UITrackingMode, which
presumably prioritizes touch events and other sources related to a
smooth scrolling experience. It signals this change by interrupting the
current run-loop pass, and the outer loop is responsible for re-entering
the run-loop in the new mode. Failing to enter the run-loop with this
new mode results in UIScrollViews losing their kinetic feel when
flicking. This can be observed by e.g. bringing up the Emoji keyboard
and scrolling it horizontally.

We keep track of the current run-loop mode by listening for push and pop
notifications on the UIApplication object. The current mode is then used
in our Q_FOREVER-loop when re-entering CFRunLoopRunInMode.

For now we don't add our posted event source or timer source to the
new modes, under the assumption that the system prefers to limit the
number of sources that will fire during scrolling. If this turns out
to give a bad user-experience for Qt applications we should consider
changing it.

Change-Id: I3a612b3cfc77c74b658963057732dc4d61684df8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-12 16:47:54 +02:00
Marc Mutz
46df8921e7 QtConcurrent: fix median calculation
The median, for arrays of odd size, is found in [size/2], not [size/2+1].
For arrays of even size, the code doesn't work anyway, so nothing to do there.

Change-Id: Id23ff3fe9538c2d8ef8f88e23127cb92af08b444
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-12 14:48:58 +02:00
Marc Mutz
880b614c8f QtConcurrent: use nth_element to calculate the (correct) median
Sorting is O(NlogN) complexity, while nth_element is linear.
Also remove the errornous +1 when calculating the median position.

Change-Id: Ib39085b59a6c5d15a3a940b1ce3377080340bc09
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-12 14:12:30 +02:00
Tor Arne Vestbø
1ec3718432 iOS: Rewrite CoreFoundation event-dispatcher
Instead of having separate code-paths for QEventLoop::EventLoopExec
and the non-blocking processEvent() we now have a single Q_FOREVER
loop where the logic can be shared. We make multiple loop-passes,
each time calling CFRunLoopRunInMode with potentially different
arguments, depending on the result of the previous run.

For the EventLoopExec case we'll continue making loop-passes until
the event-loop has been interrupted. For the non-EventLoopExec case,
we respect interruption, but will continue making loop-passes only
until we've processed all events in the queue, optionally waiting
for the initial event if WaitForMoreEvents is set. Limitations in
the CoreFoundation APIs unfortunately force us to keep some state
on whether or not we've processed events and timers for a given
processEvents() pass (with corresponding deferred scheduling of
timers and event source signaling).

The way we handle timers has also been rewritten to no longer defer
the timer activation to a special timer source. The constraint of
CoreFoundation timers is that they can not recurse (re-fire) in a
callback, but that only applies per timer, so using multiple CF
timers allows us to recurse. We still only use a single CF timer
for all the Qt timers though, and only spawn a new CF timer if
the user calls processEvents() inside a timer callback.

This commit removes the logic related to dealing with UITrackingMode,
as that logic was slighly problematic, but the feature will be
added back in a follow-up commit, in line with the new approach.

The result of this commit is that we're passing all event-loop,
event-dispatcher, and timer auto-tests, both for the QtCore dispatcher
and the GUI event-dispatcher.

Change-Id: I3c56fbc7857a25110064681257abb47075b5bd2d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-09-12 12:32:14 +02:00
Tor Arne Vestbø
fc538bce4a iOS: Bump minimum required deployment target to 5.0
Apple only provides simulators for 5.0+, and we now rely on 5.0+ APIs.

Change-Id: I9ec047767b5f5e1b33aeef186ec6aff2b9c70a05
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-09-12 12:29:38 +02:00
Tor Arne Vestbø
7c1bbde476 Move iOS makespec out of unsupported directory
It's a supported platform from 5.2, and we want build-scripts/CI/etc to
adapt to the change as soon as possible.

Change-Id: I8c78351191f59a6ecab33acc0829d2535379c787
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Simo Fält <simo.falt@digia.com>
2013-09-12 12:29:33 +02:00
Shawn Rutledge
472f3c17e3 standarddialogs example: add detailed text
Demonstrates that you can have mnemonic buttons which don't
conflict with the Ctrl-A and Ctrl-C shortcuts.

Task-number: QTBUG-6731
Change-Id: I41ce64e6f3bd0cf387af13c5c37894b721b5a3bb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-12 12:26:44 +02:00
Shawn Rutledge
c0f9aeffc1 QMessageBox: implemented shortcut for selectAll
The context menu all along has indicated that Ctrl-A selects all the
text, so now that is actually implemented.

Task-number: QTBUG-6731
Change-Id: I82dac3aea530e5a3fcd59217c4c0118025061c7d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-12 12:26:23 +02:00
Shawn Rutledge
96c711fed2 QMessageBox: shortcuts for selectAll, copy don't conflict with buttons
You can hit a key with no modifier to select a dialog button that has
the corresponding mnemonic, but it doesn't make sense to do that if
the Control or Meta key is being held.  Now you can hit Ctrl-A, Ctrl-C
to select all the message detail text and copy it to the clipboard,
even if the dialog has buttons with mnemonics like &Continue and
Save &Again.  But as before, Alt-C, plain C, Alt-A and plain A select
the mnemonic buttons on the dialog.

Change-Id: I40c052dbb7730bde444ac2de405724a3203d1472
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-12 12:26:06 +02:00
Shawn Rutledge
3865e473f2 QXcbSystemTrayTracker::trayWindow compiles if Q_XCB_DEBUG is on
Fixes qxcbsystemtraytracker.cpp:125:134:
error: 'connection' was not declared in this scope

Change-Id: If881aa9466ea94d5392da9f177e4b79e044710b7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-12 12:25:32 +02:00
Bernd Weimer
d8ba940b94 QNX: Prevent rendering when app is minimized
Windows will only be exposed and hence rendered when they are not
minimized. This will save useless computations and hence battery.

Change-Id: I83166cc6c3d89e878106c998a35890dd7788ed8a
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2013-09-12 10:36:23 +02:00
Friedemann Kleint
23964bc338 Add clear button and side action to customsortfiltermodel example.
Demonstrate the new side widgets feature of QLineEdit.

Change-Id: I1c4289c652abf2209e50601871249008fdec4f6b
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-12 10:36:23 +02:00
Friedemann Kleint
b7b573ad6d Windows: Fix window opacity for non-translucent windows.
Use the UpdateLayeredWindow() functions only for windows with alpha.

Task-number: QTBUG-33025

Change-Id: I64b0c28ee0997cd3d09dc76babe105ed474c6835
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-12 09:54:10 +02:00
Giuseppe D'Angelo
9ee4a12193 Remove qCopy from QCoreApplication
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I3ae7f8331440241d524844eb387d956c64ab62e9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-12 07:18:36 +02:00
Martin Smith
5cfb252b07 qdoc: Avoid CppCodeMarker crash on abstract QML types
In a while loop, when the first QML type encountered was
abstract, qdoc didn't create a class map on the heap, but
later in the loop, the class map was used anyway. This
caused a crash because of a null pointer to the class map.

Now qdoc creates a class map if one hasn't been created
yet, even if the QML type is abstract. This might not be
correct, but the real problem is probably the order in
which qdoc processes the QML types. It should probably
always start with a non-abstract type. But this fix will
at least avoid the crash.

Task-number: QTBUG-33387
Change-Id: Icecb165261469856820f81e3866218b15416ae3b
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-12 07:10:59 +02:00
Paul Olav Tvete
ffa4de4bec Android: Make font size compatible with Qt for iOS
We recommend using pixel sizes for predictable results. For those who
use point sizes in their UIs, we will now give them results that look
similar to what we do on iOS. The default font is changed to give
the same size as before this change.

Task-number: QTBUG-32096
Change-Id: Ia25506ba721a39d31340f3df8bc14129e507af14
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2013-09-12 07:09:42 +02:00
Friedemann Kleint
cfbc575b61 Windows: Fix/Improve closing of native file dialogs.
IFileDialog::close() only works from callbacks. Try to find
the dialog window and send it a WM_CLOSE in addition.

Change-Id: Id0f89f8781564e19e4763d43a71df55d5299fb35
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-11 23:34:28 +02:00
Martin Klapetek
ea3f8ff6d0 Add CUPS Banner Pages options to print support
Adds a way to set standard CUPS Banner Pages. This widget is part of the
Job Options widget/tab in Properties dialog.

[ChangeLog][QtPrintSupport][QPrintDialog] Added support for setting CUPS
Banner pages in the print dialog.

Change-Id: Ia7a22b7a0f51c12d170986caee61af7109e781e9
Reviewed-by: John Layt <jlayt@kde.org>
2013-09-11 21:52:50 +02:00
Tor Arne Vestbø
8a42502682 iOS: Change main-wrapper logic to not require changing the user's main
Instead of using a define to rename the user's main() function during
compilation, we leave the user code alone, and inject our wrapper one
step earlier in the process, at the application entry point 'start'.

This entry point is provided by crt1.o, which is normally linked into
the application automatically. The start() function sets up some state
and then calls main(), but we change the start() function to instead
call our main wrapper.

Instead of shipping our own crt1 binary/sources, we make a copy of
the appropriate crt1.o at build time, and modify its symbol table in
place. This is unproblematic as long as we keep the same length for
the wrapper function name, as the symbol names are just entries in
the global string table of the object file.

The result is that for the regular Qt use-case the user won't see
any changes to their main function, and we have more control over
the startup sequence. For the hybrid use-case, we no longer rely
on the fragile solution of having our back-up 'main' symbol in
a single translation unit, which would break eg with --load_all,
and we don't need to provide a dummy 'qt_user_main' symbol.

OSX 10.8 and iOS 6.0 introduced a new load command called LC_MAIN,
which places the state setup in the shared dyld, and then just
calls main() directly. Once we bump the minimum deployment target
to iOS 6.0 we can start using this loader instead of LC_UNIXTHREAD,
but for now we force the classic loader using the -no_new_main flag.

There's also a bug in the ld64 linker provided by the current Xcode
toolchains that results in the -e linker flag (to set the entry
point) having no effect, but hopefully this bug has been fixed
(or Apple has switched to the LLVM lld linker) by the time we
bump our deployment target.

Change-Id: Ie0ba869c13ddc5277dc95c539aebaeb60e949dc2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-11 21:50:55 +02:00
Tor Arne Vestbø
fc2b36ca1d iOS: Guard against this and self being deleted when using dispatch_async
When the QIOSApplicationState object owned by the platform integration
was deleted we would deallocate QIOSApplicationStateListener, but would
then get a callback on the main queue later on where we would reference
the now invalid 'this' variable.

By moving the dispatch_async call to QIOSApplicationStateListener and
using 'self' we ensure that the listener is retained for as long as the
block is valid. This opens us up for receiving application state callbacks
after QCoreApplication has been deleted, so we need to guard against
that.

Change-Id: I2ac14d28d72fd79764e12b6657234b54d846cb79
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-11 21:50:46 +02:00
Friedemann Kleint
ba7da9b733 Fix moc-crash when compiling QtScript on Windows.
@file-arguments were not parsed correctly.

Change-Id: I10dc7ebcd7c9eedb332c7c350aa06c7ac9c2e8b1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 21:46:52 +02:00
aavit
fad6aa619b Compilation fix for libjpeg release 9
In the latest libjpeg version, the "boolean" type is changed so that
true and false no longer can be used instead of TRUE and FALSE.

Also, purge some ancient code remains meant to support a now defunct
OS´s idea about the boolean type.

Task-number: QTBUG-33166
Change-Id: Iebbdf300cfdc22775954de65f985358424ed2b49
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-11 17:32:44 +02:00
Joerg Bornemann
fa7f446f8f fix configure -commercial
Commit 0aad3fc742 broke
"configure -commercial". The license check needs to know where Qt's
source directory is.

Change-Id: I5e53135b6b628eb5e413b2c2b3b8721dae02b503
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Kalle Viironen <kalle.viironen@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2013-09-11 15:52:51 +02:00
Stephen Kelly
546d52e605 Add a convenient way to get a type-erased smart pointer from a QVariant.
Any known smart pointer in a QVariant can be handled in this way. The
metatype system can be informed of new smart pointer types using an
existing macro which is now documented.

This is very similar to the existing infrastructure
for containers.

Change-Id: Iac4f9fabbc5a0626c04e1185d51d720b8b54603d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 12:24:42 +02:00
Giuseppe D'Angelo
3256856bbe Remove qSort usages from QtConcurrent
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I07a8b13f75eb789c45a7c2ef11c0dc15d9fdf8f6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 12:24:33 +02:00
Giuseppe D'Angelo
f070b141b6 Remove qSort usages from QtTestlib
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I383d13f76eceae025daab5242f433f694c0149cd
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 12:24:26 +02:00
Mitch Curtis
e952f233e6 Fix echoplugin docs: Q_INTERFACES expects a space-separated list.
Task-number: QTBUG-25580

Change-Id: I736d5743b7901bf207c31795c96acc02fd149277
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-11 11:52:27 +02:00
Topi Reinio
0b9e39100b Doc: Add a dependency to qtdoc for qmake manual
qmake manual needs to be able to link to pages in qtdoc module,
for example, to information about Third Party Libraries.

Change-Id: I6ccaa0c3aecc54bd5d76c6b1573c797423048207
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-11 10:30:23 +02:00
Giuseppe D'Angelo
ca9d3f5753 Remove qSort from QVariantAnimation
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Ife76c249eb950e976c626acebbe00372ffc70df9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 10:30:23 +02:00
Giuseppe D'Angelo
dfa36cd65d Remove qSort usages from statemachines
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I6edaafa75348a4e8795c3e29eeea9c45c178b621
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 10:30:23 +02:00
Giuseppe D'Angelo
8c4323c74d Remove qCopy from QLinkedList / QVector
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I5f7c2a6b3588a07113061c018e2870f476bea5a7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-11 10:30:23 +02:00
Jędrzej Nowacki
ec846146b4 New QStringRef methods.
New functions left, right, mid were missing in the api.

Change-Id: I3590a84431555d009d5012b204c111385bdceed3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-11 08:06:21 +02:00
David Faure
aba336c2b4 QUrl: ensure that setPath("//path") doesn't lead to scheme://path
which would interpret 'path' as a hostname.
The check is in the public setPath so that the internal one can still
support parsing URLs such as ftp://ftp.example.com//path.

[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery]QUrl now
normalizes the path given in setPath, removing ./ and ../ and duplicate
slashes.

Change-Id: I05ccd8a1d813de45e460384239c059418a8e6a08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-11 01:26:07 +02:00
Thiago Macieira
8fa0e4d1d2 Add a simple test for QVariant carrying a QSharedPointer<QObject>
Change-Id: Ibe17355c7ed8d4af7fda6261d72cfd64779471a7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-11 01:26:07 +02:00
Sergio Ahumada
bcbec4bc49 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-09-10 23:22:23 +02:00
Richard J. Moore
507a7b4df9 Add missing notify signals for window title and icon changes.
Adds signals for changes to the window title, window icon and window
icon text.

Change-Id: Ia0ddcb94dda2c9ea790edc061d487765024191cd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-10 21:46:28 +02:00
Giuseppe D'Angelo
343f2b03f9 Fix the internal QDir sorting
If two items are equal according to the current sorting criterion,
the sorting predicate uses the address of the items to break the tie.
The problem is that the items themselves are being moved during
the sort; therefore, this will break the Strict Weak Ordering
that std::sort requires.

For instance, suppose to be sorting case-insensitively the following array:

   ("b", "a", "A")

Simulating a swapped-based sorting can lead to:

    Array before      Evaluated predicate      Array after
    ("b", "a", "A")   "a" < "A" (1)            ("b", "a", "A")
           ^    ^

    ("b", "a", "A")   "b" < "A" (2)            ("A", "a", "b")
      ^         ^

    ("A", "a", "b")   "A" < "a" (3)            (XXXXXXXXXXXXX)
      ^    ^

(1) True, because of the array ordering (they're equal otherwise)
(2) False: swap them
(3) True, because of the array ordering (they're equal otherwise)

(1) and (3) say that "a" < "A" and "A" < "a", SWO gets violated,
leading to undefined behavior.

This problem was causing QFileSystemModel autotests failures (cf. [1])
after switching to STL algorithms instead of using qSort.
The array to be ordered in that case is ("a", "c", "C"),
cf. tst_QFileSystemModel::caseSensitivity.

(STL algorithms are much smarter than good ol' quicksort in qSort;
if we're ordering on an array which fits in a cache line, they
turn to the much faster (~1 robe) insertion sort. Violating SWO with
a quick sort usually just gets to a non-sorted container; insertion
sort is implementable in ways that rely on SWO, otherwise they
will overflow the iterator; cf. Cormen/Leiserson/Rivest and the other
literature on the topic.)

This commit reverts commit fa5f3a44 (in Qt 4).

[1] http://testresults.qt-project.org/ci/QtBase_dev_Integration/build_01749/linux-g++_shadow-build_Ubuntu_11.10_x86/log.txt.gz

Change-Id: I5d8ac0d0907675c501717969abee2816b41eca18
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-10 21:23:50 +02:00
David Faure
3bd73dd91f QCommandLineParser: improve implementation
Based on feedback from Thiago.

Change-Id: I9a3ce0b90b5d1d680c66351d421874effbd426f8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:07:18 +02:00
David Faure
be3ff4176f QCommandLineParser: improve documentation
Based on feedback from Thiago

Change-Id: I8912447197e636732e5b8ac37e77d18b54e9b43d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:07:13 +02:00
David Faure
32fa8ab704 QCommandLineOption: improve runtime warnings
Change-Id: I48a278acf3a8eb0cfa829deb65cf65dfd8ec23af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:07:07 +02:00
David Faure
b508dc98a5 Port moc to QCommandLineParser
This required special care because of @option-file where additional args can be read from.

Found again one undocumented option, --ignore-option-clashes.

Usage: moc [options] [header-file] [@option-file]
Qt Meta Object Compiler version 67 (Qt 5.2.0)

Options:
  -h, --help               Displays this help.
  -v, --version            Displays version information.
  -o <file>                Write output to file rather than stdout.
  -I <dir>                 Add dir to the include path for header files.
  -F <framework>           Add Mac framework to the include path for header fil
                           es.
  -E                       Preprocess only; do not generate meta object code.
  -D <macro[=def]>         Define macro, with optional definition.
  -U <macro>               Undefine macro.
  -i                       Do not generate an #include statement.
  -p <path>                Path prefix for included file.
  -f <file>                Force #include [optional <file>] (overwrite default)
                           .
  -b <file>                Prepend #include <file> (preserve default include).
  -n <which>               Do not display notes (-nn) or warnings (-nw). Compat
                           ibility option.
  --no-notes               Do not display notes.
  --no-warnings            Do not display warnings (implies --no-notes).
  --ignore-option-clashes  Ignore all options that conflict with compilers, lik
                           e -pthread conflicting with moc's -p option.

Arguments:
  [header-file]            Header file to read from, otherwise stdin.
  [@option-file]           Read additional options from option-file.

Change-Id: I0dfa8e029f95ad8084832530d701e30f315df98e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:06:56 +02:00
David Faure
4ff6951550 Fix escape handling in qWinCmdArgs
-DKEY="VALUE" was correctly turned into -DKEY=VALUE,
but -DKEY=\"VALUE\" was turned into -DKEY=\VALUE"
due to the erroneous check ('quote' is still 0 when
encountering the first '\' character).

This fixes QCoreApplication::arguments() as used by
moc.exe after porting to QCommandLineParser.

Further investigation shows that double-quotes and single-quotes
are handled differently. The tests now ensure that this parser
respects what Windows sends in argv, and in particular that
QTBUG-15379 doesn't regress, as well as fixing QTBUG-30628.

Task-number: QTBUG-15379, QTBUG-30628

Change-Id: I95062c9a6022632b321b2f6fae3089f07be7b5c6
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-10 19:05:19 +02:00
Chris Meyer
04325bdd26 Fix Invalid Drawable error when using createWindowContainer on Mac.
You are not supposed to call NSOpenGLContext -setView: for a view that
has not yet called drawRect.  Doing this would result in a invalid
drawable error.

Similar to 4.8 commit cd2a51a66f

Change-Id: Ibb2300a8c6fe52f786f813987e93d4a3dc145366
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-10 16:14:33 +02:00