Commit Graph

10633 Commits

Author SHA1 Message Date
Marc Mutz
250190b39b QMap: don't dereference nullptr
root(), leftNode() and rightNode() can be nullptr.
These pieces of code happened to work because the first thing lowerBound()
does is

   Node *n = this;
   // ...
   while (n)
     // ...

But that is _after_ dereferencing nullptr, which is undefined behavior.

So, check first, then deref.

Change-Id: I9137bf6e21014cd68404a7e49a748910b1d768cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-17 09:31:25 +02:00
Kai Koehne
bc9c03a550 Remove mentioning of 5.0 Alpha from QPA Readme
While at it, I hope that qplatformtheme API's are stable
by now :)

Change-Id: I83bf3118c91608710bb19380458e8f55cb3d427b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-17 09:31:19 +02:00
Kai Koehne
03951bd3ff Fix name of argument in documentation
Change-Id: Ia137f75865390f4bbabd65c75ba81ac4bba93eba
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-17 09:30:54 +02:00
Thiago Macieira
cfa5c1698d Fix the C++11 and GCC-atomic intrinsics when not using GCC
Both Clang and ICC complain about the use of those atomics when used
with a forward-declared pointee. GCC doesn't, which makes me think
it's a GCC bug.

When using QBasicAtomicPointer<Foo> with these atomics, the _q_value
member causes the instantiation of QAtomicOps<Foo>, which causes the
instantiation of the regular member function
QAtomicOps<Foo>::fetchAndAddRelaxed. The problem is that function
takes a QAtomicAdditiveType<Foo>::AdditiveT as parameter, which
requires sizeof(Foo). Clang 3.3 and ICC 14 correctly expand and
complain. GCC 4.7-4.9 apparently don't.

The fix is to apply the same trick we used for the other atomics:
change all ops functions (including fetchAndAddRelaxed) to be member
templates. That way, they can't be expanded until the actual use.

Clang errors:
qgenericatomic.h:73:33: error: invalid application of 'sizeof' to an incomplete type 'QMutexData'
qatomic_gcc.h:136:48: note: in instantiation of template class 'QAtomicAdditiveType<QMutexData *>' requested here
qbasicatomic.h:272:22: note: in instantiation of template class 'QAtomicOps<QMutexData *>' requested here

ICC errors:
qgenericatomic.h(73): error: incomplete type is not allowed
    detected during:
      instantiation of class "QAtomicAdditiveType<T *> [with T=QMutexData]" at line 111 of "qatomic_cxx11.h"
      instantiation of class "QAtomicOps<T> [with T=QMutexData *]" at line 272 of "qbasicatomic.h"

Found-by: Tor Arne
Change-Id: I9b10648cd47109a943b34a4c9926d77cd0c4fe12
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-17 03:07:09 +02:00
Thiago Macieira
a33d9351a8 Remove useless code setting but not using variables
Clang 3.3 found a variable assigned to itself, probably to cause
GCC to shut up about a variable set-but-unused. So simply stop
assigning the value at all to this variable.

qxcbxsettings.cpp:155:16: error: explicitly assigning a variable of type 'uint' (aka 'unsigned int') to itself [-Werror,-Wself-assign]

Change-Id: I74ae8f724e87c1b3f6b9d358e13d6a440ff4a3e1
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-09-17 02:57:08 +02:00
Dario Freddi
76b06f993e QObject: allow connecting to functors with a receiver object
Up to now, it was only possible to connect to functors in a direct
way, without being capable of using Qt::ConnectionType. This patch
allows for specifying a receiver for Functors and function
pointers, hence making it possible to specify effectively the
connection type.

To do this properly, it was needed to add an enum in FunctionPointer
representing whether the considered function is a member function
or not, to reduce ambiguity upon overloaded calls.

Moreover, now senders are checked for the existence of a slot obj
as well. This way, should the context be freed, the slot obj and
the functor contained in it will be freed as well.

On a side note, connecting to a static slot
(like QCoreApplication::quit) specifying the receiver object is
now compiling.

Change-Id: I46474099413b1dc6ca4db9934191d469baeef070
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-16 23:46:30 +02:00
Tor Arne Vestbø
ae577e6b8f Don't use ARMv5/6/7 atomics on 64-bit ARM, as they are AArch32 specific
Change-Id: I0c359e62a8cbf560691019187f316561bddbee52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-16 23:19:26 +02:00
Tor Arne Vestbø
51da240149 Don't use Mac OS X QCollator backend on iOS
We don't have CoreServices on iOS, which hosts the UC* APIs.

