Commit Graph

39721 Commits

Author SHA1 Message Date
Joerg Bornemann
0e71db3c8e Deduplicate initialization code for default variables
Use the writeDefaultVariables method also for the
Win32MakeFileGenerator. Remove the initializations that are already done
in Makefile::writeDefaultVariables.

Change-Id: I590cc5d7031de67dd830e6113849ab080dbf2325
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-16 11:36:36 +00:00
Joerg Bornemann
43a66453c5 Clean up class definitions of makefile generators
Remove pointless constructors and destructors.

Change-Id: I7aea8587bf3598b6f5324aac8898edf227475d63
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-16 11:36:22 +00:00
Allan Sandfeld Jensen
db525e6e9d Fix race in colorspace LUT generation
The old code did not prevent concurrent writes to the LUTs by separate
threads, each finding lutsGenerated to be false.

Let's consider whether the change is safe now: the storeRelease(1)
comes before the QMutex::unlock(), but since it is release semantics
no writes may be ordered past it. We have two releases, and their
order doesn't matter, since nothing else happens in-between.

Could we use a normal relaxed store? No, because the unlock() of the
mutex only synchronizes with the lock() of the same mutex, which
doesn't happen if the loadAcquire() succeeds. For loadAcquire() to
happen-before a write to the luts, we need a storeRelease() on the
atomic.

So, everything is correct, and minimal.

But maybe, to save the next reader from having to do the same mental
exercise again, add a manual locker.unlock() in front of the
storeRelease()?

Again no: that opens a gap where the luts are already generated on T0,
and the mutex unlocked, but the atomic not set. If another thread T1
gets to execute the function, it will enter the critical section, then
writing new values to the LUT. Meanwhile, the T0 sets generate to true
and a T2 enters the function, sees the final write from T0 and starts
using the luts -> data race with the writes concurrently done by T1.

Change-Id: Id278812a74b6e326e3ddf0dbcbb94b34766aa52e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-05-16 11:09:04 +00:00
Kai Pastor
a0d8fb4ac3 Fix mingw pkgconfig file and dependency naming
This change adds the correct suffix to debug mode .pc filenames for
MinGW and also to the Qt libraries listed in the `Requires` field.
The filename adjustment fixes the accidental overwriting of release
mode .pc files with the debug mode variant which required the wrong
variant of the libraries when `debug_and_release` is active.

