Commit Graph

29813 Commits

Author SHA1 Message Date
Oswald Buddenhagen
1df4b2a360 fix build with QT_NO_CAST_FROM_ASCII
necessary for use outside qmake itself.

amends f137957e08.

Change-Id: Ie069f7b6efc969ab112e1f0ecd966eb06248fb94
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-10-07 11:21:17 +00:00
Oswald Buddenhagen
13e7c603d5 move dbusmenu and dbustray under themes/genericunix
that's the only place where they are used, and this clarifies the
structure.

Change-Id: I874beb7f049b34cc73079609b8baabcc1bd3cd39
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-07 07:21:14 +00:00
Kai Koehne
85023e1d72 Make sure X11 paths are properly set in plugins
QMAKE_X11_PREFIX and QMAKE_XKB_CONFIG_ROOT are now configured
in qtgui, so we need to include qtgui-config.pri before accessing
them in plugins.

Task-number: QTBUG-56351
Change-Id: I2e18f0b03f826a93a9d9a1965bd024ee89656ae8
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-06 19:04:36 +00:00
Liang Qi
2e749afc5a Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8 2016-10-06 18:15:17 +00:00
Liang Qi
ef25620ac1 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	mkspecs/features/mac/default_pre.prf
	mkspecs/features/qpa/genericunixfontdatabase.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/uikit/resolve_config.prf
	mkspecs/macx-ios-clang/features/default_post.prf
	mkspecs/macx-ios-clang/features/resolve_config.prf
	src/corelib/io/qiodevice.cpp

Change-Id: I6f210f71f177a3c3278a4f380542195e14e4b491
2016-10-06 20:12:27 +02:00
Marc Mutz
3c274d4e3e QTableGenerator: give some TLC to the sorting predicate
- Provide op()(uint[], QComposeTableElement) as well, since the
  standard (does|did) not specify in which order the two are called.
- Use std::lexicographical_compare to do the ... lexicographical
  comparison.
- Share code by calling a new op()(uint[], uint[]) overload from all
  other overloads.
- Mark all op() overloads const noexept.
- Rename from 'Compare' to 'ByKeys', as in 'sort(vector, ByKeys()))'.
- Replace a hand-rolled loop with std::equal.
- Replace a #define with a static constexpr variable.

Change-Id: I5ed487199916d0ae44ac38741fc95099bd2f8a22
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-10-06 15:09:53 +00:00
Maurice Kalinowski
2d3be6a989 winrt: prefer fusion over windows theme
As on other mobile platforms, fusion should be preferred as the default
theme instead of the desktop windows one. The styleHints from
QPlatformIntegration are adapted on top of fusion then.

Task-number: QTBUG-40667
Change-Id: I60836b4a199b29e63c400c2ed9bbbab7d3add902
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-10-06 10:33:48 +00:00
Tor Arne Vestbø
7a7b745917 Ensure that QBackingStore::flush() is not used across window hierarchies
Change-Id: I0713d7499f32819db4263e36dff58812a9ac763c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-06 10:31:29 +00:00
Tor Arne Vestbø
669add92d9 Replace QCFString::to(CF/NS/Q)String usage with QString methods
Slims down QCFString and leaves only one implementation of converting
back and forth between CF/NS strings and QStrings.

Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-06 08:02:59 +00:00
Tor Arne Vestbø
1b567854e4 Use extreme values in QMetaType/QSettings test data
By using _MIN for signed values, and _MAX for unsigned values, we may
detect conversion issues when serializing QVariants using QSettings.

Change-Id: I3ce58ba4b93f791f75c7ae44d1fd5030f07b2f25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-05 20:31:23 +00:00
Tor Arne Vestbø
89842b97d7 Implement QMacCocoaViewContainer in terms of foreign window
This leaves a clearer separation between the foreign-window and non-foreign
window use-cases, where a single QCococaWindow can only be in one mode,
which is determined in the constructor and doesn't change after that.

There are no source or binary compatibility guarantees for the QPA classes,
meaning the helper function in QPlatformNativeInterface can be removed.

