qt:qtbase.git
4 years agoIntroduce QTextDocument::baseUrl
J-P Nurmi [Sun, 1 Sep 2013 21:34:20 +0000 (23:34 +0200)]
Introduce QTextDocument::baseUrl

Required for QQuickText & friends to implement image resource handling
in a clean way - to get rid of QQuickTextDocumentWithImageResources and
eventually make QQuickTextEdit's document interchangeable.

Change-Id: I97314a6c3e2d5726539d5722795a472631388cb0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
4 years agoClean up common winrt/winphone mkspec
Oliver Wolff [Thu, 24 Oct 2013 09:56:47 +0000 (10:56 +0100)]
Clean up common winrt/winphone mkspec

Change-Id: I010bf977e01fab2f39184bbe730ec70128cc2982
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
4 years agoqmake: Support MSVC2013 for WinRT builds
Andrew Knight [Thu, 24 Oct 2013 17:14:10 +0000 (20:14 +0300)]
qmake: Support MSVC2013 for WinRT builds

Change-Id: I1c102f0b029616997d72933a90c0f9a2a3a9e222
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
4 years agoWinRT: Added msvc2013 mkspecs
Oliver Wolff [Thu, 24 Oct 2013 09:56:12 +0000 (10:56 +0100)]
WinRT: Added msvc2013 mkspecs

Change-Id: I052f6ba19056e7c0df6d7ea5548eb4dac4db125e
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
4 years agoMerge remote-tracking branch 'origin/stable' into dev
Frederik Gladhorn [Thu, 24 Oct 2013 10:48:39 +0000 (12:48 +0200)]
Merge remote-tracking branch 'origin/stable' into dev

Change-Id: Ie56539b2e0be611a363b5f15ae5412a78d6945a2

4 years agoReserve some space for future use in QLoggingCategory
Kai Koehne [Wed, 9 Oct 2013 12:19:53 +0000 (14:19 +0200)]
Reserve some space for future use in QLoggingCategory

Currently Qt offers only debug, warning, critical message types for
general use. Most logging frameworks offer more ... let's save
some space for future message types.

Change-Id: Icb4333da5c8f5277fd10d8a01b06d95369662bdc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
4 years agoRemove doc references to non-existing functions in QSurfaceFormat
Sean Harmer [Wed, 23 Oct 2013 10:54:36 +0000 (11:54 +0100)]
Remove doc references to non-existing functions in QSurfaceFormat

Change-Id: I5a9de5b719e111e47a1ea7334609695f1db6149a
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
4 years agoBlackBerry: improve BPS event lifetime management
Jonathan Hoffmann [Fri, 13 Sep 2013 18:05:35 +0000 (14:05 -0400)]
BlackBerry: improve BPS event lifetime management

In QEventDispatcherBlackberry::select(), if an event handler called
through filterEvent() starts a nested event loop by creating a new
QEventLoop, we will recursively enter the select() method again.
However, each time bps_get_event() is called, it destroys the last
event it handed out before returning the next event.  We don't want it
to destroy the event that triggered the nested event loop, since there
may still be more handlers that need to get that event, once the
nested event loop is done and control returns to the outer event loop.

So we move an event to a holding channel, which takes ownership of the
event.  Putting the event on our own channel allows us to manage when
it is destroyed, keeping it alive until we know we are done with it.
Each recursive call of this function needs to have it's own holding
channel, since a channel is a queue, not a stack.

However, a recursive call into the select() method happens very rarely
compared to the many times this method is called.  We don't want to
create a holding channel for each time this method is called, only
when it is called recursively.  Thus we have the instance variable
d->holding_channel to use in the common case.  We keep track of
recursive calls with d->loop_level.  If we are in a recursive call,
then we create a new holding channel for this run.

Change-Id: Ib3584676d2db5a9a3754a1535d5fb6c9e14f5dbb
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
4 years agoRename BlackBerry arm mkspecs to be aligned with NDK structure
Wolfgang Bremer [Tue, 22 Oct 2013 14:18:11 +0000 (16:18 +0200)]
Rename BlackBerry arm mkspecs to be aligned with NDK structure

The current NDK uses CPUVARDIR variable to define whether x86 or armle-v7 is used.
Therefore, the whole structure uses these two definitions to separate simulator
and device builds. Renaming blackberry-armv7le-qcc to blackberry-armle-v7-qcc
allows to directly use CPUVARDIR during Qt5 builds.
For compatibility reasons the old folder is kept and includes the new qmake.conf.

Change-Id: Ia7feeeabe16eda48140a65178af28cbb9bd085a9
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
4 years agoWindows: Handle WM_SYSCOLORCHANGE as theme change.
Friedemann Kleint [Wed, 23 Oct 2013 13:41:27 +0000 (15:41 +0200)]
Windows: Handle WM_SYSCOLORCHANGE as theme change.

Task-number: QTBUG-34170

Change-Id: I6ca11ab67c1e2752300fc167fb8f3c4f0d9ae2b8
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
4 years agoFix crash in QXcbDrag.
Friedemann Kleint [Wed, 16 Oct 2013 12:17:28 +0000 (14:17 +0200)]
Fix crash in QXcbDrag.

handleStatus() was called with drag==0 when releasing the mouse over the
desktop.

Task-number: QTBUG-33920
Change-Id: I553647d1e734934b7c6caf4c984683cff88f9162
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
4 years agoFix typo in check for MINGW_W64 version
Kai Koehne [Wed, 23 Oct 2013 13:25:11 +0000 (15:25 +0200)]
Fix typo in check for MINGW_W64 version

Got introduced in 9b187bcd6a256b53cc2fb85500

Change-Id: I1d713f8309d3d8568ea836cc1d29f9dca685ac01
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
4 years agoDoc: Added a link to the Qt Quick Test page
Venu [Tue, 22 Oct 2013 15:15:25 +0000 (17:15 +0200)]
Doc: Added a link to the Qt Quick Test page

Task-number: QTBUG-33316
Change-Id: Ib8c479837cac4b7cca47b979cbb2dad0aaae6412
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
4 years agoQFileDialog can delete files too, not just directories
Shawn Rutledge [Wed, 23 Oct 2013 10:22:58 +0000 (12:22 +0200)]
QFileDialog can delete files too, not just directories

