Commit Graph

36366 Commits

Author SHA1 Message Date
Kari Oikarinen
2fc274ddb5 Skip tst_QProcess::processesInMultipleThreads under QEMU
tst_QProcess hangs sometimes in QEMU. Based on my experiments in a debug VM the
offending test seems to be processesInMultipleThreads(), since that was were I
was able to reproduce the hanging in.

Since the whole test executable hangs, blacklisting is not enough, so skip the
test.

Task-number: QTBUG-67760
Change-Id: I34f8852be955a8612deac22b369f68d79a139d11
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-05-14 12:36:33 +00:00
Andy Shaw
bb6ba17019 Treat the Content-Disposition header as a known header
Change-Id: I307f67b10759d17f603a340b14266ab47d195497
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-14 12:36:32 +00:00
Kari Oikarinen
3909d37cb7 tests: Include QFileInfo in emulationdetector.h
Otherwise using it later is a compile error on ARM if no header including it has
been included before.

Change-Id: I422eeb948da4a22bc3f649daff39740703039372
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-05-14 12:36:28 +00:00
Jüri Valdmann
8e47474baf QJsonDocument: Avoid overflow of string lengths
The added test case contains the binary JSON equivalent of

    ["ž"]

with the modification that the string's length has been set to INT_MAX. In
Value::usedStorage this length is used through the pointer d like so

    s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d);

Because 2 * INT_MAX is UINT_MAX-1, the expression as a whole evaluates to 2,
which is considered a valid storage size. However, when converting this binary
JSON into ordinary JSON we will attempt to construct a QString of length
INT_MAX.

Fixed by using String::isValid instead of Value::usedStorage. This method
already takes care to avoid the overflow problem. Additionally, I've tried in
this patch to clarify the behavior of Value::isValid a bit by writing it in a
style that is hopefully more amenable to structural induction.

Finally, the test case added in my previous patch had the wrong file extension
and is renamed in this one.

Task-number: QTBUG-61969
Change-Id: I45d891f2467a71d8d105822ef7eb1a73c3efa67a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-14 10:52:47 +00:00
Kari Oikarinen
bff2101994 tests/auto/widgets/dialogs: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I679a0f482ec2c3ed5d896f1c40c67d9932c6fc18
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-14 10:39:00 +00:00
Morten Johan Sørvig
432df3f8c8 Vulkan: share library loading implementation
The macOS, Windows, and XCB implementations are identical
and can be moved to QBasicPlatformVulkanInstance.

Change-Id: Id84b27ffd87f86afe3798c4ad2743ba05e6190d3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-14 09:32:48 +00:00
Morten Johan Sørvig
fec8a9323b Vulkan: Share destroySurface() implementation
The macOS, Windows, and XCB implementations are identical
and can be moved to QBasicPlatformVulkanInstance.

Change-Id: I1380b2bd03080710084a1458bdce3a362ba5c287
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-14 09:32:43 +00:00
Kari Oikarinen
627de835b1 tests/auto/widgets/graphicsview: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: Ibbcf5bf968fcf1b1c3a043c805bdcc23a4005f00
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-05-14 06:05:19 +00:00
Thiago Macieira
6eef81ee1c QFileSystemEngine: don't try to use statx(2) if SYS_statx isn't defined
If glibc's <unistd.h> does not define SYS_statx but <linux/stat.h> did
define struct statx and related constants, we failed to compile.

Task-number: QTBUG-68205
Change-Id: I04a43ee94975482f9e32fffd151e66bbe6988554
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-14 04:46:28 +00:00
Thiago Macieira
69e0393399 QByteArray::setNum: use the existing latin1 lowercasing table
Not sure this makes the code faster, but it removes two functions.

Change-Id: I5d0ee9389a794d80983efffd152d830da44b1bfe
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-13 22:39:26 +00:00
Christoph Keller
8c029e98bf Fix build of applications on iOS
When QMAKE_TARGET_BUNDLE_PREFIX is set in the .pro file then
this value should be used instead of the default value for
PRODUCT_BUNDLE_IDENTIFIER. Therefore, PRODUCT_BUNDLE_IDENTIFIER
should be set inside default_post.prf so that it can take the
value of QMAKE_TARGET_BUNDLE_PREFIX after it may have been set.

Task-number: QTBUG-66462
Change-Id: Iec1e2a43632efe6021b9d6bfdb78bd941326c456
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-05-13 08:48:53 +00:00
Christian Ehrlicher
d02e7b46a1 QTableWidgetItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QTableWidgetItem setData() function

Task-number: QTBUG-48295
Change-Id: I82289b6db78eeef09d586da267046032984952da
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-12 05:22:13 +00:00
Christian Ehrlicher
5adf18909d QStyleSheet: fix typo in propertyNameForStandardPixmap for discard
The property name for SP_DialogDiscardButton is missing the 'dialog-'
prefix to match the property described in knownStyleHints.

