Commit Graph

31690 Commits

Author SHA1 Message Date
Serge Lysenko
9ef14bcc3a Fix Windows DnD: Wrong qApp mouse buttons state after external DnD
An QApplication::mouseButtons() value could stay outdated after external
DnD operations, e.g. dragging an object outside Qt application or vice
versa. Also user can cancel DnD with Escape key.

Task-number: QTBUG-55885
Task-number: QTBUG-59539
Change-Id: Ia6deb4ae5ccfe77e6d6c2464de40cd06fc71f9b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-18 17:08:42 +00:00
Oleg Yadrov
38a55c7813 QCocoaWindow: fix geometry issue when only minimumSize is set
When only minimumSize was set and it matched to the size NSView was
created with, viewDidChangeFrame() was not called for the window and
it's internal geometry value was still (0, 0) what led to unpleasant
side effects such as QML content was not displayed until something
caused an update.

Task-number: QTBUG-58963
Change-Id: Ib12d36d405969971e7ff62b79b50c3d78928a649
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2017-03-18 16:42:01 +00:00
Anton Kudryavtsev
949bce97d0 QString: de-deplicate code of leftRef, rightRef, midRef
Re-use methods of QStringRef.

Change-Id: I5ff719c08c54246e9cafd4f9aa0823ff6df8433b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-18 06:51:24 +00:00
Allan Sandfeld Jensen
6cd8a90d29 Include missing errno.h
Fixes linux-clang-libc++ builds.

Change-Id: Id75c35d858123193e7d29b0bbb113d2c109a7560
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-18 00:50:37 +00:00
Olivier Goffart
7eeb88a5cd When changing screen, only update the font if dpi has changed
Generally, this might avoid unnecessary work in a quite common case.

But if high dpi scaling is set, the dpi (in logical pixels) does
not change. However this event is sent before
QGuiApplicationPrivate::processWindowScreenChangedEvent has had
time to change the geometry, and might cause a problem in QMenu

Amends f3a4b4258f.

Task-number: QTBUG-59484
Change-Id: Ie4ceedcb0754613cf239ae86b225c4139b70d0cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-17 23:14:09 +00:00
Marc Mutz
93a4bf5c8b Blacklist also tst_QSemaphore::tryAcquireWithTimeout(2s)
It has started failing recently on the CI, too.

Task-number: QTBUG-58745
Change-Id: I4c8834917e6455d00c300549ed448b06da75d5bc
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2017-03-17 20:19:20 +00:00
Jesus Fernandez
346cd79192 Make QFile::open fail when using an invalid file name
Fixes the bug in QFile which allowed opening a file with reserved
characters in its name.  If the name is a long file path, CreateFile
opens a file with a truncated name instead of failing, so we have
to catch reserved characters ourselves.

[ChangeLog][Windows] Fixed a bug that caused QFile to create
files with truncated names if the file name was invalid. Now,
QFile::open correctly fails to create such files.

Task-number: QTBUG-57023
Change-Id: I01d5a7132054cecdfa839d0b8de06460039248a3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-17 11:06:43 +00:00
Gabriel de Dietrich
99adabdb7e QNSView: Harden logic around platform window access
Some users have reported crashes in -[QNSView mouseEnteredImpl:]
which we believe are due to null m_platformWindow. The stack
traces are like the one below or similar:

    0 libqcocoa_dylib   QNSView                 mouseEnteredImpl_ 0x1F
    1 appkit            NSTrackingArea          _dispatchMouseEntered_ 0xA2
    2 appkit            NSApplication           sendEvent_ 0xF4D
    3 libqcocoa_dylib   QNSApplication          sendEvent_ 0x4E
    4 libqcocoa_dylib   QCocoaEventDispatcher   processEvents 0x184
    5 qtcore            QEventLoop              exec 0x19C
    6 qtwidgets         QDialog                 exec 0x20B

Moreover, since 2f505b79a4, that
member is a QPointer, so we should do more systematic checks.