Change-Id: I3232aedca1d98c49a8f54e16750832187f9dc69a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-05 19:37:17 +00:00
Tor Arne Vestbø
087b11e881 macOS: Rename m_contentView to m_view, to distinguish from [NSWindow contentView]
The contentView is the root view of a NSWindow, but our m_contentView is
just the corresponding NSView of a QWindow, and doesn't always match the
contentView property of the NSWindow.

This is part of a multi part cleanup to the Cocoa platform plugin in
preparation for improved foreign-window support.

Change-Id: Ifaffb12f35544ec05e4a83964b346b47fa4b0576
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-05 19:35:06 +00:00
Jake Petroules
12bc984f65 Clean up QT_QPA_DEFAULT_PLATFORM handling
This is now centralized in configure.pri except where it explicitly
needs to be overridden.

Change-Id: If829d6b5eecf9a5fc403d0a0600d12c9e5781525
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-05 19:07:30 +00:00
Tor Arne Vestbø
fd7e00aff5 Don't truncate QDateTime milliseconds when storing QSettings on Apple platforms
The fix is trivial, but the patch adds a new QSettings tests that iterates most
of the QMetaTypes and verifies that storing and retrieving them again gives the
same value. This is a more complete test than the testVariantTypes tests, which
is limited to a subset of the QVariant types. The new tests borrows logic from
the QMetaType test machinery.

QSettings has been Q_ENUM'ified in the process, for improved debug output.

Note that on backends such as the INI backend, the metatype of the QVariant read
from the settings will be a string, so it won't match the input QVariant type,
but the result of converting that to the original value type should still work.

Task-number: QTBUG-56124
Change-Id: Ib03a26abf77c9fb449b94160d28bc4baeb095f25
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-05 18:45:04 +00:00
Liang Qi
6feec9da93 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I34b5e290233d0869fbafac094a939aec2bf83fd5
2016-10-05 19:33:26 +02:00
Frederik Schwarzer
c3605980d9 Fix some typos and minor sentence structure issues in docs
Change-Id: Ibede1aeb046e2df6723e3041152bfae22a9fde32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-05 15:00:24 +00:00
Tor Arne Vestbø
764f5bf48c Apple OS: Handle QSetting strings with embedded zero-bytes
Saving strings with embedded zero-bytes (\0) as CFStrings would
sometimes fail, and only write the part of the string leading
up to the first zero-byte, instead of all the way to the final
zero-terminator. This bug was revealed by the code-path that
falls back to storing e.g. QTime as strings, via the helper
method QSettingsPrivate::variantToString().

We now use the same approach as on platforms such as Windows
and WinRT, where the string produced by variantToString() is
checked for null-bytes, and if so, stored using a binary
representation instead of as a string. For our case that
means we fall back to CFData when detecting the null-byte.

To separate strings from regular byte arrays, new logic has
been added to variantToString() that wraps the null-byte
strings in @String(). That way we can implement a fast-path
when converting back from CFData, that doesn't go via the
slow and lossy conversion via UTF8, and the resulting QVariant
will be of type QVariant::ByteArray. The reason for using
UTF-8 as the binary representation of the string is that
in the case of storing a QByteArray("@foo") we need to
still be able to convert it back to the same byte array,
which doesn't work if the on-disk format is UTF-16.

Task-number: QTBUG-56124
Change-Id: Iab2f71cf96cf3225de48dc5e71870d74b6dde1e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-05 11:57:41 +00:00
Maurice Kalinowski
d44925507b winrt: Fix compilation for projects using C++/CX extensions
In case a project uses C++/CX extensions via /ZW compile flag including
qfunctions_winrt.h resulted in a compile error about duplicate
definition of Started due to namespace usages.

Change-Id: I8913522eafbabae77dd7d17187f202e555b0275f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-10-05 06:33:33 +00:00
Marc Mutz
483aff406a QColor: Fix use of uninit'ed value in get_hex_rgb()
If len == 0, we didn't write anything to 'tmp', but get_hex_rgb()
unconditionally reads tmp[0] (aliased to name[0] in get_hex_rgb()).