Task-number: QTBUG-58674
Change-Id: Ie5b7412765e19defb3644d7cac2fe08bf8119a8d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-12 05:22:09 +00:00
Eirik Aavitsland
9c1290cecb Doc: add explanation of return format of QImage::transformed()
QImage::transformed() can sometimes return an image with a different
image format than the original. This might be unexpected, so explain
it in the doc.

Task-number: QTBUG-50087
Change-Id: I165fc7b44439b770b542be52d3108fd70bf0ae99
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-11 10:31:01 +00:00
Morten Johan Sørvig
ee60a044c9 macOS: Add QSurfaceType::MetalSurface
Add API to activate previously added Metal layer implementation.
This provides minimal support, and unlike VulkanSurface
there is no separate QWindow subclass.

What this does do is configure the QWindow to use a
Metal layer, and to send expose/update events when
the layer content should be redrawn. Qt will also update
the layer’s drawableSize and contentsScale when needed.

Application code can make use of this by accessing
the QWindow layer, which will be a CAMetalLayer:

  CAMetalLayer *metalLayer = reinterpret_cast<CAMetalLayer *>(
    reinterpret_cast<NSView *>(window->winId()).layer);

Change-Id: I514f5186133c3e610fd4e53ca91fe9c85c6d016e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-11 09:13:55 +00:00
Mårten Nordheim
5134ff882a OpenSSL v1.1.1: fix qtbug18498_peek
Previously the test worked because the client was the last party to know
when encryption was established. However, due to changes in the TLSv1.3
handshake the server is now the last one.

In either case, relying on both to be encrypted when one of them is
finished is not great, so now we only quit the event loop when both
client and server have emitted 'encrypted'.

Change-Id: Ic1fc75671206d866f7ea983805fd58a99657aac6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-11 08:42:17 +00:00
Mårten Nordheim
1332cca091 QWindowsCARootFetcher: fix compile with QSSLSOCKET_DEBUG
Didn't compile with it when I was moving it out.

Change-Id: I3645af71ea3295a61f20000a6bc4716b6e996ce5
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-11 07:04:36 +00:00
Thiago Macieira
68e6d64fe3 QString: fix off-by-one error
The check for having N valid characters is ptr + N <= end, because
ptr + N == end indicates that we have exactly N characters in the
string.

Change-Id: I5d0ee9389a794d80983efffd152d28d5aa485ce4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-05-10 17:34:45 +00:00
Christian Ehrlicher
0993a9e830 tst_QHeaderView: replace custom waitFor() function
replace custom waitFor() function with QTest::qWaitFor() to avoid code
duplication.

Change-Id: I44ebcbfe4c6f6c6f787fb7dbaf958a245bc27fa1
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-05-10 14:03:27 +00:00
Christian Ehrlicher
f02256cce1 QHeaderView: reset cached size hint on reset()
QHeaderView::reset() did not reset the cached size hint which could lead
to wrong geometries when the model was reset.

Task-number: QTBUG-67927
Change-Id: I5100b28a741cc816133a229c422f9abf83f2187e
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-05-10 14:03:24 +00:00
Christian Ehrlicher
d2573f4dbd Enable checks for tst_QHeaderView::sectionSizeHint()
tst_QHeaderView::sectionSizeHint() did set some values but did not check
the return values.

Change-Id: Id606d7a06935a3d6783bc9a8c10bf05d953adec6
Reviewed-by: David Faure <david.faure@kdab.com>
2018-05-10 05:07:08 +00:00
Christian Ehrlicher
fae53562ae QLineEdit example: fix link to QLineEdit::setInputMask
Fix a typo to properly link to setInputMask instead setMask.

Task-number: QTBUG-61775
Change-Id: I0cb00de8dcaece613467e25b41e93661d6e98308
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-09 17:45:29 +00:00
Andre de la Rocha
e0a6409ba7 Rename the tablet example to avoid triggering a bug in tablet drivers
It seems there is a subtle bug in the Wacom tablet drivers for Windows that is
triggered in the very particular case where the running executable is named
"tablet.exe", regardless of its installation path. It causes WM_POINTER*
messages not to be delivered to the application, initially, but only after the
application's window is reselected, after another application's window had
been selected. It happens at least on Windows 10 systems with Wacom Bamboo
tablets and drivers, and was reproduced with non-Qt-based applications also.
It looks like a bad compatibility setting that makes "tablet" a cursed target
name for applications using tablet functionality. It seems older versions of
the drivers used to contain an executable with this name, although it seems to
be absent in newer versions. Unfortunately, the Qt tablet example uses this
name, which breaks it when used with upcoming WM_POINTER* messages support.