Note that macOS also supports the `debug_and_release' configuration
but may use the regular library names together with DYLD_IMAGE_SUFFIX.
Creation of *_debug.pc files is turned off as they're identical to their
non-debug counterparts.

[ChangeLog][Platform Specific Changes][MinGW] Added a suffix to debug
mode pkgconfig files.

Task-number: QTBUG-4155
Change-Id: I221c2dae51d7bd011836cb03945631a43180d7b5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-05-16 11:03:40 +00:00
Joerg Bornemann
5641650993 Add -qtlibinfix-plugins for renaming Qt plugins according to QT_LIBINFIX
[ChangeLog][configure] Added the configure option -qtlibinfix-plugins
to rename plugins according to QT_LIBINFIX. This option is off by
default.

Fixes: QTBUG-15192
Change-Id: Id5b267e169ee143fc8f7abc6b27bc0ed5306406f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-16 06:22:25 +00:00
Frederik Gladhorn
77ad8dcfcc Enable tst_QWidget_window::tst_resize_count on Ubuntu 18.04
This test passes, according to our metrics it kept on failing on 16.04
and on OpenSuse.

This reverts commit d2015b4d06.

Change-Id: Ibe81f848238d9df651a74f9fd82ac636c2c249f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-15 17:20:47 +00:00
Frederik Gladhorn
9ce6742790 macOS accessibility: Implement NSAccessibilityElement
Modern macOS accessibility is based on protocols.
By implementing NSAccessibilityElement we get warnings
for missing functions for the most basic accessibility
functionality.

Change-Id: I0595ea5b9927c5bfb4bbeff3fc9322cb1f232b9f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-05-15 17:03:08 +00:00
Mårten Nordheim
cd816d4b6a Add setAutoDeleteReplies to QNetworkAccessManager
Following the introduction of AutoDeleteReplyOnFinishAttribute to
QNetworkRequest it seems natural to make it easy to enable for all
replies created with the current QNetworkAccessManager.

[ChangeLog][QtNetwork][QNetworkAccessManager] Added setAutoDeleteReplies
to QNetworkAccessManager to enable the AutoDeleteReplyOnFinishAttribute
attribute for all QNetworkRequests that are passed to
QNetworkAccessManager.

Change-Id: I7f96dd1fc9a899328e89732be17780b4e710c2a2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-15 12:48:07 +00:00
Mårten Nordheim
927eba344c Introduce AutoDeleteReplyOnFinishAttribute for QNetworkRequest
[ChangeLog][QtNetwork][QNetworkRequest] Added the
AutoDeleteReplyOnFinishAttribute attribute to QNetworkRequest, which
makes QNetworkAccessManager delete the QNetworkReply after it has
emitted the "finished" signal.

Change-Id: I03d4ac0830137882e51dd28795a8ec817762a300
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-15 12:47:55 +00:00
Giuseppe D'Angelo
15d3a52d4e QComboBox: do not bypass the base class' overrides
Change-Id: I01bb84a39d15231878ff267cfcb0f13167defd47
Reviewed-by: David Faure <david.faure@kdab.com>
2019-05-15 10:38:11 +00:00
Giuseppe D'Angelo
d0b293856b QSplitter: do not bypass the base class' overrides
Change-Id: Ie58025191bb250914c13385d6e374e8d0c3f99b6
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-15 09:56:25 +00:00
Marc Mutz
8b771e782d QNetworkReply: replace a QQueue with a std::vector
The 'queue' was never used as a queue: it was populated, and then
exchanged into a local copy to be consumed in a loop. This loop used
dequeue(), but of course it could just const-iterate the container and
dump it as the end, since the member variable was already reset at
that point, no-one could tell the difference from the outside.

So, no need for a queue. A vector will do very nicely.

The loop now uses ranged-for and qExchange(), greatly simplifying the
code over the old version.

Add another qExchange() call as a drive-by.

Change-Id: I6147453dc9edfe9500833627b123bb3a31114651
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-15 09:00:10 +00:00
Frederik Gladhorn
c871ba2b23 Add shortcut for select all in QSpinBox
This adds the shortcut to spinboxes and date edites.

Fixes: QTBUG-48231
Change-Id: I91400e1990e4b1d7d971198c1e2a64149c2a835e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-15 07:53:34 +00:00
Ryan Chu
33d2715dd3 QFtp: Skip the flaky QTestEventLoop::timeout in Coin network
When migrating QFtp test to docker server, it seems it is easy to get
"QTestEventLoop::instance().timeout()" during the test in Coin network.

To move the task of migration forward, those flaky timeout errors will
be ignored for short-term.

Task-number: QTBUG-75549
Change-Id: I797952b82c0ceb637f40c77fac2a88ca2a9a0eae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-05-15 06:10:13 +00:00
Ryan Chu
835d83b134 Fix the timing issue of QFtp tests when using Docker servers
Sometimes, it fails in tst_QFtp::proxy or tst_QFtp::activeMode under the
stress test. It complains about "Network operation timed out" on
vsftpd.test-net.qt.local.

When this issue happens in tst_QFtp::proxy, it shows "USER-ERR reject:
172.18.0.5 (ForkLimit 40)" in the log of ftp-proxy. By default, the
ftp-proxy only supports 40 incoming client connections per minute. To
make the ftp-proxy more powerful, this change extends the limits from 40
to 2000.

When this issue happens in tst_QFtp:activeMode, vsftpd shows 426 Failure
writing network stream error. It is a known issue of vsftpd. A quick fix
is turning use_sendfile off.

Change-Id: Iad50469654041bf30f92ef00805034f0d4aa9c3f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-05-15 06:10:01 +00:00
Ryan Chu
a7ed7c1230 Rework QFtp test and resolve the unresolved items
The proxy_data() defined in tst_qftp.cpp expects five items (bigfile,
nonASCII, rfc3252, rfc3252.txt, and upload) in the server folder
(ftp/qtest). The file rfc3252 and nonASCII folder were missing.

Change-Id: I995d6e254875ade22a1def53187077f1cc8d4c98
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-05-15 06:09:52 +00:00
Volker Hilsheimer
dfe497a14e Migrate QFtp test to new test server
Use docker test server to run test, following instructions on
https://wiki.qt.io/Network_Testing. Verified on Ubunutu 18.04.

Several test failures due to network timeouts and inconsistent
configuration of FTP server and assumptions made in the tests.
However, the test is either way blacklisted, and the docker test
server is not in use yet.

Done-with: Ryan Chu <ryan.chu@qt.io>
Fixes: QTQAINFRA-2275
Change-Id: I4cbd0109ce3f4cfb23ba2303a85796681d12febc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-05-15 06:09:41 +00:00
Liang Qi
7bf90b0dde Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev 2019-05-15 10:08:53 +00:00
Liang Qi
c0359bd3c3 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/global/qfloat16.cpp
	src/corelib/global/qfloat16.h
	src/plugins/platforms/windows/qwindowswindow.cpp

Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
2019-05-15 07:11:41 +02:00
Giuseppe D'Angelo
a87adcaa8d QContiguousCache: add noexcept
Change-Id: I069842fe705d2e73222ffb095792d7e3e518cfd9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-15 04:59:53 +00:00
Giuseppe D'Angelo
92479ed9b7 QPrintSupport: do not bypass a base class' virtual
QAbstractPrintDialog (a QDialog subclass) has an interesting
override of exec(): a pure virtual, without a body.
The UNIX subclass was therefore forced to override it, but
since it did not need to do anything with it, it had to call
QDialog::exec (bypassing the direct base, otherwise it
would cause a pure virtual call).

Eliminate the pure virtual override. This should be BC;
the layout of the vtable does not change, merely its contents.

Change-Id: I84ac23c938f1934f699df032ef1bde0d6df77784
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-15 04:59:22 +00:00
Giuseppe D'Angelo
83971776c7 QFontMetricsF: add noexcept
Change-Id: I0b32ff72f22c4014441a86c135927e52ddc999cd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-15 04:59:06 +00:00
Marc Mutz
68eea0196e QTableView: replace QLinkedList with std::list
The object is never copied, so there's no point in using a cow'ed list implementation.

Apart from the usual API adaptions (isEmpty() -> empty(), append() -> push_back()),
alse replaced two foreach-loops with ranged-for. The first one does not call into
out-of-line functions, and doesn't modify the container it iterates over, so is
safe.

The second does call into out-of-line functions, but they are const. The loop does
not modify the container it iterates over, either, so is also safe (except for some
fishy const_cast somewhere, or const being lost due to shallowness of const).

Also replaced explicit-iterator loops with ranged-for where possible.

Change-Id: I60b0f2d356846d527bfbaa6a0ecbb8395013b852
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-14 19:43:10 +00:00
Marc Mutz
b703279235 QFontEngine: replace QLinkedList with std::list
The object is never copied, so there's no point in using a cow'ed list implementation.

Also port two explicit-iterator loops to ranged-for, as one is necessary
(because of constBegin()) and the other is for consistency.

Change-Id: Ia7f080060d6b675a76b55d197af08161389082a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-14 19:41:49 +00:00
Giuseppe D'Angelo
2353cb00cb QPainterPath: amend a comment
Casting towards more derived classes is "downcasting",
not "upcasting".

Change-Id: I1373a073ba81fb2c2b77c35ac1916a53ce30b86c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-14 17:31:52 +00:00
Giuseppe D'Angelo
cfeb09fcc8 QSharedData: code tidies
Add noexcept and honor the RO3 to silence warnings.
In theory this could also be constexpred, but there might
still be compilers we support that do not have constexpr initialization
for atomics...

Change-Id: Ibb94a2f4392908451cf7985d48f999581f03398d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:31:44 +00:00
Giuseppe D'Angelo
1df98e6bb9 QSharedData: unexport in Qt 6
It's fully inlined anyhow.

Change-Id: I8cb78ad6f75d3cc3b27cf91a3ba271cf312c9555
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:31:35 +00:00
Giuseppe D'Angelo
7f35255d87 QByteData: use int to return the number of managed QByteArrays
The internal QByteArrays are kept in a QList, so we can use
int to get the count. This matches what operator[] takes,
and gets rid of a bunch of warnings when iterating over a QByteData
using a plain int as a index variable.

Change-Id: Ib44d4101612135b976979a8464442e94706f8736
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:31:15 +00:00
Marc Mutz
a73385e2cf Short live qExchange()!
This is a 1:1 replacement for std::exchange, and should be removed once
Qt fully depends on C++14. It's too versatile a tool to miss it, so
provide a copy.

[ChangeLog][QtCore][QtGlobal] Added qExchange(), a drop-in for C++14's std::exchange()

Change-Id: I31c4f1141e7a99f99ea65eb36ddf9d68b7847337
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:21:40 +00:00
Marc Mutz
969e60e075 QTypeInfo: move QLinkedlist declaration to qlinkedlist.h
This is in preparation of deprecating QLinkedList.

Change-Id: Id5018b7fbc89f8b76b86e97cd09d18b4b8cb6234
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:00:39 +00:00
Tasuku Suzuki
8b9ea7232a Fix build without features.itemmodel
The macro needed to avoid generating headers_*.o from the header files.

Change-Id: I4fc5ec2432661493e337e1779d79373dedff0132
Reviewed-by: David Faure <david.faure@kdab.com>
2019-05-14 14:31:12 +00:00
Steve Lhomme
02a14e6e1b Include MODULE_AUX_INCLUDES in the generated .pc files
QtANGLE is set on MODULE_AUX_INCLUDES so the headers can be found when
building with ANGLE (gui.pro) but the pkg-config file is missing this
header and the Qt headers cannot be compiled with the path from this
config.

Fixes: QTBUG-75495
Change-Id: I4d795b3495b8d08c65f9ddffad4fc838b4f04c31
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-05-14 11:07:14 +00:00
Michal Klocek
1e5deb0641 Add 'well-formated' JSON string values
Add support for surrogate code points U+D800 through U+DFFF,
represent them with JSON escape sequences.

https://github.com/tc39/proposal-well-formed-stringify

Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 10:06:35 +00:00
Friedemann Kleint
fa59c4fd7d Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-05-14 12:21:38 +00:00
Joerg Bornemann
871b65ab10 Add the c++latest CONFIG value to select the latest C++ standard
[ChangeLog][qmake] The CONFIG value c++latest was added to select the
latest C++ standard the currently used toolchain supports.

Task-number: QTBUG-75653
Change-Id: I22ddc9d293109d99e652b7ccb19d7226fca4716d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 08:01:40 +00:00
Friedemann Kleint
00e1917f85 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Id3d16035c9692af42e9c1bf512218f3c836ae2eb
2019-05-14 08:23:41 +02:00
Marc Mutz
c493076a04 QDataStream: move QLinkedlist operators to qlinkedlist.h
This is in preparation of deprecating QLinkedList.

Change-Id: I7540b784736a48cf4857d1969440d35ec64457e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:29:59 +00:00
Marc Mutz
bd25689003 Clean up qtriangulator_p.h
Remove the bogus default constructor and copy special member function
of the structs there. They just disable move semantics and the
compiler will be happy to generate them for you when you let it.

These classes are all pure inline, so remove the export macros.

Last, not least, remove the broken assignment operator of
QVertexIndexVector. The copy constructor was implicitly declared, so
was doing something completely different (the correct thing, I might
argue), while the hand-rolled, useless op= checked this->t to check
which of the vectors to copy (instead of checking other.t, which it
later copies).

Change-Id: I696f01602e02c0ddb2e5348ec85fd2a622544226
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:29:45 +00:00
Marc Mutz
ac83032c60 tst_qrandomgenerator: replace QLinkedList with a std::list
In preparation of deprecating QLinkedList.

This actually simplifies the code, since std::list has a ctor from size,
which QLinkedList lacks, and which the code worked around by using
initializer_list.

Change-Id: I07f9d590f863d9e4e00de73339cdfa27079f6e03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:28:14 +00:00
Marc Mutz
fdd2714999 QGradient: de-inline dtor
As exported classes, their dtors should be out-of-line, lest we
can never add something to them afterwards.

Change-Id: I706281ca3fb285f9f00152f2e3fb34795699d69f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:26:19 +00:00
Marc Mutz
4543357007 qopenwfdscreen.h: remove unused #include
Change-Id: Ia02c9d5a468bb97f11e4c431eb36b4ce3f5cf1b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:25:54 +00:00
Giuseppe D'Angelo
9108a5b005 GLX convenience: fix typo
The code meant to extract GLX_SAMPLE_BUFFERS_ARB, not GLX_SAMPLES_ARB,
which is read a few lines below.

Change-Id: Id50a1863cab56ed6084d4a2359a956a9db1222fa
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-13 22:05:11 +00:00
Giuseppe D'Angelo
bb72dc217d QPointer: fix swap()
Make it noexcept and add an overload as a free function.

[ChangeLog][QtCore][QPointer] Added a free swap function.

Change-Id: I50744b9bae6a52db71b2da39e310619b3a0d6510
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-05-13 21:49:00 +00:00
Marc Mutz
7cba2acd2c qmake: replace QLinkedList with std::list
This is in preparation of deprecating QLinkedList.

There is but one substantial change: Instead of copying the linked list,
we move it now, and instead of copying items between these two lists, we
use std::list::splice(), which just relinks nodes. It is a bit surprising
that the comment on the ProValueMapStack suggests references into the
container must remain stable, and then some code changes addresses by
making copies of the elements.

This was probably a bug waiting to manifest itself.

Since nothing else in qmake is using QLinkedList now, remove qlinkedlist.o
from the qmake build.

Change-Id: I08a5b0661466bf50ad8f9f8abf58bc801aef4ddc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-13 19:18:59 +00:00
Frederik Gladhorn
ac4cf6e2b2 Handle missing enum value in test
Change-Id: I39ad53686b45a79105ccfd9938d79518e26dd5d5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-13 16:39:44 +00:00
Marc Mutz
04e4835a94 QTableView: don't convert QSet to QList just to iterate over it
Both in drawAndClipSpans(), as well as callee QSpanCollection::spansInRect(), a QSet is used
to ensure uniqueness of elements. In both cases, the QSet is converted to QList, and the list
is iterated over.

Just iterate over the QSet directly...

Change-Id: I8c7d17246a3cf836659026bfeadb987f37e476bb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 16:39:28 +00:00
Marc Mutz
0d88721d77 qmake: use std names on a linked list
This is preparation of moving from QLinkedList to std::list, which is in
preparation of deprecating QLinkedList.

Change-Id: Ief259bc8c7178be5ca04812c6890cf65d86c069d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-13 16:39:22 +00:00
Tor Arne Vestbø
09504d484c macOS: Guard against display on non-main threads
AppKit will in some cases ask our view to display on secondary threads if
we call APIs that are only supposed to be called on the main thread, such
as -[NSOpenGLContext setView:] or -[NSOpenGLContext update].

Forwarding this display-request is bad, as QtGui expects all window system
events to come on the main thread, and we can easily deadlock client code
such as the Qt Quick threaded renderer.

Change-Id: I1daeabf1dca6ca8ba908d3998b444a2089681e3a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-13 15:19:35 +00:00
Friedemann Kleint
7eed1e40d4 Windows QPA: Fix resize loops when moving fixed size windows between screens
Postpone the screen change until the DPI changed event in case a move
between screens with different DPI is detected.

Task-number: QTBUG-65580
Change-Id: I356f144b243d7d1ce7feabf0434c3f534b903965
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2019-05-13 14:46:57 +00:00
Friedemann Kleint
d2fd9b1b98 Windows QPA: Fix window frame calculation in multi-monitor setups
When introducing EnableNonClientDpiScaling() for QTBUG-53255, the window
frame calculation was not adapted. That is, window frames were calculated
from the style for the primary screen only, causing

- minimum size constraints not being calculated correctly for applications
  on secondary screens when populating the MINMAXINFO structure.
- warnings about not being able to apply a geometry when moving fixed
  size windows across screens.

The calculation of the frames for propagating size hints is also no longer
required after 3035400f36, which retrieves
them from the WM_NCCALCSIZE message; QWindowsWindow::fullFrameMargins() can
be used instead.

For newly created windows, use the newly added AdjustWindowRectExForDpi()
function to calculate the initial frame size.

Change QWindowsGeometryHint from a class to a collection of static functions
and add overloads to calculate the frame.

In checkForScreenChanged(), update the margins until WM_NCCALCSIZE is
received.

Task-number: QTBUG-67777
Task-number: QTBUG-65580
Task-number: QTBUG-53255
Change-Id: Iff2d382b2b316adec6c1a0622ae8015dba6de371
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2019-05-13 14:46:48 +00:00