Change-Id: I95b1b173e57665c2fc2cdc1701f8ad57cdc0e567
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-16 23:19:06 +02:00
Tor Arne Vestbø
410e9cd5b1 Add support for ARMv8/ARM64 to qprocessordetection.h
As used by the upcoming iPhone 5S' A7 SoC.

Change-Id: I276dc739c2565bce23fb1a12c9470dcd311e67ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-16 23:18:59 +02:00
Marc Mutz
15c384f82f QDateTime: fix unused function warning on non-Windows
Change-Id: I8fbf1f8b0ebfdf58cd72c724326227dc1610e746
Reviewed-by: John Layt <jlayt@kde.org>
2013-09-16 22:58:44 +02:00
Konstantin Ritt
36e768cd71 Un-export qt_registerFont() internal function
QPlatformFontDatabase::registerFont() method must be used instead.

Change-Id: I80aa5567a748a980f689c90125f8bcc20c304ee2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-16 20:25:06 +02:00
Alan Alpert
b674b15dff Add QFileSelector API
For easy cross-platform and cross-device UIs, automatic asset swapping
based on filename is being developed. This API provides the logic for
the swapping, so that applications can use it themselves with the same
logic as any automatic swapping done in application templates.

Selector set is initially minimal, aiming for just platform selection
and enabling a common selection mechanism for Qt platforms to use.

Change-Id: I219517d740fa7385e923a9e09cb7e241378f857a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-16 19:42:22 +02:00
Olivier Goffart
4b02585f30 Fix spelling in Q_STATIC_ASSERT in qobject_cast
Change-Id: Ibc2b1296bf7eb20e41c1af044797a9a026bed369
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-16 15:36:59 +02:00
Martin Smith
433f2315ac qdoc: Now reports duplicate page titles better.
Currently, qdoc reports duplicate pages, when it should be reporting
duplicate page titles. Sometimes the duplicate titles actually refer
to the same page, but often they are different pages with the same
title. This update changes the error message to better indicate that
two identical page titles were seen.

A further complication was that the qdoc warnings for these duplate
page title errors were useless when the duplicates were in different Qt5
modules, because the support for file location information in the qdoc
index files was inadequate. This update adds better location information
to each section in the index file. This makes the index files bigger
and will increase qdoc runtimes, hopefully not too much.

Task-number: QTBUG-33506
Change-Id: I35db3c5e1551b9ef748d63377e94453da80c1e26
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-16 15:35:33 +02:00
Tor Arne Vestbø
4bae7158d3 Don't send posted events from QWindowSystemInterface::sendWindowSystemEvents
The responsibility of sendWindowSystemEvents() is to process events from
the window system. Historially that logic was part of the QPA/QWS event
dispatcher, which naturally also sent posted events. Through refactoring,
the code at some point ended up in in the QWindowSystemInterface class,
still with the posting of events in place.

This resulted in QPA event dispatchers adopting a pattern of just calling
sendWindowSystemEvents(), as that would cover both posted and window system
events. Other event dispatchers would call sendWindowSystemEvents(), and
then use a base-class implementation from QtCore for processing events,
resulting in two calls to QCoreApplication::sendPostedEvents() per
iteration of processEvents(). This breaks the contract that processEvents
will only process posted events that has been queued up until then.

We fix this entanglement by removing the sendPostedEvents() call from
QWindowSystemInterface::sendWindowSystemEvents() and move it to the
respective event dispatchers. For some EDs it means an explicit call
to sendPostedEvents, while others were already doing sendPostedEvents
though a separate source (GLib), or using a base-class (UNIX/BB), and
did not need an extra call.

We still keep the ordering of the original sendWindowSystemEvents()
function of first sending posted events, and then processing any
window system events.

Task-number: QTBUG-33485
Change-Id: I8b069e76cea1f37875e72a034c11d09bf3fe166a
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-09-16 15:22:40 +02:00
Shawn Rutledge
4c19055cb1 remove unnecessary beginPaint and endPaint overrides
QPlatformBackingStore::endPaint does not take a QRegion parameter.
6ce6b8a378 set the API, but the
platform implementations were not all synced up since then.  There
was anyway no point in overriding beginPaint and endPaint on
platforms which don't need to do anything there.  This fixes
clang warnings of the form
QXcbBackingStore::endPaint hides overloaded virtual function