After Ic12de12ec51c20de52d040514e90be5e783add43 this functionality
was broken.  Added an autotest.

Task-number: QTBUG-34159
Change-Id: I8f41b7073dc57fea855ab87796f09e8a91520d13
Reviewed-by: David Faure <david.faure@kdab.com>
4 years agoDon't crash if the platform plugin is not initialized
BogDan Vatra [Thu, 17 Oct 2013 13:48:02 +0000 (16:48 +0300)]
Don't crash if the platform plugin is not initialized

Change-Id: I999411816192edbd2bf40c6bda92d6e94fb3d1b0
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
4 years agode-duplicate QT_MODULES
Oswald Buddenhagen [Mon, 21 Oct 2013 20:07:00 +0000 (22:07 +0200)]
de-duplicate QT_MODULES

Change-Id: I8f1bf08070abb1ba05a4fdb14e7de9e7da5b3ec7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
4 years agoreturn()-related break() insanity is not necessary in qt5
Oswald Buddenhagen [Mon, 21 Oct 2013 14:45:15 +0000 (16:45 +0200)]
return()-related break() insanity is not necessary in qt5

Change-Id: I593c7160e44d51d25dee76c56c2e5580345ab42a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
4 years agodon't suggest to use qtAddModule(), it's internal API
Oswald Buddenhagen [Mon, 21 Oct 2013 14:43:43 +0000 (16:43 +0200)]
don't suggest to use qtAddModule(), it's internal API

Change-Id: Idf01d0dd74a0708014b7fca33611535c604a75f9
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
4 years agoFix deploy mechanism.
BogDan Vatra [Tue, 15 Oct 2013 10:35:58 +0000 (13:35 +0300)]
Fix deploy mechanism.

The order of "android:value" and "android:name" attributes can be changed when
saving the XML document. Use placeholders instead.

Change-Id: I9a97bb0df2d2d16c8a9443a21ce7d3290e0ab466
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
4 years agoMove untranslatable stings to AndroidManifest.xml
BogDan Vatra [Tue, 15 Oct 2013 06:07:42 +0000 (09:07 +0300)]
Move untranslatable stings to AndroidManifest.xml

strings.xml file is used to store strings that can/should be internationalized.

Change-Id: I2fc305b6917752e9f502bd4beb172205ba4f9fba
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
4 years agoRely on isLayered() to decide layering
Gunnar Sletta [Wed, 23 Oct 2013 07:57:59 +0000 (09:57 +0200)]
Rely on isLayered() to decide layering

The logic here was a bit broken. Every QWindow has an opacity
which is 1 by default so the expose was hit for every single
window, regardless of it being layered or not.

Change-Id: I04873cd5db1cd147708e7de140f5947d3a01e9e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
4 years agoFix misaligned selection region with text when centered
Jonathan Liu [Tue, 22 Oct 2013 13:28:17 +0000 (00:28 +1100)]
Fix misaligned selection region with text when centered

If the text is centered, the x/y position in the selection QRectF may
be a multiple of 0.5 which is rounded up. This rounding causes
misalignment of the selection region with the text.

The alignment is fixed by using qFloor on the x and y components.

Task-number: QTBUG-34218
Task-number: QTBUG-34234
Change-Id: I4f2fadeb38602f62a93773c6e5faecf03b28069f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
4 years agoAndroid/LinuxFb: fix QWidget::showFullScreen()
Paul Olav Tvete [Tue, 22 Oct 2013 12:06:29 +0000 (14:06 +0200)]
Android/LinuxFb: fix QWidget::showFullScreen()

Previously, showFullScreen() had a race condition: it depended
on QFbScreen::setGeometry() being called after the window state was
set (that would trigger QPlatformScreen::resizeMaximizedWindows(), which
was the only part of the code that reacted to WindowFullScreen).
On Android this caused random behaviour.

Task-number: QTBUG-33294
Change-Id: I228e6af4139af1a47387e7d80757d7b46e859580
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
4 years agoAndroid: Make platform menu more robust
Paul Olav Tvete [Tue, 22 Oct 2013 15:57:46 +0000 (17:57 +0200)]
Android: Make platform menu more robust

Don't crash and lock up the whole device when people try to
remove menu items that don't exist.

Task-number: QTBUG-34246
Change-Id: I4396d252c5af93e021c9e218dbab7c0e7f190d9d
Reviewed-by: BogDan Vatra <bogdan@kde.org>
4 years agoQTextHtmlParser: restore the default link color from app palette
J-P Nurmi [Tue, 22 Oct 2013 15:00:45 +0000 (17:00 +0200)]
QTextHtmlParser: restore the default link color from app palette

The default link color used to be resolved to the link color of the
application palette, but got lost during the Qt 5 modularization (see
commits 7351a43 and 3f9a7f9).

Task-number: QTBUG-28998
Change-Id: I7f07427f6c03f83c557100938ad9f7a39349d303
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
4 years agoFix a bug in QSqlQuery::isNull documentation
Tasuku Suzuki [Sat, 21 Sep 2013 06:23:16 +0000 (15:23 +0900)]
Fix a bug in QSqlQuery::isNull documentation

the method returns true if there is not such field.

Change-Id: I25db8de4561d3e0604f3e64edc1810140ba4aad2
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
4 years agoDetect pointer size at configure-time on Windows-hosted builds
Matt Hoosier [Thu, 17 Oct 2013 13:47:46 +0000 (08:47 -0500)]
Detect pointer size at configure-time on Windows-hosted builds

The configure-time procedure used on Windows does not currently
perform the same tests to determine the width of a pointer as are
performed on Unix-based builds.

This causes QT_POINTER_SIZE to be undefined in the generated
qconfig.h file. This in turn breaks compilation of various Qt modules
such as QtDeclarative.

This patch adds the same level of support for automatically
determining the target platform's pointer size, as is currently
offered to Unix users.

Change-Id: I93838c1759b14089ba9f4daf442048fb5c8da738
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
4 years agodon't load wayland-scanner for all projects on linux
Oswald Buddenhagen [Fri, 18 Oct 2013 12:37:18 +0000 (14:37 +0200)]
don't load wayland-scanner for all projects on linux