Fix by terminating the tmp array, thus ensuring that the comparison
against '#' in get_hex_rgb() fails.

Introduced in a41393d0bc.

Coverity-Id: 171477
Change-Id: I53952aff7035813ed6abc74d402953bc9cfa76f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-10-05 06:22:51 +00:00
Sergio Martins
72a1a72776 docs: Don't mark qDrawBorderPixmap() as overload
Because it doesn't overload anything.

Change-Id: I871df10b4a0a46da238a5d1061cfb1aa34ccee03
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-05 06:22:45 +00:00
Tor Arne Vestbø
f2b90b4e82 Apple OS: Resolve QStandardPaths test data locations based on real locations
Instead of the manual logic for computing test data locations, we use the
locations from baseWritableLocation, but make sure to put them all under
'.qttest' in the home directory. This approach handles more cases for test
data, and also plays nice with locations that are not in the home directory
due to being containerized (and hence do not need a separate test data scope).

Change-Id: Iea4f21acb75c0191be35a3619c05143e8929bd6e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 21:22:05 +00:00
Tor Arne Vestbø
6c8f32388b tst_QSettings: Detect if Apple platforms support writing to SystemScope
A fair amount of tests are skipped if we can't write to the system scope,
eg on iOS. Without this detection they will fail.

Change-Id: I8257f1f24e69dae88925c20d2bff851e81701405
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 21:21:20 +00:00
Oswald Buddenhagen
0fcd842cec remove unnecessary references to $$QMAKE_CFLAGS_DBUS
it does not appear that the tests actually use these flags in any way;
they don't include any (actual) d-bus headers and have no ifdefs.

and the qdbus module already pulls in the flags via QMAKE_USE (in the
case where they are defined at all, i.e., dbus-linked).

Change-Id: Ie6bc6da7d1dd96da7b73f2d0fe45576936715874
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-04 20:21:28 +00:00
Oswald Buddenhagen
66b73172c9 remove redundant QMAKE_USE += xcb
the gl_integrations_plugin_base.pri included by this file already does
it.

Change-Id: I172401a431081da903b82e97829c2517ef6204df
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:21:21 +00:00
Oswald Buddenhagen
7b4c52c7e6 remove stray dbus/-menu dependency from xcb plugin
amends 26a05fc09 (which in turn was a cleanup of 38abd6537).

Change-Id: I6159a3cfe468db048faf1c396143dd3869f7e72b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:21:15 +00:00
Oswald Buddenhagen
72fe67353d rely on module include paths for qpa includes
Change-Id: I9a28a5ec9b0050786c4abc39c6ac298e95cf8fad
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-04 20:21:09 +00:00
Oswald Buddenhagen
db732a07c0 remove apparently useless egl include
this file does not directly access egl.

Change-Id: I8b52aef9ee3a69a12370c3c6a1f9e2bb23051603
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-04 20:21:03 +00:00
Oswald Buddenhagen
5976fbf5e0 convert apparently forgotten QT_CONFIG/fontconfig reference to qtConfig()
Change-Id: I69d7247747c6e5a7b29051ba7b86b29c27936e65
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:20:56 +00:00
Oswald Buddenhagen
9d8f7bcaa1 clean up freetype conditionals
there is no point in testing !win32 explicitly any more, as configure
will take this into account already.

Change-Id: Idfca46feece6451509b405a4afc2b7205667c5bb
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:20:51 +00:00
Oswald Buddenhagen
57987ad571 fix freetype/fontconfig configure system
convert the ugly config.tests/[...]/freetype.pri file into a custom
callback in configure.pri, and reinstate pkg-config use for freetype.
subsequently, use QMAKE_USE for the actual library references.

this fixes in particular cross-builds, as the new configure was not
passing the necessary information to the test any more, so the old .pri
file misbehaved.