Change-Id: Id6cd0fc2c831a34576ac2c73eeb0d5741d26e622
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-16 15:21:40 +02:00
Andrew Knight
7d3f775075 WinRT: Disable PCRE JIT
That is what we do on on other "limited" platforms.

Change-Id: I608880698d60ab10ecbb2f3ce12ff6c5eaab7eed
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-09-16 12:23:46 +02:00
David Faure
aabbd27dda Simplify QFileSystemModel::remove by using QDir::removeRecursively
This also fixes it in case of hidden or system files, which
were missing from the filter (found by Denis Kovalskiy).

Change-Id: Ic12de12ec51c20de52d040514e90be5e783add43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-16 12:12:09 +02:00
Eskil Abrahamsen Blomfeldt
104debb662 Don't depend on QtQuick plugin in QtWidgets
The accessible plugins directory contains a QtQuick plugin
as well as a widgets plugin. We need to specify the correct
one to avoid all widgets applications implicitly depending
on QtQuick on Android.

Change-Id: I72b2ee4fcd2d7914fc2ed7996f504ce2df79842d
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2013-09-16 08:56:09 +02:00
Oliver Wolff
134a020e2a Implement windowsErrorString for WinRT
FORMAT_MESSAGE_ALLOCATE_BUFFER isn't available for WinRT

Change-Id: Ib9cf2a11a4e84f3ff010665bd53b4ffb0d0bfcce
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-09-16 00:14:00 +02:00
Oliver Wolff
cfc7cc39f9 qelapsedtimer for WinRT
Change-Id: Ic31fa667bdc746776d8e29564ea8a1ba6e7384f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-15 22:41:48 +02:00
Nicolás Alvarez
1985f818e7 Fix QTextEngine build on MSVC2008 debug mode.
This was broken in 7ac6ce21 which removed some unused functions;
but MSVC2008 in debug mode requires this particular operator overload.
I'm re-adding it in an appropriate #ifdef so it doesn't cause "unused"
warnings in other platforms/compilers.

Task-number: QTBUG-33473
Change-Id: I6dfba0fa5f835e848e8a1e4213efb030fb5def3d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-09-15 19:51:50 +02:00
Oliver Wolff
fee7420a73 Fixed sqlite build for WinRT
Change-Id: Idf5bfa8b55e8d7db46207e55de1e9176def503a6
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-15 16:13:49 +02:00
Giuseppe D'Angelo
f4cc344e01 Revert "Reimplement qBinaryFind in terms of std::lower_bound"
After a bit of discussion, we should actually deprecate qBinaryFind too.
This puts the old code back (to avoid behavior changes / source
breaks).

This reverts commit 23d7f6ee5d.

Task-number: QTBUG-33473

Change-Id: I7f7d25171e14061e51543c501c30a7b6b184a8fd
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-14 23:43:00 +02:00
Olivier Goffart
7d7e8ae3fa Use Q_STATIC_ASSERT to report error about missing Q_OBJECT
Q_STATIC_ASSERT gives better error with C++11 enabled.

Aslo the qt_check_for_QOBJECT_macro had warning on some compiler since
it used null reference

Change-Id: Ic6115da800064b00c50a5762f0b79f5f656bf750
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 20:33:29 +02:00
Thiago Macieira
6b9d125621 Do 64-bit loops in QBitArray::count(bool)
On 64-bit platforms, with unaligned loads, this is defintely an
improvement since we can run fewer instructions. On 32-bit platforms
with unaligned loads, we'll do the exact same number of loads. On
platforms without unaligned loads, it's no worse.

Change-Id: Idd5dd5213975d77bbc3adf486adbf6f8ef071341
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-14 20:33:29 +02:00
Thiago Macieira
6f0fdaa76c Let the compiler do the unaligned loads in QBitArray::count(bool)
For platforms where the CPU can do unaligned loads on its own, like
x86, the compiler will generate actual loads. On other CPUs, it will
do the byte-by-byte load like we were doing. The compiler cannot
generate worse code than our hand-rolled load, so this change can only
improve performance.

Change-Id: I32a89e64aa64d8af504be6c5a10b04d7573cdb98
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-14 20:33:29 +02:00
John Layt
6c3a9df3fe QDateTime - Store Qt::TimeSpec, remove Daylight Status
Change storing the spec from QDateTimePrivate::Spec to Qt::TimeSpec.

