Commit Graph

31927 Commits

Author SHA1 Message Date
Liang Qi
0c034a649f Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/widgets/widgets/qpushbutton.cpp

Change-Id: I615de00e6e64540c50f658d4d8ab3e002d701a81
2017-03-14 10:52:24 +01: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
Jake Petroules
2162f01111 Remove some redundant code in QAction
Only 2 bits are needed to represent -1, 0, and 1 in a signed integer,
and !(n != -1) implies n == -1 so the second condition was redundant.

Change-Id: I200a17fe4e49ebc0eaa9a1988b4625267cef61a4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-14 05:29:27 +00:00
Jake Petroules
c2c3452ba5 Add new API to control whether shortcuts are shown in context menus
Shortcuts are universally not shown on macOS or mobile platforms, making
applications look very obviously out of place.

Windows and GNOME desktop environments almost never use them.

Only KDE appears to do so commonly; default accordingly.

Task-number: QTBUG-49435
Change-Id: Ieac4cee57b15a02be5258f3d07749af6316af62b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-14 05:29:22 +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
Albert Astals Cid
b6e3fd8ced Remove QPlatformDrag::platformDropData
Its only uses were:
 * Call it to just store it in QDragManager::QDragManager
 * qnsview.mm calls it but since it knows it's a QCocoaDrag it can just call a function of that class directly
 * qxcbdrag.cpp calls it but since it basically was calling itself can just use the class member directly

Change-Id: Ic7797c877d77f944a1212a7ea01173393bf903fe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-13 16:10:44 +00:00
Dan Cape
4f324d4655 Fix item keeping hover highlight even when mouse has left it
Made change to clear the hover index when the mouse leaves the widget.
This will ensure the component does not think the item still has the
mouse over it.

Task-number: QTBUG-46785
Change-Id: I34b7f0e171e9cf07ca23150af1b0e6e59a10a58a
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-13 15:47:10 +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
Samuli Piippo
edf0be818c Use lowercase name for iphlpapi library
Cross-compilation on linux with mingw-w64 failed, since it provides
all libraries in lowercase name.

Change-Id: I8e82a4504d4ec9d3047af6b1d6a11945754f182d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-03-13 09:39:19 +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
Jake Petroules
c0da37a806 Fix QStandardPaths values on Apple Platforms containing URL encoding
This corrects an issue where the file system paths returned for some
QStandardPaths values on Apple Platforms would be URL encoded, for
example having %20 instead of an actual space character.

Task-number: QTBUG-59389
Change-Id: I771a44eb20b756842c324ac6fc9bdc475ce84826
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-11 02:10:10 +00:00
Olivier Goffart
b52b509ae4 QLockFile: Don't deadlock if the lock file has a mtime in the future
Stale Lock files in the future can happen in some situations. For exemple
two computers with different clocks access the same file system. It could
be that one of the timestamp is totaly off (several years into the future).

[ChangeLog][QtCore][QLockFile] Fixed a deadlock occurring if a corrupted
lock file's modification time is in the future.

Change-Id: I8dac98a0e898c76bcef67f8c195e126c996b6add
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-10 17:09:24 +00:00
Gatis Paeglis
d55e3bdced xcb: remove code and macros related to Q_XCB_DEBUG
... early spring-cleaning, leaving one block of virtual
root debug code that was inappropriately conditioned on
Q_XCB_DEBUG; it now gets its own define.

Removed Q_XCB_CALL:
1) I don't know anyone who actually uses it.
2) Enabling this feature (via Q_XCB_DEBUG) fails to build
   (and has been like that for about 1 year).
3) There are better ways to debug X11 client message exchange
   (see xtrace for example).
4) Using Q_XCB_CALL is a very fragile approach. Grep for
   example for xcb_change_property and you will see that
   half of the calls are not wrapped with the Q_XCB_CALL
   macro.

This patch also removes the Q_XCB_NOOP macro. It's unclear
what its purpose was. There was a TODO comment in qxcbeglcontext.h
suggesting removal of this macro as well.  Its evaluation of its
parameter, even without Q_XCB_DEBUG, had no side-effects, so its
removal should be harmless.

Change-Id: I9fa48af454061d8b38f69f308131647cd18f85f4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-03-10 10:24:48 +00:00
Kevin Funk
137e6632c8 qlalr: Use forward slashes in #include directives
Makes sure we don't use backslashes on Windows systems, which could lead
to the following warnings being emitted:

In file included from main.cpp:43:0:
repparser.h:2:10: warning: unknown escape sequence: '\.'
  #line 57 "..\..\src\repparser\parser.g"

caused by lines like
  #line 57 "..\..\src\\repparser\parser.g"