it's wasteful, given that exactly one add-on module (and most probably
nobody else) needs it.

i'd do the same with yacc and lex, but i suspect this would cause quite
an uproar.

Change-Id: Ic2a6ca19e829393835f824e31cd0893e78c3fd39
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
4 years agoFix compilation with latest MinGW-w64 (release 3)
Kai Koehne [Mon, 21 Oct 2013 10:54:45 +0000 (12:54 +0200)]
Fix compilation with latest MinGW-w64 (release 3)

Now that MinGW-w64 fixed the headers the old hack actually break stuff.

Change-Id: I1f60b9176982f6c07e01f3960bc1d7e70d7f9481
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
4 years agoBetter QWindowContainer by not relying on native widgets.
Gunnar Sletta [Fri, 18 Oct 2013 10:36:47 +0000 (12:36 +0200)]
Better QWindowContainer by not relying on native widgets.

We change the behavior slightly from the initial implementation in
5.1. Forcing the use of native child widgets is causing massive
performance issues so instead, we attach the embedded QWindow directly
to the root window. The only exception is QScrollArea and QMdiArea
which still enforces native windows for the entire parent chain
to make clipping and stacking work.

Task-number: QTBUG-34138
Change-Id: If713637bd4dce630552ace2f8ad6b2e86c063721
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
4 years agoFix settable style hints.
Friedemann Kleint [Tue, 15 Oct 2013 12:12:34 +0000 (14:12 +0200)]
Fix settable style hints.

Introduce QStyleHintsPrivate and introduce internal
setters called by QApplication.

Task-number: QTBUG-33991
Change-Id: Id61f8b1e2b5c9cfd7b4713aaded66e93e6f63719
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
4 years agoDoc: Add missing \since 5.2 to QSizePolicy::retainSizeWhenHidden
Marcel Krems [Fri, 18 Oct 2013 09:56:45 +0000 (11:56 +0200)]
Doc: Add missing \since 5.2 to QSizePolicy::retainSizeWhenHidden

Change-Id: I461e8187810e564e06869df86b23cc40aeba72bd
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
4 years agoCorrect handling of font weights bolder than bold.
Roger Maclean [Mon, 21 Oct 2013 18:18:59 +0000 (14:18 -0400)]
Correct handling of font weights bolder than bold.

A couple of places were checking for a font weight equal to QFont::Bold
rather than a weight that is greater or equal to this. This sometimes
results in QFont::Black being rendered with a lighter weight than
QFont::Bold even though it should if anything be heavier.

Change-Id: I5aa73a84ea2718783bbac93a031d87b2ad90012c
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
4 years agoSkip extra PKGCONFIG variables with empty value
Konstantin Ritt [Sun, 8 Sep 2013 04:49:51 +0000 (07:49 +0300)]
Skip extra PKGCONFIG variables with empty value

The fallback value is an empty string anyways.

Change-Id: I77a2d3ad275321cb8b2e059fb6359f921cbc697c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
4 years agoFix Q_ASSERT(!channels[0].isSocketBusy()); v5.2.0-beta1
Allan Sandfeld Jensen [Thu, 17 Oct 2013 17:24:28 +0000 (19:24 +0200)]
Fix Q_ASSERT(!channels[0].isSocketBusy());

Since commit f30641a7 is has been possible to issue more than one host
lookup request per HttpNetworkConnection. If the result was both an
IPv4 and IPv6 address, and we get a second similar DNS reply, we
end up triggering the assert in startNetworkLayerStateLookup().

This patch splits the InProgress state to HostLookupPending and the state
of trying both IPv4 and IPv6. This makes it possible to ignore any new DNS
replies received after the first succesfull one.

Change-Id: I0b8d6b1582fdaed69dde5926019b60bb0cbd580d
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
4 years agoiOS: default_post: let xcodebuild_distclean depend on xcodebuild_clean
Richard Moe Gustavsen [Wed, 16 Oct 2013 12:42:44 +0000 (14:42 +0200)]
iOS: default_post: let xcodebuild_distclean depend on xcodebuild_clean

Otherwise, make would upon distclean first remove the xcode
project, then try to do xcodebuild distclean. xcodebuild would
then complain about a missing project.

Change-Id: I0a9a6af6d86d1a95e37f4bbafa38c63d892bf1cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
4 years agochangelog: add note about TLS session tickets
Peter Hartmann [Mon, 21 Oct 2013 08:59:14 +0000 (10:59 +0200)]
changelog: add note about TLS session tickets

Change-Id: I154a56ff85adb8d43ddb730d91d2c59f129f7a26
Reviewed-by: Richard J. Moore <rich@kde.org>
4 years agotests: Replace Q_OS_MACX -> Q_OS_OSX
Sergio Ahumada [Fri, 18 Oct 2013 16:40:39 +0000 (18:40 +0200)]
tests: Replace Q_OS_MACX -> Q_OS_OSX

Use the correct identifier for the OS X operating system.

Change-Id: I7158a6b77e5e7418bc6b0a565f003500820a346d
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
4 years agoQDnsLookup: Support for custom DNS server
Mandeep Sandhu [Tue, 24 Sep 2013 12:05:52 +0000 (17:35 +0530)]
QDnsLookup: Support for custom DNS server

This commit only adds a new QProperty, "nameserver", to QDnsLookup.
This property currently does not do anything and is not used internally
by QDnsLookup. The next commit will implement it's usage.

Task-number: QTBUG-30166
Change-Id: I85b72bd6661603128cab4068c1b83883fb2bfd1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
4 years agoDoc: Update, and reduce duplication of, QThread-related info
Sze Howe Koh [Wed, 16 Oct 2013 15:37:28 +0000 (23:37 +0800)]
Doc: Update, and reduce duplication of, QThread-related info

Added/Changed:
- Move content from the Thread Basics overview to the QThread class ref
- Rephrase bits for clarity
- Use more links

Removed:
- (threads-basics.qdoc) Warning against moveToThread(this): This usage
  came about when people tried to add slots to a QThread subclass. This
  patch adds a warning against the root cause.