Remove the storage and use of the Daylight Status as it is almost
never set or used, and would be inaccurate if the tz were to change.
It will be replaced later with proper daylight transition support.

This simplifies the code and makes the msecs storage change easier.

Change-Id: I78a70905025d7eddf1c2dc6001f6b490e5a2b3b8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 18:31:00 +02:00
John Layt
e76c312eb8 QDateTime - Switch to using msecs based functions
A number of QDateTime functions directly use or modify the data stored
in the private, but future changes to store msecs and status make this
maintenance more complicated.  Where possible simplify this code to use
the standard msecs functions, standard constructors, or public api
instead.  This greatly simplifies the functions and the following msecs
storage code changes.

This is an intermim step towards storing the time in msecs.  Some
functions will be slower as a result of this change, optimization
will take place after all the msecs changes are completed.

Note this also removes a test that used valid QDates outside the range
of msecs, this change in behavior will be documented in the final
mscs change.

Change-Id: I6ef710f24babc7024091010064082e9be0b5bbfe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 18:31:00 +02:00
Andrew Knight
f6e6dde369 winmain for winrt
WinRT passes the executable and Appx server info to the CRT main, and
supports several additional activation arguments as well. This handles the
arguments passed to main as well as the case where a modern app is
launched from an external application (e.g. Qt Creator).


Task-number: QTBUG-30198
Change-Id: Ia843e98c7843d5705f5f6d1c809de0b6bcdb5d26
Done-with: Kamil Trzcinski
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-09-14 15:42:24 +02:00
Konstantin Ritt
0adc96c1c4 Drop leftovers after 02651060b6
Change-Id: I011359a47ed47308a7d25e306fbf45a83a3a5715
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-09-14 08:06:46 +02:00
Konstantin Ritt
3e025708b4 Fix build with -Werror
The actual warning is:
src/gui/text/qharfbuzzng.cpp:589:67: error: cast from ‘void*’ \
to ‘uint {aka unsigned int}’ loses precision [-fpermissive]

Change-Id: I75cc7bad2147cd5e5e7c17bc22fe613280e86755
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-14 05:17:07 +02:00
Thiago Macieira
504a644862 ICC 13.0 supports atomics
See http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler

Change-Id: I45ba6aa640f82df4d06fd4412264892bfd58ffc3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-14 03:20:25 +02:00
Thiago Macieira
cc74159702 Base64: Implement the "base64url" encoding and the stripping of '='
The "base64url" encoding is defined in RFC 4648, which is the newest
version of Base64. There are also a few situations where the ending
'=' is not desired.

Change-Id: I9bb9fa55817b57d125189e4e795d6fde97caea6d
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-09-14 03:20:25 +02:00
Thiago Macieira
3154e1ccaa Whitespace: re-indent the {to,from}Base64 functions
The code must have been copied from somewhere, a sample
implementation.

Change-Id: Ieb6ac5d69824fe8a3f38710a22beb79ac986e182
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-09-14 03:20:25 +02:00
Sergio Ahumada
415f65fbff Merge "Merge branch 'stable' into dev" into refs/staging/dev 2013-09-14 01:11:43 +02:00
Thorbjørn Martsum
62fbf3ca6f QMessageBox - move margins to a left spacer
This patch moves labels indent and contents margins into a
left spacer, and it only puts the iconLabel in the layout
if there is an icon.

Change-Id: I6f3563a08fc15ec6ec267e095adf1734f7828355
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-09-13 22:06:26 +02:00
John Layt
92b0a7fa3e QTime - Add public api for get/set msecs since start of day
Add new public api to get and set the number of msecs since the start
of the day.  Modify QDateTime to use the new msecs api.

[ChangeLog][QtCore][QTime] Added new methods fromMSecsSinceStartOfDay()
to create a new QTime from an msecs value, and msecsSinceStartOfDay()
to return the QTime as the number of msecs since the start of the day.

Change-Id: I285b725b883f1f5524fda87ca81bd64ed99fe6f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-09-13 22:06:26 +02:00
hjk
63a382a930 Add a static QFileInfo::exists(fileName) function
This avoids dynamic construction of the private class. According to
the benchmark we go from 4,550 to 3,900 instruction reads per iteration.
(without change 32629676 the baseline is 5,600)