Change-Id: I6cfe0e39a2a58eb39f9d385ece30374bcfa09e05
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-10 08:47:19 +00:00
Marc Mutz
5cc0de2e08 QAtomic: pass explicit failure memory order to std::atomic::compare_exchange_strong
GCC 4.8 seems to get the failure memory order wrong when using the
overload that only accepts one memory order and produces errors such
as:

  bits/atomic_base.h:577:70: error: failure memory model cannot be stronger than success memory model for '__atomic_compare_exchange'
  return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
                                                                      ^
(as seen on Android).

Fix by explicitly passing the failure orders corresponding to the
success orders, as specified by the standard:

 relaxed → relaxed
 release → relaxed
 acquire → acquire
 acq_rel → acquire

(cf. http://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange).

Task-number: QTBUG-59399
Change-Id: If046e735888cf331d2d6506d8d5ca9aa7402f9ad
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-03-10 08:24:41 +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
Edward Welbourne
9ed389bf15 Bugfix in QDateTimeParser's findTextEntry()
If a later month-or-day were to have a name that's a prefix of an
earlier one's name, the code would have selected the longer name as
best match when the text matched is the shorter name, simply because
it found that one first.  (Found, on Turkish Cuma(rtesi)? in Thiago's
recent new test, by reversing the loop that iterated the list.)

Make an exact match win and a match of a full name beat any prefix
match of the same length.

Change-Id: I8d954b83ccc25e4f47af2e558036d714685cef5e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-09 19:27:13 +00:00
Edward Welbourne
326f1fdb7d Simplify QDateTimeParser's shiny new findTextEntry()
Decouple from the callers' offset into a larger list; just search for
an entry in a list, let the caller deal with the offset.  Also, defer
a .tolower() to save the need to allocate a copy of each list entry.

Change-Id: I748d5214c2cc6dc592fe2bd41e3f8150f71c335b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-09 19:27:06 +00:00
Marc Mutz
1567a7c0f4 Use new QSemaphoreReleaser in tst_QThreadPool
... replacing a hand-rolled version there.

Change-Id: I0db50acd1ecf591d608eb719021a6fcd06aeb226
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-09 19:04:33 +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
Andy Shaw
65bafcc29d Android: Enable the usage of QPrinter
Since QPrinter can be used to write to PDF and this was working in
previous versions, there is no reason not to enable it here.

Task-number: QTBUG-58376
Change-Id: I5760b74881995679e8df657b7d770bba00a33551
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-09 11:04:03 +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
Jake Petroules
07ec102195 Introduce SH_TitleBar_ShowToolTipsOnButtons style hint
This removes some tight coupling between QMdiSubWindow and
QMacStyle in order to allow the latter to be moved into a plugin.

Change-Id: I090c2c5774279c0454486c3db2e77f00a646b145
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-08 20:51:01 +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
Thiago Macieira
7fd483f3de QDateTimeParser: Merge the code to parse names of months and weekdays
Simplifies everything and avoids bugfixes in one not propagating to the
other.

Change-Id: I95c9e502ccc74af3bcf0fffd14a69f0cde60cc8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-08 16:44:54 +00:00
Kevin Funk
375bbcdd01 qlalr: Fix and re-run qlalr on its own sources
So the generated files are up-to-date again.

Generated with:
  qlalr --qt --no-lines --no-debug lalr.g

Change-Id: I3c4adb0083be7e66fed3db92c079493b574295aa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-08 15:05:55 +00:00
Timur Pocheptsov
8b9d246225 QHttpNetworkConnection: fall back gracefully to HTTP/1.1
Both SPDY and HTTP/2 work with a single qhttpnetworkchannel (and this means one
socket per qhttpnetworkconnection). Normally, HTTP/1.1 connection is using up to 6
channels/sockets though. At the moment a failure to negotiate SPDY/HTTP/2 leaves us
with a downgraded HTTP/1.1 connection (with only one channel vs. default 6).
Since we initialize channels (and establish connections) in a 'lazy' manner
it's ok to pre-allocate all 6 channels and then either use 1 (if SPDY/HTTP/2
indeed was negotiated) or switch back to 6 in case of failure.

Change-Id: Ia6c3061463c4d634aaed05ce0dde47bfb5e24dd8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-03-08 14:14:26 +00:00
Marc Mutz
8f52ad9fe0 ucstricmp: compare null and empty strings equal
For consistency with ucstrcmp(), which does the same.

Before, the two overloads would sort null before empty strings. This
behavior was removed in Qt 3.0, IIRC-

This does not yet change anything, as all callers seem to work around
the problem by handling null strings before calling this function
(directly or indirectly). We would have seen a failure crop up if it
wasn't so.

As soon as we use these functions to compare QStringViews, however,
the functions need to deal correctly with a nullptr lhs and/or rhs, so
fix them.

Change-Id: Ie4e417aade993213169b96b5e7351850c52ae733
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-08 13:11:13 +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