- (threads-basics.qdoc) Note on sleep() et al.: They were made public in
  Qt 5.0.
- (threads-basics.qdoc) The strategy for managing member variables:
  Sounds error-prone. Pushing results through signals is safer.
- (qthread.cpp) The note about GUI classes: Irrelevant to QThread,
  and it's already mentioned elsewhere.

Change-Id: I6bc53cc22b929523f9976d2b920f94c02bd7273e
Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
4 years agoUsed QT_DEPRECATED_X in QtAlgorithms
Keith Gardner [Wed, 16 Oct 2013 23:42:06 +0000 (18:42 -0500)]
Used QT_DEPRECATED_X in QtAlgorithms

Made all of the deprecated functions in QtAlgorithms now use
QT_DEPRECATED_X with helpful deprecation messages.

Change-Id: I3358e44b8c1f15eeb4689ab02b1802a07d04fc09
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
4 years agoAdded QT_DEPRECATED_X(text)
Keith Gardner [Wed, 16 Oct 2013 23:04:06 +0000 (18:04 -0500)]
Added QT_DEPRECATED_X(text)

Defined the Q_DEPRECATED_X to use the Q_DECL_DEPRECATED_X macro.

Change-Id: I334328059c6a1e046f57470027b0d1086a35042c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
4 years agoFixed Q_DECL_DEPRECATED_X for Gcc 4.4
Keith Gardner [Thu, 17 Oct 2013 22:44:25 +0000 (17:44 -0500)]
Fixed Q_DECL_DEPRECATED_X for Gcc 4.4

Apparently the __attribute__((__deprecated__(text))) feature for gcc was
introduced in version 4.5.  Since Qt's minimum supported version of gcc
is 4.4, the declaration of the macro needed to check the compiler's
version number.

Since clang reports its __GNUC__ and __GNUC_MINOR__ as gcc 4.2, the
check for the compiler support had to be added in with
__has_feature(attribute_deprecated_with_message).

For icc, a check was added to see if __INTEL_COMPILER >= 1300, __GNUC__
is defined and Q_DECL_DEPRECATED_X was not defined.  If this is true,
the gcc syntax is used in the define.

Change-Id: I23980ac28b79264e8fd657cd3bfd2af7674779a1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
4 years agoUse QByteArrayLiteral throughout in QOpenGLVertexArrayObject
Sean Harmer [Sun, 20 Oct 2013 14:34:37 +0000 (15:34 +0100)]
Use QByteArrayLiteral throughout in QOpenGLVertexArrayObject

Change-Id: Ia362ead0ffdc077bd0db5d980c80464838c934ea
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
4 years agoEnabling CI usage for runtests_androiddeployqt.pl
Simo Fält [Fri, 18 Oct 2013 09:43:27 +0000 (12:43 +0300)]
Enabling CI usage for runtests_androiddeployqt.pl

- Fixed issues when having multiple devices connected at the same
  time.
- Fixed hard coded paths
- Removed not existing function call, which caused test run to exit
  too early.
- Added possibility to add and connect to device, configured as env
  variable.

Task-number: QTQAINFRA-641
Change-Id: I8c1e003ce4ffbc9fdd9572dc55eef8fe92330cba
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
4 years agoAndroid: Accessibilty: Handle text better
Frederik Gladhorn [Mon, 14 Oct 2013 18:41:07 +0000 (20:41 +0200)]
Android: Accessibilty: Handle text better

Try harder to actually return text, before TalkBack would not read the
contents of line edits and other text widgets.

Change-Id: Ibb9bb8ac4a2728674f6f5ccf29eda5ed66a81a34
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
4 years agoInitialize variable to fix build [-Werror=uninitialized].
Sergio Martins [Sat, 19 Oct 2013 21:09:17 +0000 (22:09 +0100)]
Initialize variable to fix build [-Werror=uninitialized].

The complaining compiler is:
gcc version 4.6.3 (crosstool-NG hg+default-ddc327ebaef2)

Change-Id: Iae488a89d75492e76a39a326b2db36548f8894d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5 years agoChange an addition into a subtraction
Thiago Macieira [Tue, 15 Oct 2013 01:13:14 +0000 (18:13 -0700)]
Change an addition into a subtraction

This potentially resolves the long-standing warning from GCC:
 assuming signed overflow does not occur when assuming that (X + c) < X
 is always false

GCC prints the warning to warn people that you can't check for overflow
with signed integers by doing that (signed integers don't overflow in
the standard).

If we change this to X < X - c, there's no overflow.

Task-number: QTBUG-33314
Change-Id: I5b166610a39559ec7b03c4c31ee5999efefa0c06
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
5 years agoMake it possible to clear glyph caches from the font engine.
Gunnar Sletta [Mon, 14 Oct 2013 13:59:45 +0000 (15:59 +0200)]
Make it possible to clear glyph caches from the font engine.

Change-Id: Iea62bc1727269ed3893d8b4dbcefa583f1b85d7f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
5 years agoremove broken validation of QMLIMPORTSCANNER
Oswald Buddenhagen [Fri, 18 Oct 2013 11:20:41 +0000 (13:20 +0200)]
remove broken validation of QMLIMPORTSCANNER

the variable may contain a complex command, so an exists() check is
doomed to failure if the tool is built dynamically.

also, the check is not really necessary: it failing indicates a bug in
the qt build system, and we don't really need to complicate the code to
deal with such corner cases.

Change-Id: I2e6087dcc6dd4a4f70bdf739550276f364c880dd
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
5 years agoexclude gui-needing tests from -no-gui build
Oswald Buddenhagen [Tue, 8 Oct 2013 12:51:00 +0000 (14:51 +0200)]
exclude gui-needing tests from -no-gui build

Change-Id: I91f7211efe44cbb41aa3058f85869a6babf121f3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
5 years agodon't bother defining QT_NO_DIRECTWRITE here
Oswald Buddenhagen [Tue, 8 Oct 2013 18:16:01 +0000 (20:16 +0200)]
don't bother defining QT_NO_DIRECTWRITE here

the relevant code moved to the windows platform plugin.