Change-Id: I5df925e30dbd49bdde87173e481820574ce5abe1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-13 19:37:51 +02:00
hjk
4c709fb391 Add a note on symlink behavior of QFile::exists
Change-Id: I41ede0536f1b7093a7cde3d74a5e221df413aeea
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-13 19:37:14 +02:00
Thiago Macieira
aef44c7970 Don't use an extension to the C++ language in public headers
According to Clang 3.3, this is an extension:
qpalette.h:178:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types]
qsizepolicy.h:148:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types]

If you try to simply give the struct a name, it complains with:
qpalette.h:178:16: error: types cannot be declared in an anonymous union

Change-Id: I61c69b8e42a1f4c4a15a0733f2d7efa0b3e44864
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-09-13 19:12:09 +02:00
Thiago Macieira
c1c715f800 Optimize QBitArray::count(bool)
Ever since 76e0223619, qPopulationCount
was extracted from QBitArray and moved elsewhere. That unfortunately
meant that the 24-bit loads are completely useless, since
qPopulationCount always operates on 32 bits.

Instead, do a full loop on 32-bit and then do 16-bit and finally 8-bit
(for which there are qPopulationCount overloads).

Change-Id: If945609f075095257d12877c39434909ac190e54
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-13 19:11:48 +02:00
Thiago Macieira
d7e424ee66 Remove unused QPF font engine support.
QWS is gone.

Change-Id: Ic04c4dcfff51522dd538bf2cb198dc2e02fe7572
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
2013-09-13 19:10:31 +02:00
Paul Olav Tvete
07538de8b1 Make nativeOrientation available in the public API
The QtSensors module defines the coordinate system relative to
QPlatformScreen::nativeOrientation(). However, that is not part
of the public Qt API.

Task-number: QTBUG-32144

Change-Id: I6941c5b8589219064749f18880775b803f23fbbd
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-13 19:08:27 +02:00
Sergio Ahumada
f7837e28b5 Merge branch 'stable' into dev
Conflicts:
	src/concurrent/qtconcurrentmedian.h
	src/corelib/itemmodels/qabstractitemmodel.cpp

Change-Id: Iac46a90bbb2958cef7670031a4b59c3becd8538a
2013-09-13 18:04:17 +02:00
Laszlo Agocs
52e38509c6 Fix QWindow::moveEvent documentation
It handles window movement events, not mouse move events.

Change-Id: Ibc8fd0272756fcf87dfac210addbf2f87cfb39d5
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-09-13 16:54:35 +02:00
Giuseppe D'Angelo
549c3248ec Remove qFill usages from uic
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I58d0c78609381b20ffe8a68e36c8216689362ed5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 16:53:14 +02:00
Stephen Kelly
8b0624182b MetaType: Fix operator{+,-}(int) with the type-erased const_iterators.
Make sure we don't modify the lhs. Instead copy it and advance the
copy.

Change-Id: I3440e8e175bfc299f8f83b816faca54fa3f79e43
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 14:37:41 +02:00
Stephen Kelly
a9770c4b6c Remove some unneeded constructors.
Change-Id: I34f86960dc0cfaada509957bca5466b2765e8239
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 14:37:32 +02:00
Martin Smith
93d7ee0da3 qdoc: Eliminate duplicate page warnings in some cases
Prevent qdoc from reporting duplicate pages for external pages with
the same URL and title.

Task-number: QTBUG-33462
Change-Id: Idabdb241aaa4fe105f7b3ea78229ff1ae8776ecf
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-13 14:09:56 +02:00
Tor Arne Vestbø
59601e06d9 iOS: Interleave Qt application main() with iOS startup sequence
Our previous event loop integration had two unfortunate flaws:

  1. We would call qt_user_main() from a timer, after returning from
     didFinishLaunchingWithOptions. This had the effect of showing the
     iOS application window long before the Qt application UI had been
     set up, resulting in a 1-2 second flash of black/pink between the
     launch image disappearing and the actual application showing.

  2. We spun a nested event loop, where our implementation of the
     different event loop modes did not perfectly match the Apple
     implementation. This resulted in scrolling being busted in
     some cases such as when showing the virtual keyboard for
     Emoji characters.

These two issues have now been solved by calling the user's main()
from didFinishLaunchingWithOptions. Normally this would not work, as
the user's main would call QApplication::exec() at the end of their
main(), which would block and we would never return back from the
didFinishLaunchingWithOptions callback, resulting in no UI on screen.