Task-number: QTBUG-54911
Change-Id: I5fc9c254334a2675f7db4d54df4c77637e8e2487
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-04 20:20:39 +00:00
Oswald Buddenhagen
cd8b7fb865 make QMAKE_USE parameterizable
it's now possible to declare references which don't cause linking (or
cause only linking).

make use of this in the xcb-static library.

Change-Id: Ic429e0a1200b3a333738ea8d8e576ff64b6cac21
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-04 20:20:18 +00:00
Oswald Buddenhagen
1e97037ed9 factor out QMAKE_USE* processing to a separate prf file
this makes it possible for features added via CONFIG to use QMAKE_USE*,
as default_post.prf is processed before all features in CONFIG.

Change-Id: Id0812a0fb1aa5e658548bd2bc6003234085545e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 20:20:06 +00:00
Gabriel de Dietrich
9ab60b9c0d QCocoaEventDispatcher: Save interrupt state between embedded calls
Since QCocoaEventDispatcher::processEvents() resets the interrupt
state, this may prevent a higher level event loop from returning.

For example, calling QMenu::exec() and, as a result of an action
being triggered, the application calls QCoreApplication::processEvents()
after QMenu::hideEvent(). In this case, the menu event loop can be
stuck until we run another event loop.

Task-number: QTBUG-53947
Change-Id: If7efe1c3c07f7222c695195cbb4f41715e49b02e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-04 18:38:19 +00:00
Jake Petroules
0059bf944d Don't add -spec XXX more than once to system command in xcodebuild.prf
The "args" variable would contain the original -spec XXX flags in
addition to the -spec macx-xcode passed in the system command invocation
below. The last use of -spec takes effect, so this code was entirely
ineffective. Consequently, uikit/default_post.prf in the nested qmake
call thought it's still the top-level call and thus added xcodebuild
again, which caused an infinite recursion.

Change-Id: Ie98d8a7f3c1cd875f4a4146af9a66a66b48cc6cb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-04 18:33:34 +00:00
Peter Varga
37ad51a44e Revert "Doc: Added enums in qnamespace.qdoc"
Remove duplicated enum values from doc.

This reverts commit dfb55da5d6.

Change-Id: I27c85f66123731e0106bd702e843a24d7e9b5931
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-10-04 17:58:57 +00:00
Marc Mutz
bf595c4e78 QFileSystemModel: Plug leak on file renaming
In setData(), the old code both called Private::addNode(),
which creates a QFileSystemNode and adds it to the parent's
QHash of children, and also re-purposed the old node by
taking it out of the children hash, adjusting the fileName
member of the node and putting it back into the children
hash under the new name, where it would overwrite the node
just added under the same (new) name in addNode(). Since
the hash stores naked pointers, no-one deletes the node
that was put into the hash first.

Fix by dropping the addNode() call completely.

Change-Id: I0c37917fd0ffd74716393786c69b5bb172aa372e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-04 17:12:26 +00:00
Eskil Abrahamsen Blomfeldt
4d552815cf Fix plain text QStaticText with line breaks
The layout isn't actually created until endLayout() or setLineWidth() is
called. So in the case where this was not done, the height of the line
would be 0, thus multiple lines would be placed on top of each other, at
y == 0.

[ChangeLog][QtGui][Text] Fixed QStaticText when manually breaking lines
and no text width was set.

Task-number: QTBUG-56346
Change-Id: I7f6ed6260545882f05fe39b21134315eca7401b9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-10-04 14:30:13 +00:00
Allan Sandfeld Jensen
f3d19244cd Fix PrintScreen mapping on macOS and more
Fixes the mapping of the rare multimedia Print key, adds the real
mapping of the Print Screen key.

Also adds a mapping for few other short-cut keys that were added in 5.6

Change-Id: I931bf1eed062536e1be2aa6aa6f19d773bb5ec55
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-10-04 12:53:08 +00:00
Oswald Buddenhagen
546191b03f fix parsing of -system-proxies
this is, in fact, not the same as --proxies=system, and the old
configure handles this by putting special cases before the catch-all
patterns. we achieve this by trying the verbatim names (of all options,
which is admittedly a tad inefficient) before applying the -qt/-system
transformation.