Change-Id: I06f2efd1190ee7d1da1f48172ae879e5c06a945f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
5 years agomake it possible to explicitly suppress the qml import scan
Oswald Buddenhagen [Fri, 18 Oct 2013 11:26:16 +0000 (13:26 +0200)]
make it possible to explicitly suppress the qml import scan

if the user knows that no additional imports need to be linked, this
can be used to optimize the build time.
as it happens, it can also be used to fix the build of the qml tools
themselves ...

Change-Id: Id77aea1f20cabdc2e831540c61d8a4b8e85c040b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
5 years agoWhen creating QVariant(QPolygonF()) this should be a null variant
Andy Shaw [Wed, 9 Oct 2013 11:47:52 +0000 (13:47 +0200)]
When creating QVariant(QPolygonF()) this should be a null variant

The handling of the null QPolygonF case was not correct as it would
always be seen as valid. This ensures it is treated in the same way as
QPolygon when it is in fact null.

[ChangeLog][QtGui][QPolygonF] When a QVariant holds a QPolygonF()
then it will be correctly seen as a null QVariant.

Change-Id: Icae34f513c3a8e1dd3f50cb64a3d13ae7c636cc4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
5 years agoLink from QLoggingCategory documentation to QTracer/QTraceGuard
Kai Koehne [Wed, 16 Oct 2013 14:26:40 +0000 (16:26 +0200)]
Link from QLoggingCategory documentation to QTracer/QTraceGuard

Change-Id: I331966f6137a31f089425a639afe8f9f4088c0b6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
5 years agoAndroid: Remove support for QMAKE_SUPPORTED_ORIENTATIONS
Eskil Abrahamsen Blomfeldt [Fri, 18 Oct 2013 11:43:20 +0000 (13:43 +0200)]
Android: Remove support for QMAKE_SUPPORTED_ORIENTATIONS

This was created for the iOS port and intended to be cross-platform,
but since then they got cold feet and never added the support.
It makes no sense to only support this on Android. We need to
remove it again and hold off until we can find a proper solution.
Editing the AndroidManifest.xml is the non-cross-platform
solution for this.

Task-number: QTBUG-34166
Change-Id: I51d53b82a3412a9016de01612dd8df9ae12c6633
Reviewed-by: BogDan Vatra <bogdan@kde.org>
5 years agoExplicitly mark subdirs as host_builds in SUBDIRS template
Tor Arne Vestbø [Fri, 18 Oct 2013 14:42:21 +0000 (16:42 +0200)]
Explicitly mark subdirs as host_builds in SUBDIRS template

Allows post-processing code to exclude recursing into host_build subdirs.
The alternative would be to have the SUBDIRS logic pre-parse the subdir
project to check if it's a host_build, but that might have a performance
impact, so it's better to leave the information explicit in the subdir
project file.

Change-Id: I1a6f7d94c49faf5f5106c83ef21f6b85b531c90b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
5 years agoSet currently selected printer to QCUPSSupport in PageSetupWidget
Martin Klapetek [Fri, 18 Oct 2013 15:31:46 +0000 (17:31 +0200)]
Set currently selected printer to QCUPSSupport in PageSetupWidget

Also adds new method to allows setting a printer in QCUPSSupport by
printer name.

Change-Id: Iff7a88d95eab9de2c96872c45b12e708207bda16
Reviewed-by: John Layt <jlayt@kde.org>
5 years agoIf CUPS has no default printer, set up the first one in list
Martin Klapetek [Fri, 18 Oct 2013 13:19:19 +0000 (15:19 +0200)]
If CUPS has no default printer, set up the first one in list

Otherwise QCUPSSupport is instantiated without any printer being set up,
which leads to bugs and/or crashes in other parts using QCUPSSupport.

Change-Id: I1f4ddde5a28d6448d78aed856104ce8448e213c7
Reviewed-by: John Layt <jlayt@kde.org>
5 years agoFix crash in qdoc startup
Kai Koehne [Fri, 18 Oct 2013 11:25:19 +0000 (13:25 +0200)]
Fix crash in qdoc startup

the order of initialization of static variables is undefined, and we
therefore cannot (safely) initialize the array with static QStrings
declared elsewhere.

This was leading to crashes in MinGW gcc 4.8.0. Work around the issue
by initializing the array at runtime initialization instead.

Task-number: QTBUG-34172
Change-Id: I24f0e6af6685fc280d12c8ef90d40b8ebe994450
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
5 years agoClear qt_tablet_target in ~QWidgetWindow.
Friedemann Kleint [Fri, 18 Oct 2013 14:24:24 +0000 (17:24 +0300)]
Clear qt_tablet_target in ~QWidgetWindow.

Task-number: QTBUG-34007

Change-Id: If67563e5d9c4040256b58521773736e14db6fbaf
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
5 years agoFix widgets link error on iOS (missing mac gesture recognizers).
Friedemann Kleint [Fri, 18 Oct 2013 09:28:19 +0000 (11:28 +0200)]
Fix widgets link error on iOS (missing mac gesture recognizers).

Change-Id: Iebea6b6e26e9aca9a64aecc9b125c48fe1cc7e43
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
5 years agomore escaping of slashes in awk regexp
Oswald Buddenhagen [Thu, 17 Oct 2013 16:52:46 +0000 (18:52 +0200)]
more escaping of slashes in awk regexp

apparently some awks need the regexp delimiters to be escaped even
within a character list.

Change-Id: I74a77022e134cafa269960c5c88a9a88589f1b95
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
5 years agoCocoa: Allow popups to grab mouse and keyboard
Gabriel de Dietrich [Fri, 18 Oct 2013 12:51:04 +0000 (14:51 +0200)]
Cocoa: Allow popups to grab mouse and keyboard

According to the QWindow documentation this should happen regardless
of the window type. (It also mimics the current behavior on Linux and
Windows).

Change-Id: I1b0959ad8cf19bce452fd79a13b07d0a3a3c49e9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
5 years agoiOS: Don't hard-code simulator and device architectures
Tor Arne Vestbø [Thu, 17 Oct 2013 14:46:32 +0000 (16:46 +0200)]
iOS: Don't hard-code simulator and device architectures