Change-Id: Iced447515a4ae07a62734e587f5b08d46d313071
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-03-16 21:41:52 +00:00
Jeremy Katz
3e0355014e warn of blacklisted GLX OpenGL renderers and vendors
Notify users when multithreaded OpenGL is disabled due to the
renderer or vendor blacklist.

Change-Id: I16a80568afe87b227575102ca839f18050613e90
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-03-16 18:55:52 +00:00
Allan Sandfeld Jensen
3f0ceb91f8 Add lancelot test to exercise tiled non-ARGB32PM bilinear filtering
No test were hitting the code path for tiled non-ARGB32PM bilinear
filtered scaling. In part because we were only using brushes in pixmap
mode which are always converted to RGB32 or ARGB32PM.

Change-Id: Ib466567f31ce6ee894acdf484d44b3af62dad6fc
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-03-16 13:46:17 +00:00
Timur Pocheptsov
3e3defb5c3 Secure Transport - add a missing cipher
Secure Transport supports more ciphers then we can convert into QSslCipher.
This results in our tests failing, since after the successful SSL handshake
sessionCipher is 'unknown'. This patch adds missing AES256-GCM-SHA384 and also,
to make new cipher addition easier in future, sorts cipher suites as it's done
in CipherSuite.h (ST framework's header) - grouped by RFC they were introduced
in + sorted within their group.

As a bonus (thanks to Eddy for spotting this problem) - some copy & paste (?)
typos were fixed (mismatched names).

Task-number: QTBUG-59480
Change-Id: I61e984da8b37f1c0787305a26fc289e2e7c2b4ad
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-03-16 08:50:12 +00:00
Thiago Macieira
fb061e586d uic & rcc: use the public API to set the hash seed
Instead of relying on a private symbol exported from QtCore.

Task-number: QTBUG-47566
Change-Id: I4a7dc1fe14154695b968fffd14abd2b21a18203b
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-16 05:05:00 +00:00
Tor Arne Vestbø
5e18f4ce0b Skip tst_MacNativeEvents::testChildDialogInFrontOfModalParent()
Closing the dialog at the end of the test ends the modal session via
QCocoaEventDispatcherPrivate::endModalSession(), but the actual ending
of the session is deferred to cleanupModalSessions(), and that is never called.

The result is that QCocoaWindow::setVisible of the window in testKeyPressOnToplevel
and following tests ends up calling [m_nsWindow orderFront:nil]; instead of
[m_nsWindow makeKeyAndOrderFront:nil];, leaving the window inactive and the
tests failing.

Task-number: QTBUG-58474
Change-Id: If66b2e201f658b627c2ec50a562938f59a5037ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-03-15 13:51:41 +00:00
Olivier Goffart
7ac100ddd1 tst_QObject: Test if the new connect style works with multiple inheritance
Change-Id: I638630ef84a3aee98688dac000efd3dfa7472175
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-14 13:55:36 +00:00
Shawn Rutledge
35c8a21fe4 QTabletEvent manual test: add quit shortcut
Change-Id: I73012ec2d02856e5bbbc27d269f89b3918dd7c2d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-03-14 09:11:59 +00:00
Shawn Rutledge
68009a7d43 QTabletEvent manual test: show keyboard modifiers
Task-number: QTBUG-59415
Change-Id: Ibb7ebc29797712535d82c6eb02c78dc28ad4131d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-03-14 09:11:54 +00:00
Shawn Rutledge
550d7930d1 xcb: send keyboard modifiers with every QTabletEvent
Task-number: QTBUG-59415
Change-Id: If64a6513131fd85189e3621cb2a105e80e919ecf
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-03-14 09:11:44 +00:00
Marc Mutz
e83247a2b9 Do not assume QStringRef(const QString*) to be implicit
It won't be for very much longer.

Change-Id: I30e3e0cd8c8ecf0833f759557382a3ded7bdea34
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-14 05:42:08 +00:00
Liang Qi
77e71dac16 Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-03-13 19:45:20 +00:00
Joerg Bornemann
70e772079f Fix parsing of the /utf8 MSVC compiler flag in VS project generator
Adding the /utf8 compiler flag resulted in undefining all preprocessor
symbols for VS project files, because the ingenious compiler option
parsing logic checked for a 'u' prefix, and "utf8" obviously matched.

The /utf8 flag is added to the additional options, because there doesn't
seem to be an XML tag for that.

Task-number: QTBUG-59431
Change-Id: I762fcdcf6caf0606b40633861e265df5edb4a9c4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-13 16:43:21 +00:00
Liang Qi
d51c3ecf8e Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	examples/network/network.pro
	mkspecs/features/mac/default_post.prf
	src/corelib/io/qfilesystemengine_win.cpp
	src/corelib/io/qprocess.cpp
	src/corelib/io/qprocess.h
	src/corelib/io/qprocess_p.h
	src/corelib/io/qprocess_unix.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/thread/qmutex.cpp
	src/platformsupport/fontdatabases/windows/windows.pri
	src/plugins/platforms/eglfs/eglfsdeviceintegration.pro
	tests/auto/corelib/io/io.pro

Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
2017-03-13 15:55:44 +01:00
Olivier Goffart
16d1ddfc42 moc: Support signals that return movable-only type
By adding std::move where it makes sense.
This is not only good for move-only types, but for any type which
can be moved as it saves copies of the return value in any case.

[ChangeLog][moc] Move-only types are now supported as return types
of signals and slots.

Change-Id: Idc9453af993e7574a6bddd4a87210eddd3da48a9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-13 11:03:47 +00:00
Eirik Aavitsland
0d287500be xpm image format: Reject corrupt images with invalid header info
The xpm handler did not properly check that the information read from
the file header was sane.

Task-number: QTBUG-59211
Change-Id: I84099777a16b2b0c473d139f5fdec1d0cb5d515e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-13 11:15:17 +00:00
Ulf Hermann
2f10a6f04e Suppress -Wfloat-equal when defining float16 equality operators
Change-Id: Ie30fa13eb5f8eb44f0c9c21e9483c8aba40cec02
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-13 11:00:27 +00:00
Allan Sandfeld Jensen
13cfa3c88b Clean-up QRgba64 constructors
We can add basic constructors now on all supported platforms, and can
make initialization consistent on all platforms, choosing undefined
as the default.

Note this changes behavior on gcc and clang builds, but is consistent
with pre-c++11 gcc and clang builds and with msvc.

[ChangeLog][QtGui][QRgba64] The default constructor on Clang and GCC
 builds now no longer initializes with 0s, but leaves the value
 uninitialized. This is consistent with MSVC behavior and pre-C++11
 behavior of GCC and Clang.

Change-Id: Ib0e3d7f4274a13a768db62931b67877e3898945e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-13 10:46:29 +00:00
Olivier Goffart
8c0194f763 moc: put the QPrivateSignal argument in the arg array
Even if it is normaly not used, templated code might still try to access it

Task-number: QTBUG-59414
Change-Id: I9f7aadd714843059c8f89cdac48c60a3e2ca7294
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-13 10:28:42 +00:00
Sze Howe Koh
d8a123841c Doc: Add links to the signal-slot syntaxes page
Change-Id: I5443a09d18ada6de16a5cec503523b7cc284b0dc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-13 09:34:58 +00:00
Marc Mutz
b950d9b10f QGuiApplication: fix QString comparison
The code compared a QString* with a QString, which only compiled
because the QStringRef(const QString*) ctor was implicit. We're going
to fix that, and it's nice to see that the change exposes bugs like
this one.

The fix is to deref the QString* argument, which we know from previous
checks to be non-nullptr, to enable normal QString/QString comparison.

Change-Id: Idc7b214cb26e8b7c18ee1ba0a2b7236f814f0810
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-13 09:11:32 +00:00
Stephan Binner
d08deb0b4a Add feature.abstractbutton
Change-Id: Ie93c6d0a8256bc466d3419408b753d5f3738aa6b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-13 08:57:54 +00:00
Vikas Pachdha
f06f1adb6c Add QMake variables for development team and provisioning profile
Adding both development team and provisioning profile to Xcode
switches off the automatic signing

Task-number: QTBUG-38782
Change-Id: Ic869e16490c11e369b6674c815e860cac66c5afa
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-03-13 06:42:15 +00:00
Marc Mutz
75f5e2bef2 Deprecate QString::null
It's a Qt 3 compatibility vehicle, and as such inherits the now-alien
property to distinguish empty and null strings. Particularly worrisome
is the following asymmetry:

   QString("") == QString::null          // false
   QString("") == QString(QString::null) // true

Instead of fixing this behavior, recognize that people might use it as
a weird way to call isNull(), albeit one that once was idiomatic, and
simply deprecate everything that deals with QString::null.

[ChangeLog][QtCore][QString] QString::null is now deprecated. When
used to construct a QString, use QString() instead. When used to
compare to a QString, replace with QString::isNull().

Change-Id: I9f7e84a92522c75666da15f49324c500ae93af42
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
2017-03-12 17:41:16 +00:00
Oleg Yadrov
63a39927a0 QMacStyle: fix QTabBar tab size
A few small visual issues were introduced during recent QTabBar
restyling (see 175f33ed85)

Change-Id: Ifab8b9f24e2cad6e1a827b1061471882a1bc9f5e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-11 04:33:48 +00:00
Topi Reinio
df40b1115d Doc: Ignore QT_SYSINFO_DEPRECATED_X
QSysInfo has a customized deprecation directive that QDoc needs to
ignore to generate documentation for the deprecated functionality.

Change-Id: I1c378f14a2f842f1e9a55614d43fe509bb77fd89
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-10 08:00:58 +00:00
Thiago Macieira
ef26467eb2 Reintroduce a directed QMetaType::typeName array
Commit fb376e0fcc removed an array that
facilitated returning the names of built-in types, to avoid the jump tables
from the switch statement. This commit brings it back but makes the array a
compile-time constant string offset table.

The array is created by way of a set of C++11 constexpr functions, so we
require that compiler feature. I've tested that MSVC 2015 does support
it as well as the ICC 17 when masquerading as MSVC 2015, so I've enabled
for that too. The only compiler left out is MSVC 2013.

If we didn't need to support MSVC 2015, this could have been written
more simply with C++14 relaxed constexpr.

This also adds unit tests to confirm that QMetaType::typeName() does
return null when we said it would. We're testing QMetaType::User-1
(which we'll likely never use) and QMetaType::LastWidgetsType-1 to
select something inside the range of the built-in types.

Task-number: QTBUG-58851
Change-Id: I4139d5f93dcb4b429ae9fffd14a33982891e2ac1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-09 14:56:35 +00:00
Paul Olav Tvete
f8218637e9 Build fix for -no-feature-slider
Change-Id: Ibd7d0c2182c6a11f6d595b6d1015ee7de2d35866
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-09 10:51:42 +00:00
Oleg Yadrov
175f33ed85 QMacStyle: update QTabBar style
Task-number: QTBUG-58266
Change-Id: I135e4dae44e2e97d73b7c7c97d8e682bcf459d75
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-08 18:39:01 +00:00
Olivier Goffart
5675334b6e moc: Add support for C++17 nested namespaces (N4230)
[ChangeLog][moc] Added Support for C++17 nested namespaces

Change-Id: Ib83fc5bf48f66546fa97b49710582fbf9c984503
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-08 17:34:38 +00:00
Olivier Goffart
11d60dcad6 moc: Fix parsing of digit separator
[ChangeLog][moc] Fixed parsing errors in presence of
C++14 digit separators.

Task-number: QTBUG-59351
Change-Id: Iea38ea7388853d84b819c2beb78a59371f57bf7d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-08 12:34:12 +00:00
Stephan Binner
b53d7664c9 Add feature.abstractslider
Change-Id: Ib5d0186162fc3b750e6440c74b1181787093ef97
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-08 12:05:43 +00:00
Topi Reinio
cf7d3b524d Doc: QSizePolicy: Fix documentation warnings
warning: Can't link to 'controlType()'
warning: Can't link to 'horizontalPolicy()'
warning: Can't link to 'verticalPolicy()'

Change-Id: I6b31acebf183defee7b4ab36976034ed4a3fc98a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-08 11:11:54 +00:00
Kai Koehne
8d11df83d4 Document QT_DEPRECATED_WARNINGS
Task-number: QTBUG-58468
Change-Id: I0f822c2dd14878d70b74ddd2db89b11ba54f687b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-03-08 09:45:09 +00:00
Allan Sandfeld Jensen
2e6ec59d47 Avoid QRgba64 arrays in the generic text-rendering routines
Like in other functions, allocate arrays of quint64 instead of QRgba64
to avoid the cost of initializing large arrays on every small scanline.

Change-Id: Ie132b3157003a18a444ca5c4f94ae668d17327fd
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-03-08 09:45:05 +00:00
Timur Pocheptsov
075e669cbe QHstsPolicy: Replace bool with QFlags
As pointed out in the previous code-review:

Replace a bool ctor parameter with QFlags<enum> to conform to
Qt API Design Principles (Boolean Parameter Trap).

Since the bool with its many unwanted implicit conversions is
gone from the ctor parameter list now, drop the explicit
keyword again. It was requested because of the boolean parameter
in the first place.

Change-Id: Ibaf287a6a3e38c22f033fd5d9e024c54f30a1fd4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-08 09:42:01 +00:00
Jocelyn Turcotte
8afc6146be Windows QPA: Better recover from removed screens when fullscreen
QWindowsWindow::handleResized would call isFullScreen_sys which checks
if the window's screen geometry matches the one of the window. When
switching back from fullscreen, Windows will have set the geometry to
fill the next window, but we don't switch QScreen until later in that
function, inside handleGeometryChange. This would result in our window
to take the whole screen geometry, but the FullScreen state wouldn't
be transferred to the new screen.

Fix the issue by using screenForGeometry and check if we are fullscreen
on any screen.

Also make sure that we check the validity of m_savedFrameGeometry when
restoring after a screen remove, since we would previously restore to an
area not covered by any screen anymore.

Change-Id: I43bc02738007918e9a26c1d27a699c51d3365034
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-08 09:23:44 +00:00
Paolo Angelelli
40ace7a2a0 Fix computegles31 example
This patch fixes the example that contained problems showing up
with mesa/nouveau drivers.

Change-Id: Ic90f6028e394138781f00bcc00c145c56134f441
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-03-08 09:19:39 +00:00
Friedemann Kleint
535b142393 QWidgetWindow::event(): Call base implementation for QEvent::WindowStateChange
The base implementation takes care of updating visibility and emitting
signals.

Task-number: QTBUG-59313
Change-Id: I270b37c894420902488d89dc0c79f4c12b8d9a29
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-08 09:04:03 +00:00
Andy Shaw
32463399f7 Add documentation for QMAKE_LINK variable
Change-Id: I39f11f42750c705feabf5e1a87bcd277693af1fb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-03-08 07:56:29 +00:00
Marc Mutz
da730c90a3 QStyleSheetStyle: introduce class Tampered<QPalette|QFont>
... as a replacement for two QPairs and move some common
QFont/QPalette functionality into it.

Change-Id: Iaab92130dd54eaa7900ac2048014a80cbd04bfb6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-08 07:19:53 +00:00
Thiago Macieira
3a1f4b186d Stop trying to discover the system timer resolution on Windows
Let's take the beginning of the description: WaitForSingleObjectEx can
be up to 16 milliseconds early. This is proven by the fact that there
are tests doing:

    wait(waitTime);
    QVERIFY(timer.elapsed() >= waitTime - systemTimersResolution);

and failing.

Task-number: QTBUG-59337
Change-Id: Iae839f6a131a4f0784bffffd14a9a79523d69d94
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-08 05:52:47 +00:00
Samuel Gaist
2d81968c3b Example: migrate treemodelcompleter example to use QRegularExpression
Update the treemodelcompleter example to use the new QRegularExpression
class in place of the deprecated QRegExp.

Change-Id: I9fa91ca6e847603de37019e4ca86fc69a51a3772
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-03-07 23:11:31 +00:00