We work around this by longjmp'ing out of QApplication::exec(), back
into didFinishLaunchingWithOptions, so that it can return. Again,
this would normally not work, as the call stack where QApplication
and friends would live would get smashed as the application
continued executing. We work around this by allocating a block
of stack space at the start of main(), which we then redirect the
stack pointer to before calling the user's main. This results in
the whole stack of the user's main() and below being preserved, even
if we longjmp out of the call stack (which then restores the
stack pointer).

This approach should work fine together with garbage-collection as
well, since the mark-and-sweep phase will walk the stack from the
stack pointer to the stack base, including sections of the stack
that were part of qt_user_main() and live in the reserved area.
One case where GC will fail though is if it happens as part of the
qt_user_main() call, where the GC will not mark anything in the
'real' callstack below UIApplicationMain(), but this is not
expected to happen.

The size of the reserved stack can be controlled through the
Info.plist key 'QtRunLoopIntegrationStackSize', as well as the
'QtRunLoopIntegrationDisableSeparateStack' key to disable the
separate stack approach completely. This will fall back to the
old approach. The amount of stack space used by the user's
main can be determined by enabling a special debugging mode,
using the 'QtRunLoopIntegrationDebugStackUsage' key.

Change-Id: I2af7a6cfe1a006a80fd220ed83d8a66d4c45b523
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-09-13 14:08:44 +02:00
hjk
52b827d11b Fix typo in note on symlink behavior of QFileInfo::exists
Change-Id: Iacd957cd9cd04e9153efd826bb42d872f8963f75
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-09-13 14:07:02 +02:00
Giuseppe D'Angelo
1119eb5742 Remove qSort usages from qdoc
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I419d767ea18944917888037899e6ececdb014e82
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2013-09-13 13:53:55 +02:00
Giuseppe D'Angelo
173ce3ab93 Fix Strict Weak Ordering in qdoc's comparator
If both n1 and n2 are "Private", the comment says they're equivalent,
but the function is actually stating that n1 < n2 AND n2 < n1.

Change-Id: I8e30b32c1e5240551ab1808baf6fc476841dfde4
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2013-09-13 13:53:53 +02:00
Giuseppe D'Angelo
76ef6aac6a QDoc: properly initialize a member
Spotted by valgrind:

==14189== Conditional jump or move depends on uninitialised value(s)
==14189==    at 0x47B3FD: DocParser::parse(QString const&, DocPrivate*, QSet<QString> const&, QSet<QString> const&) (doc.cpp:1627)
==14189==    by 0x4818AC: Doc::Doc(Location const&, Location const&, QString const&, QSet<QString> const&, QSet<QString> const&) (doc.cpp:2755)
==14189==    by 0x4E6C3D: PureDocParser::processQdocComments() (puredocparser.cpp:140)
==14189==    by 0x4E6A9E: PureDocParser::parseSourceFile(Location const&, QString const&) (puredocparser.cpp:109)
==14189==    by 0x4D2E4C: processQdocconfFile(QString const&) (main.cpp:473)
==14189==    by 0x4D3B3C: main (main.cpp:656)
==14189==  Uninitialised value was created by a heap allocation
==14189==    at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14189==    by 0x474378: DocPrivate::constructExtra() (doc.cpp:415)
==14189==    by 0x47B975: DocParser::insertTarget(QString const&, bool) (doc.cpp:1676)
==14189==    by 0x476B52: DocParser::parse(QString const&, DocPrivate*, QSet<QString> const&, QSet<QString> const&) (doc.cpp:956)
==14189==    by 0x4818AC: Doc::Doc(Location const&, Location const&, QString const&, QSet<QString> const&, QSet<QString> const&) (doc.cpp:2755)
==14189==    by 0x4E6C3D: PureDocParser::processQdocComments() (puredocparser.cpp:140)
==14189==    by 0x4E6A9E: PureDocParser::parseSourceFile(Location const&, QString const&) (puredocparser.cpp:109)
==14189==    by 0x4D2E4C: processQdocconfFile(QString const&) (main.cpp:473)
==14189==    by 0x4D3B3C: main (main.cpp:656)

Change-Id: I5c50c6611a1d901cc19d12bc3757977c36b2a73b
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2013-09-13 13:53:50 +02:00
Morten Johan Sørvig
44a58de2ae Fix highdpi CE_HeaderLabel pixmaps in fusion style
Make sure enough pixels is sourced by multiplying
the layout rect size with the pixmaps devicePixelRatio.

Task-number: QTBUG-31477