Change-Id: Ic85a9d76d6e8ca95b2e1b5566f047f4b7ac38b98
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 08:26:49 +00:00
Oswald Buddenhagen
0872b62b2e make command line parsing more compliant with configure script
- generic --* options are defined to be booleans, without the
  possibility of having an additional parameter
- -qt and -system options don't exist in the --* form
- --foo=bar options exist only in the --* form

Task-number: QTBUG-55610
Change-Id: Ib0480ac6f479df48045c9de8e854a525862ee363
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 08:26:39 +00:00
Oswald Buddenhagen
d01133a7fc remove redundant load(qt_build_config)
every repo's .qmake.conf is expected to do it already.

Change-Id: I87ed75d80493d8f1c4548c5b9dadfdaf07b86d7e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:40 +00:00
Oswald Buddenhagen
05786de946 remove obsolete module warning
this is a relic from the early times of the modularization.

Change-Id: I9ca46fa6457bf9ca207b6be1f0637f0349569ddf
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:34 +00:00
Oswald Buddenhagen
4a561c6baf remove redundant conditionals regarding ssl
this actually fixes the build when ssl is not enabled, as the openssl
features are in the not included network-private module.

Change-Id: Ibafae9867af493da184a45cf3981628d475d37a6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:24 +00:00
Oswald Buddenhagen
5a4d469dcb rename configure.exe => configureapp.exe
now that the bat file is responsible for displaying the help in addition
to bootstrapping configure, the exe file should not shadow it any more.

amends c027cffbe.

Change-Id: I5c8a52f59ff455575e646fae55cd214db98a3736
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:08 +00:00
Oswald Buddenhagen
9e048799b8 fix msvc build in dirs with spaces
Change-Id: I2df71cce68e59b8d7565fb43953947a9a84970b3
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:24:58 +00:00
Marc Mutz
d6b6c15d33 QFileSystemModel: fix unused variable with QT_NO_FILESYSTEMWATCHER
The QFileInfo 'info' is only used in code conditional on
QT_NO_FILESYSTEMWATCHER, so move the definiton into the
conditionally-compiled block, too.

Turn it into an rvalue while at it.

Change-Id: I9983bfdcd0b32d0abecf7c588973a60df9de8cbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-04 07:37:12 +00:00
Marc Mutz
a4fc6a3047 QXmlAttributes: mark as shared-come-qt6
Requires adding a member-swap() function.

Change-Id: I47f9fac84a6f41bb1e487c27fdcf6879b5a771d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 06:25:54 +00:00
Tor Arne Vestbø
e8c8c9fea7 Exclude tst_QSettings::rainersSyncBugOnMac() on all Apple OSes
It fails on iOS as well, and likely also tvOS and watchOS.

Change-Id: Idfce98a5aeccb5680f6b4c6e66b526dd7922156d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-03 21:40:33 +00:00
Marc Mutz
3b5107a118 Speed up compilation of tst_qgraphicsview_2.cpp
Turn the list of newRow() calls into a for loop over a constexpr
data structure.

Fixes the GCC note:

   tst_qgraphicsview_2.cpp:47:13: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without

and speeds up compilation of the file from 13s to 2.5s on my
machine.

Task-number: QTBUG-38890
Change-Id: I4f0b3565c7df64b286d1d32eb3f3d6bf4df92609
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-03 14:59:56 +00:00
Albert Astals Cid
c62f717226 Fix signal code generation
The old code is broken because it was passing signal.outputArgs as inputArgs
variable of writeArgList, fix can not be passing signal.outputArgs as outputArgs
of writeArgList since that ignores the first of the list, so i added a new function
that does the right thing

Change-Id: If54484e04880d5dcebfedb9d478ee0e9faf37baa
Task-number: QTBUG-21577
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-03 14:01:33 +00:00