Change-Id: Id5a370248b553b7393ec1b187bd34c0ab9f28496
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
5 years agoiOS: Add default QT_ARCH for configure tests to our own qt_config.prf
Tor Arne Vestbø [Thu, 17 Oct 2013 14:20:42 +0000 (16:20 +0200)]
iOS: Add default QT_ARCH for configure tests to our own qt_config.prf

Setting QT_ARCH when empty is a workaround for a missing qconfig.pri,
since it hasn't been written yet by configure. As qconfig.pri is
loaded by the generic qt_config.prf, putting our workaround in
our own wrapper for qt_config makes sense, as it keeps the logic
close to where the original QT_ARCH is resolved.

Change-Id: I49ffc21cf5dea5ca5b6254ca8084a4dcdc359a72
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
5 years agoiOS: Prevent stray non-expected rules/targets in Xcode-wrapper makefile
Tor Arne Vestbø [Tue, 15 Oct 2013 13:19:48 +0000 (15:19 +0200)]
iOS: Prevent stray non-expected rules/targets in Xcode-wrapper makefile

Change-Id: Ibef10ba174df25aa97fd986b51a62d6b7feb119e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
5 years agoQDateTime - Fix RFC 2822 Date Formatting
John Layt [Thu, 17 Oct 2013 17:02:03 +0000 (19:02 +0200)]
QDateTime - Fix RFC 2822 Date Formatting

The RFC 2822 date format should always use en_US locale for month and
day names instead of whatever the system locale is.  Also remove some
duplicate code.

Change-Id: Ia2f7ee405b4e0e2f04980301783b9488628da73f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5 years agoRename private viewOptions to viewOptionsV1
Samuel Gaist [Thu, 10 Oct 2013 14:43:44 +0000 (16:43 +0200)]
Rename private viewOptions to viewOptionsV1

Renaming of the private implementation of viewOptions to viewOptionsV1
so that future updates of QStyleOptionViewItem can be easily integrated
in the code with a simple search/replace.

Task-number: QTBUG-1180
Change-Id: I18f876a435417717fa0d759bb302a7c6059daf80
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
5 years agoevdevtouch: Make it work with am335x
Laszlo Agocs [Thu, 17 Oct 2013 12:45:13 +0000 (14:45 +0200)]
evdevtouch: Make it work with am335x

The driver for the resistive touchscreen of these boards tends to report
ABS limits 0..4095 even tough it never sends coordinates outside a certain
range (e.g. approximately 165..4016 for X). This breaks the mapping of
hardware coordinates to screen space. Apply a workaround to make it
work properly.

Change-Id: I3eb5d76002acba1972061f3add44d797349c8ec8
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
5 years agoAdd missing \since 5.2 tag to static QFileInfo::exists()
hjk [Sat, 12 Oct 2013 08:54:37 +0000 (10:54 +0200)]
Add missing \since 5.2 tag to static QFileInfo::exists()

Change-Id: I11e136eaede2a5dffeb10b5fe31023b9aef709cb
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
5 years agoRefresh CUPS printer list when QPrinterInfo.availablePrinters() is called.
Friedemann Kleint [Wed, 16 Oct 2013 13:32:48 +0000 (15:32 +0200)]
Refresh CUPS printer list when QPrinterInfo.availablePrinters() is called.

Introduce freeCupsPrinters() thus fixing a bug in the old deallocation
code which would first set m_cupsPrintersCount = 0 and then
pass it to cupsFreeDests().

Task-number: QTBUG-33666
Change-Id: I94c51cb390761a669a9cbd589c1131cfb51354c3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
5 years agoBlackberry: Cannot create shared egl contexts.
Nick Ratelle [Wed, 16 Oct 2013 17:24:32 +0000 (13:24 -0400)]
Blackberry: Cannot create shared egl contexts.

Currently the share context is always set to
EGL_NO_CONTEXT when it should instead query the
share handle from the QOpenGlContext and pass that
to the eglCreateContext call.

Change-Id: Ia7e32574e1427fba0f919003e5367cfc98688d9d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
5 years agoMove the viewOptions code back to public implementation
Samuel Gaist [Thu, 17 Oct 2013 12:10:46 +0000 (14:10 +0200)]
Move the viewOptions code back to public implementation

The code generating the QStyleOptionViewItem has been moved back to the
public implementation and the private QAbstractItemView::viewOptions
calling it (like the Qt 4 implementation does). This makes the item
views behave properly again e.g. QListView drag & drop in Icon mode
gets the correct options to draw the moving items

Task-number: QTBUG-1180

Change-Id: I068861e1485252f12d73f9acaf12933d0ec84e2c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
5 years agoProperly paint QListView dragged item in icon mode
Samuel Gaist [Thu, 10 Oct 2013 14:32:31 +0000 (16:32 +0200)]
Properly paint QListView dragged item in icon mode

Currently, when dragging a QListView item in icon mode, only the
item is moved and once out of the view port, the visual feedback is
lost. This patch updates the QDrag pixmap to have a persistent view of
what is moved.

Task-number: QTBUG-1180

[ChangeLog][QtWidgets][QTBUG-1180] Dragging an item outside the QListView in icon
mode doesn't lose the icon.

Change-Id: I14f864a8f947997f3bdad1a05fabd200de026d66
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
5 years agoImplement native gestures on OS X.
Morten Johan Sørvig [Wed, 2 Oct 2013 06:52:26 +0000 (08:52 +0200)]
Implement native gestures on OS X.

Add QWindowSystemInterface::GestureEvent and
QNativeGestureEvent to QtGui. These events are copies
of Qt4's QNativeGestureEvent, where it was an implementation
detail of QGestureManager.

Add gesture message handlers to QNSView and bring
back the Mac gesture recognizers for QGestureManager.

Task-number: QTBUG-28126
Change-Id: I1304e09e776fa7c44d133d54ca8b895ca2f544c5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
5 years agoWindows: Capture last error right after CreateDirectory() in QFileSystemEngine.
Friedemann Kleint [Thu, 17 Oct 2013 09:13:01 +0000 (11:13 +0200)]
Windows: Capture last error right after CreateDirectory() in QFileSystemEngine.