Change-Id: I742603c09a65a520587da3eef9479ef7f0c87022
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-13 13:45:43 +02:00
Richard Moe Gustavsen
31b4461097 moc: add -M<key=value> to ease static qml plugin linking
A module plugin in qml belongs to a URI/namespace. This
uri is resolved run-time by QtDeclarative by knowing the
path of the qmldir that references the plugin.
For static plugins this becomes a problem, since we lost
the information regarding which plugin belongs to which
qmldir, since a static plugin has no file path.

To avoid pushing the responsibility of clarifying this
onto the application developer, it is better to embed this
information into the meta data of the plugins themselves.
Since this information can be resolved by the
build system, a new option to moc has been added:
-M<key=value>
that will let you add meta tags to the meta data from
the command line to each class that has an IID specified.
For the URI case, we can then e.g do:
-Muri=QtQuick.Controls -Muri=QtQuick.Controls.Private

Change-Id: I81a156660148fc94db6f3cac0473e9e1c8458c58
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 11:48:08 +02:00
Shawn Rutledge
209a5f1e8d Adding QPlatformMessageDialogHelper and QMessageDialogOptions
We plan to add support for native message/alert dialogs on Android
and iOS because it's otherwise impossible to have a true popup window.
Then we might as well have native message/alert dialogs on other
platforms too.  It will become an alternative implementation behind
QMessageBox and perhaps QErrorMessage.

Task-number: QTBUG-30883
Task-number: QTBUG-29462
Change-Id: I73dcfc6438e696189b6d37091874c7ad69b4ec68
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-09-13 11:47:06 +02:00
Teo Mrnjavac
060b862b61 Bring back Qt4 X11 session management functionality.
Added QXcbSessionManager to the Xcb plugin.
QXcbSessionManager inherits from QPlatformSessionManager, it's a port of
QSessionManager as it is in Qt 4.8.
Minor changes also in QPlatformSessionManager and QGuiApplication to
hook it up.

Task-number: QTBUG-28228
Task-number: QTBUG-30011
Task-number: QTBUG-33033
Change-Id: I50b33d05a1e32c5278dea339f693713acc870a70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2013-09-13 11:47:06 +02:00
Thiago Macieira
f4ebb06189 Remove Q_PACKED from structures that do not need to be packed
These structures do not need to be packed. With some compilers, Q_PACKED
was defined to be empty, which means that the code was working fine
without packing. Or there were some lingering problems on those
platforms (MSVC) and we're now exposing them in all platforms.

Actually, it shouldn't be a problem anywhere. QCharAttributes, quint24
and QFontEngineQPA::Glyph have only char/uchar members, so they're
packed already (they have alignof == 1). The only platform where that
wasn't true was ARM OABI, which we don't support anymore.

QFontEngineQPA::Header seems to always come from a QByteArray, so it
doesn't neeed to be packed either. However, just to be sure, I'm
inserting a check for alignment.

And QFontEngineQPA::Block isn't used anywhere.

Change-Id: Iacfa25edf336ef2a03aeb6e40ae90937a21661ae
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-13 11:47:06 +02:00
Thiago Macieira
be8a76cffe Remove the empty definition of Q_PACKED
Structs defined with Q_PACKED *need* to be packed in all
platforms. Having an empty define means errors might go unnoticed for
a long time.

Change-Id: I9c388358fed27a8e018465f05375e4bbbee3484c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 11:47:06 +02:00
Thiago Macieira
9cff511eb8 Remove Q_NO_PACKED_REFERENCE
Leftover. It's not used anywhere.

Change-Id: I023a390d84c9ed5dacd2699145f183e8a2317153
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 11:47:06 +02:00
Marc Mutz
48586b2bac QTest: use nth_element to calculate the median
Sorting is O(NlogN) complexity, while nth_element is linear.

Change-Id: Ic6596affe183494e87abe7bdaa7c9985f5b7cd58
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 11:47:06 +02:00
Marc Mutz
12bd604f24 QtConcurrent::Median: add some qMove()
In case this code is ever instantiated with a type that actually benefits from moving.

'value' is save to move since it was passed to the function by value.
'*mid' is save to move since it originates in a container that will be
 discarded on the next line anyway.

Change-Id: I13587be10974ba6cf95d56e0f8912ff88167b60b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 11:47:06 +02:00
Laszlo Agocs
16a52882e7 Push updates to the QPA cursor even when a modal window is shown
Call QPlatformCursor::pointerEvent() even when the mouse event is
stopped due to being blocked by a modal window. This is necessary for
relatively dumb platforms, like eglfs, because the mouse cursor is
expected to be functional across the entire screen regardless of
having a modal dialog shown.