Change-Id: I931cc725b9117b4604267f7b0172110ae61700de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-05-09 15:34:18 +00:00
Kari Oikarinen
ebcc6687b0 Blacklist tst_QWidget::raise on openSUSE
The test occasionally gets an unexpected paint event on openSUSE.

Task-number: QTBUG-68175
Change-Id: I998d79dd12aac1f924c14d7ff7e864c4f081983c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-05-09 13:05:54 +00:00
Liang Qi
20a8d4d216 Merge "Merge remote-tracking branch 'origin/5.11.0' into 5.11" into refs/staging/5.11 2018-05-09 12:57:29 +00:00
Qt Forward Merge Bot
552c45bea9 Merge remote-tracking branch 'origin/5.11.0' into 5.11
Change-Id: Id6e2acd5e31c1ac858ddf1d8873a6f10694141de
2018-05-09 13:48:42 +02:00
Albert Astals Cid
22c0a157be cups: Fix UI mismatch when a default printer option choice is not available
It can happen that the user sets a default printer option choice,
using lpoptions or similar, and that is a mistake since
that choice is not available because it needs an installable option
that is not in the printer. We need to check that and set the internal
ppd option not to the value the user gave to lpoptions but to
something sane

Also rename foundMarkedOption to foundMarkedChoice since we're going
through all the choices of a given option in that loop

Change-Id: Ic9362d9b4fba33025c4d45eed8ddd203c95836bf
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-05-09 11:05:28 +00:00
Kari Oikarinen
7eab9ec63b Stabilize tst_QMdiArea::subWindowList
Flakily failed on openSUSE.

Task-number: QTBUG-68170
Change-Id: Ic75e081238ccf4bad54de39e6bdaa892796b599e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-09 09:58:04 +00:00
Gatis Paeglis
23d760d96f Revert "qbasicdrag: temporary restore obsolete APIs"
This reverts commit 0b815aa2f8.
Inter-module compile issues have been resolved now, see
qtwayland/44f3b888a3f88ac8097ff65aec0101dbe6a369ef.

Change-Id: I7f9ed4f9d5f0d6431493a8f47ffe8a85141f0e50
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-05-09 07:49:30 +00:00
Kari Oikarinen
e110ab6c28 tests/auto/widgets/itemviews: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: Id4fcb0c2e4f83edd9508565468e16f57e100c780
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-05-09 05:52:22 +00:00
Thiago Macieira
a2df0ef57a Fix build with GCC 8: memset/memcpy/memmove of non-trivials
qarraydataops.h:73:17: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type
‘struct TCBPoint’; use assignment or value-initialization instead [-Werror=class-memaccess]

Change-Id: I5d0ee9389a794d80983efffd152ce10eb557341f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2018-05-09 05:43:26 +00:00
Tasuku Suzuki
b32c0ecc4c Fix build without features.completer
Change-Id: Idc79921f85a920bc8c1280513ce78ee0cb00d415
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-05-09 00:21:33 +00:00
Liang Qi
40c83e43cc Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-05-08 20:15:22 +00:00
Liang Qi
b5a956601f Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
	tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro

Change-Id: I3169f709cc2a1b75007cb23c02c4c79b74feeb04
2018-05-08 20:43:45 +02:00
Oswald Buddenhagen
b9a578ebc6 configure: change convention of passing libraries to config tests
instead of pre-resolving them and passing the final LIBS to qmake, pass
raw QMAKE_*_LIBS* assignments and a QMAKE_USE stanza. the immediate
benefit of that is that it centralizes the debug/release lib handling,
which makes build variant overrides available to all libraries, not just
a few selected ones.

note that this removes the CONFIG+=build_all from the test projects.
turns out that this was ineffective to start with, as config tests are
built with an explicit CONFIG-=debug_and_release. we might re-instate it
in a non-broken way later on.

Change-Id: I2117c5b36937e8230bd571dcee83231515cbe30b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-05-08 18:17:29 +00:00
Friedemann Kleint
1b7337d23d qlalr: Fix startup crash in static builds
Replace the global variables qout, qerr by a functions to delay
the initialization.

Task-number: QTBUG-68166
Change-Id: Ib023da1bccc7eabc6e633ccb8945e5f209c5765e
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-05-08 15:19:14 +00:00
Oswald Buddenhagen
290f953253 configure: centralize shell-quoting of tests' .literal_args field
this de-noises the code somewhat, and makes it possible to eval() the
code generated by $$qtConfLibraryArgs(), which we want to do later.

Change-Id: Ib6101c6745101801e34f8fab1ad6651e624130c7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-05-08 12:50:04 +00:00
Edward Welbourne
fec96d9a9f Remove mention of selftest.qrc from generator script's doc
This supplements b1945604a7, which
removed the qrc file in favor of test/test.pro coding for it.