Custom allocators invoked by freeing the QString contents might change
it.

Task-number: QTBUG-34046
Task-number: QTBUG-32314

Change-Id: Ied5305c21fcce228448fe565899163997536ea7a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
5 years agoClear QGuiApplicationPrivate::tabletPressTarget in ~QWindow.
Friedemann Kleint [Thu, 17 Oct 2013 10:01:15 +0000 (13:01 +0300)]
Clear QGuiApplicationPrivate::tabletPressTarget in ~QWindow.

Task-number: QTBUG-34007

Change-Id: I81b8496746f425f58a21b18ffaf96dfdbbe2a815
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
5 years agoiOS: Wrap user's main by renaming symbol and relying on weak linking
Tor Arne Vestbø [Wed, 16 Oct 2013 17:06:47 +0000 (19:06 +0200)]
iOS: Wrap user's main by renaming symbol and relying on weak linking

This approach is similar to the earlier apprach of defining main=qt_main
when building the user's sources, but uses the linker to rename the
symbol instead, which is less fragile than using the preprocessor.

To keep the hybrid usecase unaffected by our wrapper logic we declare
both our main wrapper and a fallback qt_main as weak symbols, which
ensures that when the user's application links in our plugin the
real main/qt_main provided by the user is preferred over our weak
symbols.

Change-Id: Ic76f3ba8932430c4b13a1d3a40b8ed2322fe5eea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
5 years agoqmake: Add support for QMAKE_{PRE,POST}_LINK in the Xcode generator
Tor Arne Vestbø [Wed, 16 Oct 2013 15:40:01 +0000 (17:40 +0200)]
qmake: Add support for QMAKE_{PRE,POST}_LINK in the Xcode generator

Change-Id: I038cf0aebb74d7ecfe6cb3ed868287042342eb7e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
5 years agoRefresh Windows printer list when QPrinterInfo.availablePrinters() is called.
Friedemann Kleint [Wed, 16 Oct 2013 13:36:34 +0000 (15:36 +0200)]
Refresh Windows printer list when QPrinterInfo.availablePrinters() is called.

Introduce static query functions.

Task-number: QTBUG-33666
Change-Id: I291098c9da82bc2cc24957044187e93cdc33c41d
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
5 years agoiOS: Mark argument as unused for release builds
Tor Arne Vestbø [Wed, 16 Oct 2013 16:56:49 +0000 (18:56 +0200)]
iOS: Mark argument as unused for release builds

Change-Id: I73497a6c16236f912646c9fbe9b136ff760ce4f7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
5 years agoStatic builds: Link QML plugins.
Morten Johan Sørvig [Tue, 10 Sep 2013 14:25:32 +0000 (16:25 +0200)]
Static builds: Link QML plugins.

Run qmlimportscanner, add found plugins to the LIBS
line, generate qml_plugin_import.cpp.

Change-Id: I6c6b927cceb36fa2dc405ad698f26d20398b33c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
5 years agolinux-rasp-pi: Remove custom cursor code
Andy Nichols [Wed, 16 Oct 2013 15:25:23 +0000 (17:25 +0200)]
linux-rasp-pi: Remove custom cursor code

This code was added as an optimization for showing a mouse cursor on
the Raspberry Pi.  What happens though is while the mouse cursor does
move more smoothly, the actual application becomes less smooth when the
mouse cursor is moved.  By removing the custom cursor code, performance
will no longer be effected by rendering a moving mouse cursor.

Change-Id: I9f8ac6c236cd4ff6d8e1d999a461c3e6db75d7e3
Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
5 years agoAdd explanation to QEXPECT_FAIL statements
Kurt Pattyn [Sat, 12 Oct 2013 17:02:21 +0000 (19:02 +0200)]
Add explanation to QEXPECT_FAIL statements

Added clarifying explanations to the QEXPECT_FAIL statements.
Now it should be easier to understand what is expected from the parser.

Change-Id: I1dacd60564f292d9ce43de7254525c34fa7cdc55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5 years agoClarify that the URL scheme does not include the ':'
Kurt Pattyn [Sun, 13 Oct 2013 18:14:20 +0000 (20:14 +0200)]
Clarify that the URL scheme does not include the ':'

From the documentation of setScheme it was not clear if the scheme should
be terminated by a ':' or not. Documentation has been updated to clarify
the expected syntax for the scheme.

Change-Id: Ied8533beef7daa12e1d5e7da0649c184efb84522
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5 years agoAllow non-character codes in utf8 strings
Kurt Pattyn [Sun, 6 Oct 2013 09:40:47 +0000 (11:40 +0200)]
Allow non-character codes in utf8 strings

Changed the processing of non-character code handling in the UTF8 codec.
Non-character codes are now accepted in QStrings, QUrls and QJson strings.
Unit tests were adapted accordingly.
For more info about non-character codes,
see: http://www.unicode.org/versions/corrigendum9.html

[ChangeLog][QtCore][QUtf8]
UTF-8 now accepts non-character unicode points; these are not replaced
by the replacement character anymore

[ChangeLog][QtCore][QUrl]
QUrl now fully accepts non-character unicode points; they are encoded as
percent characters; they can also be pretty decoded

[ChangeLog][QtCore][QJson]
The Writer and the Parser now fully accept non-character unicode points.

Change-Id: I77cf4f0e6210741eac8082912a0b6118eced4f77
Task-number: QTBUG-33229
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5 years agoAdd support for disabling exceptions with ICC
Thiago Macieira [Tue, 1 Oct 2013 23:05:21 +0000 (16:05 -0700)]
Add support for disabling exceptions with ICC

Change-Id: Id1ea1bda14a20e44af1eb9f53bae877a3b9fd2e4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
5 years agoAdd JSON parsing support to qmake.
Morten Johan Sørvig [Thu, 5 Sep 2013 05:55:49 +0000 (07:55 +0200)]
Add JSON parsing support to qmake.

Add qjson* implementation files from corelib/json
to the qmake build. Add a read-only compile mode,
enabled by defining QT_JSON_READONLY.

Add qmake built-in function parseJson(file, into)
which parses a json file into the given variable.