Platforms where the cursor is handled by the system (xcb, windows,
etc.) are not affected as they don't implement pointerEvent() anyway.

Change-Id: I4996ca0db23eb7f6ca3e2432d8d7abb1a5113dca
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-13 09:22:42 +02:00
Laszlo Agocs
e013eba203 eglfs: Set swap interval only when there is a context available
Mesa does not like eglSwapInterval calls without a current context.

Change-Id: I7ec2d4311586cf74da0461bc951a0e5d9399c35b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-13 09:22:18 +02:00
Jędrzej Nowacki
5fd344389e Remove redundant checks in some tools classes
This is a simple optimisation allowed to us by the fact that all platforms
we run on use two's complement for the signed integers. The trick works as
long as one of the two signed integers is known beforehand to be
non-negative:

 - by definition, for any signed integer i, i <= INT_MAX
 - by definition, for any unsigned integer u, u >= 0
 - given a signed integer x >= 0, 0U <= uint(x) <= uint(INT_MAX)
 - therefore, given another signed integer y of whatever
   value, uint(x) < uint(y) ←→ x < y && y >= 0

The trick is an optimisation because the compiler doesn't know that one of
the two sides is always non-negative. Otherwise, it would do the
same optimisation.

Change-Id: If256ec0df4e06335805af8010bb67ce5fd3e065a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-13 09:22:15 +02:00
Laszlo Agocs
a26f47756b eglfs: Handle desktop and multiple windows gracefully
When trying to create more than one window, stop with a helpful error
message since this is not yet supported. Also, return a fake WId for
desktop windows.

Change-Id: I9859b62b1d4f6b6142982d2e5a90afc1fc3c6a28
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-13 09:22:13 +02:00
Jędrzej Nowacki
348b641fee Add assert if a global static is used after deletion.
Q_GLOBAL_STATIC accessor is documented to return dangling pointer if
called after destruction.

Change-Id: Ieafd5619b20ad256d9d5ad007d939f1430ef681f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-13 09:21:42 +02:00
Laszlo Agocs
a02e430db9 eglfs: Avoid glUniform calls with wrong type when drawing the cursor
It is not really fatal but fixing it gets rid of a Mesa warning.

Change-Id: I3045b2691e7457541d6524c3e3ff8a1882ca460b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-13 09:21:39 +02:00
Thiago Macieira
23e89956c1 Fix new warnings under Clang 3.3
Probably added by a1898f4466.

qmetatype.h:70:29: error: inline function 'qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>' is not defined [-Werror,-Wundefined-inline]
qmetatype.h:1363:30: note: used here
            const int toId = qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>();

qmetatype.h:70:29: error: inline function 'qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>' is not defined [-Werror,-Wundefined-inline]
qmetatype.h:1386:30: note: used here
            const int toId = qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>();

Change-Id: I9afe1a3d50ab23eb701797e28b259966dc95a147
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-13 07:20:40 +02:00
Aleix Pol
1864b485e4 Make QCollator more flexible to use in different platforms
So far we've known that we want QCollator as public API. It hasn't
been possible yet due to the strong dependency that QCollator used
to have on ICU.

This patch adds collation support for the platforms where ICU is not
the best option by using native collation API. Namely Windows and
Mac OS X.

Additionally a fallback POSIX back-end is added, so that we can make
sure it will work on any posix-compliant platform.

Change-Id: Ia1734acbf5f596698a81f2af927cc15636e4c908
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-13 05:48:10 +02:00
Aleix Pol
c517a6d6ff Refactor QCollator to be able to use it in different platforms
Propose the API to be changed so that we can implement QCollator in the
different platforms where Qt is available.

Change-Id: I7b3e933d7e3d1aa26c1b78d21ef75b71c692827f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-13 05:47:55 +02:00
Lars Knoll
ec64d514fb Make the QCollator class public
The class missed the feature freeze for Qt 5.0, but has been ready
for quite a while. So make it public in time for Qt 5.2.

Change-Id: I9ac3f579ff5e371925fad40684762fff7ee4abd8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 05:47:37 +02:00
Konstantin Ritt
ff0fdc0462 Warn if OpenType support missing for script of interest
Change-Id: I076cfc5244ca3c060fd005cc3fbf30b357604bc7
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-13 02:29:10 +02:00
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
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
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