Change-Id: I15507c89ca14fa6e6b8223de671ffff7092272d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-08 12:45:25 +00:00
Kari Oikarinen
c580644fe9 tests/auto/network: Avoid unconditional qWait()s
Replace with QSignalSpy or QTRY_COMPARE when possible.

Task-number: QTBUG-63992
Change-Id: I18dc8837301424855487a12ee62451a5aeb21bf0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-08 12:35:40 +00:00
Mikhail Svetkin
c427ba53aa macOS: Transition to new QPA dag-and-drop API
The new API allows us to pass the mouse buttons and
keyboard modifiers along with the QWSI event.

Task-number: QTBUG-57168
Change-Id: Ic54c012d1593d922e7dcd31facab2f2c630c7996
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-08 11:39:32 +00:00
Morten Johan Sørvig
60457e6cd0 macOS: Experimental Vulkan support via MoltenVK
Add support for QSurface::VulkanSurface and QVulkanWindow.

Usage:
  1) Build MoltenVK according to instructions
  2) Configure Qt: ./configure -I /path/to/MoltenVK/Package/Release/MoltenVK/include
  3) export QT_VULKAN_LIB=/path/to/MoltenVK/Package/Release/MoltenVK/macOS/libMoltenVK.

Implement support for QSurface::VulkanSurface by enabling
layer mode for QNSView and then creating a CAMetalLayer,
which the MoltenVK translation layer can run on.

MoltenVK provides an implementation of the Vulcan API,
which means that the platform integration is similar
to other platforms: implement a QCocoaVulkanInstance
where we pass the QNSView instance to the vkCreateMacOSSurfaceMVK
Vulkan surface constructor function.

Using Vulkan directly without QVulkanWindow is possible, but not
tested.

We currently load libMoltenVK at run-time and use the
existing QT_VULKAN_LIB environment variable to set its
path. For deployment purposes it would be better to
link against MoltenVK.frameworkm, but this

Task-number: QTBUG-66966
Change-Id: I04ec6289c40b199dca9fed32902b5d2ad4e9c030
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-05-08 11:27:26 +00:00
Friedemann Kleint
09d4faa008 QtGui: Enable synchronous delivery for QWSysIf:::WindowScreenChangedEvent
Task-number: QTBUG-67777
Change-Id: I6d52b650fb33283010ef06259da83cdb2fd3483f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-08 09:22:03 +00:00
Gatis Paeglis
0b815aa2f8 qbasicdrag: temporary restore obsolete APIs
... that were removed in 10b3286313.

This is needed so we can properly resolved inter module
dependencies (update qtwayland to use the new API).

Task-number: QTBUG-68151
Change-Id: If9c3b42f76bd2c1d8fc86304cfcc22c18bad9e27
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-05-08 07:36:49 +00:00
Friedemann Kleint
d4aef80525 Windows QPA: Improve debug output of keyboard shortcut handling
Add a debug operator for KeyboardLayoutItem
and output keys in QWindowsKeyMapper::possibleKeys().

Change-Id: I28215f44da2a9c08a27541ef0e906d37be2bad72
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-05-08 06:57:23 +00:00
Friedemann Kleint
807f819357 Manual dialogs test: Add about dialog showing style and scaling
Change-Id: I8750956056466d3cfd99903fb5e432ac81223403
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-05-08 06:57:15 +00:00
Joni Poikelin
3a912e92bb Fix building with -no-feature-shortcut
Change-Id: I7576055a6d81d6a7a075ebff16ca6b0ced4e984e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-08 06:15:43 +00:00
Tasuku Suzuki
8f7dcba204 Fix build without features.timezone
Change-Id: I3f8421103afa61baf415636b4dc8cf93fb477bcc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-05-08 01:59:08 +00:00
Allan Sandfeld Jensen
910785a77a Get rid of argb32->argb32pm routines in qimage
We already have better optimized versions in drawhelper. Removing
these versions is a performance gain.

Change-Id: I431c74e440529648d9bc5e22c0e700a72d376934
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-07 17:59:31 +00:00
Allan Sandfeld Jensen
a18370cbed Optimize intermediate_adder_avx2
Use 16-bit multiplication as it is twice as fast as 32-bit
multiplication.

Change-Id: I64b529eaaed4ce2c59c64a0120e93cd132724156
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-07 15:22:36 +00:00
Mitch Curtis
4c92fce761 Fix order of mouse selftest in selftests.pri
Put it in alphabetical order like the rest of the list.

Change-Id: I3da3bb68d1847f53419bb79490b946c935ebb518
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-05-07 14:53:26 +00:00