qmake uses a flat key -> value-list implementation
for storing variables, which means that some hackery
is need to represent arbitrarily nested JSON. Use a
special "_KEYS_" variable for arrays and objects:

Arrays:
["item1", "item2"]
$${array._KEYS_} -> 0 1 2
$${array.0} -> "item1"
$${array.1} -> "item2"

Objects:
{ "key1" : "value1", "key2" : "value2" }
$${object._KEYS_} -> key1 key2
$${object.key1} -> value1
$${object.key2} -> value2

Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
5 years agoQLocale - Mac fix typos in comments
John Layt [Fri, 27 Sep 2013 15:32:44 +0000 (16:32 +0100)]
QLocale - Mac fix typos in comments

Fix some typos in the comments.

Change-Id: I14eed0ffed74f0a60b05441430158f71cb530c01
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
5 years agoAndroid: Use java.util.Random in qrand()
Christian Strømme [Fri, 11 Oct 2013 12:55:33 +0000 (14:55 +0200)]
Android: Use java.util.Random in qrand()

Android does not provide rand_r(), so we would fall back to rand()
and srand() which means we where not keeping the promise of qrand
and qsrand being thread-safe. As a replacement we can use the Java
api and have one Random object for each thread.

Task-number: QTBUG-32814
Change-Id: Id46d195a0bb122bc7a5a8de43bdf088e11a9c42e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
5 years agoQGraphicsItemAnimation: save some string data (text size -= 1K)
Marc Mutz [Sun, 6 Oct 2013 22:11:49 +0000 (00:11 +0200)]
QGraphicsItemAnimation: save some string data (text size -= 1K)

Also changed the 'step' range check to treat NaNs as invalid, too.

Change-Id: I993c5efffcf7140fba8f80a7db499cd2335867e0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
5 years agoQDateTime - Fix toTimeSpec() for invalid datetimes
John Layt [Tue, 15 Oct 2013 15:36:36 +0000 (17:36 +0200)]
QDateTime - Fix toTimeSpec() for invalid datetimes

Check if the datetime is valid before converting it to a different time
spec.  If it is invalid then just change the spec to keep behavior
consistent with 5.1.

Task-number: QTBUG-34020
Change-Id: I6630ec1d50f810a2178ab3222bd32af018085f81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5 years agoFix compilation with Clang and libc++ under Linux
Marcel Krems [Wed, 9 Oct 2013 02:24:06 +0000 (04:24 +0200)]
Fix compilation with Clang and libc++ under Linux

src/plugins/platforms/xcb/qxcbsessionmanager.cpp:205:80: error: use of undeclared identifier 'ERANGE'
    while (getpwuid_r(geteuid(), &entry, buf.data(), buf.size(), &entryPtr) == ERANGE) {
src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp:173:28: error: use of undeclared identifier 'LC_CTYPE'
    char *name = setlocale(LC_CTYPE, (char *)0);

Change-Id: Ide6f3072e9158eef412973ce0a72babb41b695f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5 years agoMove the Apple Clang specific features outside of the C++11 section
Thiago Macieira [Tue, 15 Oct 2013 19:40:35 +0000 (12:40 -0700)]
Move the Apple Clang specific features outside of the C++11 section

Those are not related to C++11, so move them to the Clang detection
block.

Change-Id: I80b298e1df5f74a865d743625895e0f01cb5fd6b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
5 years agoXcode: Dynamically choose release/debug libs based on current configuration
Tor Arne Vestbø [Mon, 14 Oct 2013 13:09:00 +0000 (15:09 +0200)]
Xcode: Dynamically choose release/debug libs based on current configuration

Non-framework builds would automatically link to whatever Qt library
matched the config at the time of running qmake, eg hard-coded to
libQtCore_debug, while Xcode itself allowed the user to switch between
release and debug configurations.

We now append an Xcode settings variable to the library path, which gets
resolved at build time depending on the current config in Xcode.

Change-Id: I12873e38a28d9595ef3fd0ae0ad849e6744833a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
5 years agoPrint non-default categories in default message handler
Kai Koehne [Fri, 20 Sep 2013 09:45:54 +0000 (11:45 +0200)]
Print non-default categories in default message handler

Change the default output of the logging framework to prefix messages
with a 'category: ' in case the category is not "default", so that e.g.

  QLoggingCategory cat("qt.core.codes.windows");
  qCWarning(cat) << "MultiByteToWideChar: Cannot convert multibyte text";

will print

  qt.core.codes.windows: MultiByteToWideChar: Cannot convert multibyte text

while output from qWarning etc will show unaltered output. This should
help users to discover categories, and to group output together.

Change-Id: Iac2e1514f7dc5671966c36a440a119c857564cfc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
5 years agoSupport APPLE VAO extension on Mac.
James Turner [Tue, 15 Oct 2013 17:32:02 +0000 (18:32 +0100)]
Support APPLE VAO extension on Mac.

Since Mac lacks a compatibility profile, we often use the highest
supported compatible version, 2.1; this lacks vertex-array-object (VAO)
support in the API, but Apple provide a compatible extension. Extend
the helper object to detect this case and make VAO support work.

Change-Id: I75a74e048a0d188cec76bc5a4a9eafa4c9143740
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
5 years agoEnsure that context menus show even if the window is not active on Mac
Andy Shaw [Tue, 15 Oct 2013 18:11:37 +0000 (20:11 +0200)]
Ensure that context menus show even if the window is not active on Mac

When using the mouse to show a context menu on Mac then even if the
window is not active then it will show the menu for native applications.
So this ensures that this is respected for context menus in Qt too.

Task-number: QTBUG-31497
Change-Id: Ibfcb4b893b0e31d4ce36926a83c9214d130d8fa2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
5 years agoOS X: a dialog should always have an enabled titlebar close button
Shawn Rutledge [Fri, 14 Jun 2013 14:42:32 +0000 (16:42 +0200)]
OS X: a dialog should always have an enabled titlebar close button

regardless of modality.

Task-number: QTBUG-28385
Task-number: QTCREATORBUG-9264
Change-Id: Iaa608f6e742686d4068547766ec596e37c696a07
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>