Move two functions that are using toString(const QString &str) from
qtestcase.h to qtest.h. This fixes compilation on INTEGRITY platform.
Task-number: QTBUG-61702
Change-Id: I5a433126741c7a52621616c5b98203e7d642b330
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Although Qt declares its minimum supported OS version to the compiler
and linker, the OS ignores this information when loading shared
libraries, so instead of failing with a useful error message, the
program will simply crash at runtime. This attempts to bring that
failure as early in the lifecycle as possible, and provide a better
error message as well.
Change-Id: Ic58b44f8895eac718c94e62cad6e2506dbea8a7e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Task-number: QTBUG-59301
Change-Id: I2562b862465a52ecc56f551bcdb98fa7279ebfcf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Some customers still need this for interoperability with legacy code.
Let's continue to keep it working in 5.9.x, and then move to
64-bit exclusive features (thus dropping 32-bit entirely) in 5.10.
Task-number: QTBUG-58401
Change-Id: Ibb7200c1885e9caba70439df5f7c86c81b1312b5
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
MSVC warns about iterators being passed to certain Standard Library
algorithms. dbd55cdaf3 introduced
a usa of std::is_permutation in a public header, which is causing
such a warning to be emitted.
To suppress the warning, Microsoft suggests to either use the 4-arg
std::is_permutation overload (which however is not available
in MSVC 2013) or to use a Standard Library extension, which we are
already using elsewhere in Qt to deal with the same problem. However,
that extension requires the iterator to be moved by size_t quantities,
which isn't the case for QHash::iterator, and therefore generates
more warnings about loss of precision (size_t -> int).
Therefore, go with the 4-arg std::is_permutation, only on MSVC >= 2015.
Change-Id: Idfcff28d14e0f1fde5d77f1deb9eec27c87ff5cd
Task-number: QTBUG-61902
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Skip EGL surface re-creation when a sequence of unprocessed resizing
requests leaves the buffer size unchanged. In this situation, the
buffers won't be resized. Recreating the surface without resizing the
buffers leads to screen providing incorrect information about the
buffers.
Change-Id: I1f75ab99eb1dffe0bcf9660bf014f047407b0c1b
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Getting the end position of the selection was not possible.
[ChangeLog][QtWidgets][QLineEdit] Added selectionEnd(), selectionLength(),
complementing selectionStart().
Change-Id: Iaecc624063d7c043f9502351f07eb76f869e86f1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
<APPDIR> was initially thought to be app-specific but is in fact
more used as a kind of vendor prefix, where one vendor (e.g. KDE)
can install many applications into the same APPDIR.
[ChangeLog][QtCore][QStandardPaths] On Windows, QStandardPaths
now also looks into "<APPDIR>/data/<APPNAME>" for non-generic paths.
Change-Id: I426d97d61cc229bad0f5a2a4eb061e349de6681e
Reviewed-by: David Faure <david.faure@kdab.com>
Fixes the build with MSVC2017.
Amends ae292be869.
Task-number: QTBUG-62052
Change-Id: Ibb55e4e93815da8077961e68525e3cb8dc6807b0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The native APIs don't support previous transition, only next after a
stipulated date. The prior code started its search at the epoch; if
used for a time before the first transition after the epoch, this
found no transitions so returned invalid data, when the last
transition before the epoch would have been suitable. It also wound
through all transitions since the epoch, on its way to the selected
time, which was potentially laborious.
Instead, start a year before the stipulated time; this should get a
transition if the zone uses DST. If it doesn't, start with the first
known transition and binary-chop our way to one within a year of the
last before the stipulated time; then wind forward one transition at a
time, as before. The chopping is actually faster than binary: each
time we find a transition after the interval mid-point but early
enough, we move the early end of our interval to the transition, which
is later than the old interval's middle. Using halving, starting with
a vast interval, should thus only incur modest cost, while ensuring we
give up early when no transition data is available at all or the
zone's first transition ever was after the stipulated time.
Change-Id: I96c14540fc2600837e6a22e480fb8dc36cb37220
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtNetwork][QNetworkProxy] UWP now supports proxies using
SOCKS5.
Task-number: QTBUG-45495
Change-Id: I78cb7416b6c827eb41485f3f7682f85ff75fcbd0
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
In commit 85ff351266, we removed support
for systems where the pipe2(), dup3(), and accept4() functions are
declared in the libc headers but fail at runtime. On Linux, O_CLOEXEC
was added before accept4(), so if the latter is supported, the former is
too. On the BSDs, the libc headers are updated in lockstep with the
kernel, so we know for sure.
There are still systems that have O_CLOEXEC (a POSIX.1-2008 flag) but
not the extra functions (Solaris and Darwin). Solaris libc must update
like the BSDs, but on Darwin we do build with a new SDK targeting an
old OS. Fortunately, O_CLOEXEC has been supported since 10.7, so we're
out of the woods.
Change-Id: I84e45059a888497fb55ffffd14d249dd4719e2cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QFileSystemMetaData::fillFromStatBuf is used when filling in the results
from both stat() as well as fstat(). Obviously the file exists if it was
stat()ed but not necessarily so by fstat(): we could be operating on a
file descriptor referring to an unlinked file or an O_TMPFILE.
Change-Id: I8d96dea9955d4c749b99fffd14cd52a8c8dd9ca1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Fixes flakiness where we enter and exit window states too fast on macOS,
while also removing 2 second waits in the positioning tests that were
slowing things down needlessly.
Change-Id: Ia4ee4d4812474c520fdd3f76b047f4eabe1a8220
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
They fail when enabling synchronous expose events. Disabled for now
until we can look into why, but it's assumed to be an issue with the
test harness/how we hook into Quartz to send/observe events.
Task-number: QTBUG-62042
Change-Id: I723d049ec5d1029edb0ad3b1f47fffc829a8924b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add context menu providing:
"Escape Selection" Apply QRegularExpression::escape() to selection
"Paste from Code" Paste from C++
"Copy to Code" (for completeness)
Task-number: QTBUG-60635
Change-Id: Iee15c2243c7d0435b623dde4a1b26249aecd0553
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This is the result of running the (experimental) clang-tidy check
qt-modernize-qsharedpointer-create
Discarded changes:
- tst_qsharedpointer.cpp: not sure we want these replacements there
(→ separate change)
- tst_collations.cpp: hit in a template specialization that is
instantiated with both QSharedPointer and QSharedDataPointer.
Change-Id: I203c2646e91d026735d923473af3d151d19e3820
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change f046ed395a set the default values of VERSION and
QMAKE_TARGET_DESCRIPTION for Qt tools to generic ones. The version and
description is shown in the properties of the executable, but also
used for crash reports. For the latter it wasn't clear anymore which
tool actually crashed.
The patch therefore adds the executable name to the generic description.
Tools can still overwrite the description on their own.
Task-number: QTBUG-61970
Change-Id: I8366db22f88f0d6575e7f482f030b3c4f05af6c5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
.. in an application that has many native windows.
We don't need to select XI_HierarchyChangedMask and XI_DeviceChangedMask
for every window. It is enough to register one window for these events to
update state of our X11 client (application).
Furthermore, XIAllDevices and XIAllMasterDevices always apply, even if the
device has been added after the client has selected for events. So there is
no need to call XISelectEvents on XIAllDevices/XIAllMasterDevices again, if
we are not updating event masks.
With this patch and the test application from QTBUG-57013, removing/attaching
a device takes few hundred milliseconds instead of 23-24 seconds.
Task-number: QTBUG-57013
Change-Id: Ieb0b5ee25feef2922f901165825cb4a1289fc852
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This test verifies processEvents(WaitForMoreEvents)
behavior by first processing all pending events (in
a loop) and then verifying that a following processEvents
call actually waits.
But there is no guarantee that the OS won’t introduce
more events after the first loop has completed. This
does indeed seem to happen on recent versions of macOS.
Change the test to not require that the processEvents
call blocked and de-blacklist.
Task-number: QTBUG-61131
Change-Id: Ic8fa74a6085165442791264f6f137a2fa6083138
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Use QPlatformWindow::mapFromGlobal() instead of QWindow:::mapFromGlobal()
as QPA operates in device pixels.
Task-number: QTBUG-62028
Change-Id: I64ec4f4c9a536e122676d738db58805b98a45c82
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
GetDefaultPrinter can return ERROR_FILE_NOT_FOUND. In that case just
return a empty string.
Task-number: QTBUG-53290
Change-Id: Ib0e28b3425d100bc185d1d8827dc6b7fd90cbbeb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
If these rules are not added to the solution, Visual Studio will
complain, that the project has to be deployed before it can be run.
Change-Id: I6d3fbc949c85b11a92f78e13e2f6a1b92a5cfdc7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Calling bottom/right/bottomRight on a QRect is discouraged, as it does
not give the true bottom-right corner of the rectangle, instead giving
a point one unit to the left and top of the true bottom right.
Dividing this point by a scale factor of e.g. 2, and then using qCeil
on the bottom right x and y coordinates would result in a pointRegion
that was 1x1 * scaleFactor larger than it should, manifesting as
rendering issues at later stages.
We can get away from the whole problem by initially converting the
QRect to a QRectF, and basing the pointRegion's rect on the scaled
size instead of bottom-right coordinates.
Change-Id: I4d4895660655cfa8749c93c7d2573ae79cd7898b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
if (A)
doA()
else if (B)
doB()
if (B)
doB()
is equal to:
if (A)
doA()
if (B)
doB()
when doB() is a self-contained basic operation like
QRect::setY(int ay) with { y1 = ay; } as body.
Change-Id: I3421493fe47459bd9b3d4cb5f4cfdd30ce566003
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Verify that all pixels of the grabbed image are green instead
of comparing an image loaded from file.
The test then also passes when High DPI scaling is active in
which case a twice as big pixmap with DPR=2 is obtained when
grabbing the widget.
Change-Id: Ie5244a39a68ea0defd2590cf30f251d660d0869b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Do not call if the property indicating embedded windows is set.
Task-number: QTBUG-61972
Change-Id: I8f34dd8a59f1e5c9c8064646bcb15acea115cd68
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Scale coordinates in a few places, remove pixmap scaling in
grabWindow() (Windows).
Change-Id: Iba9e5d3ca55422a14eda09c8d04329a455d3acb3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Do not scale the QPlatformScreen's geometry.
Fixes tst_QWidget::showFullScreen() when run with a scale factor.
Change-Id: I4a2e743303ff70b01fd3d2086281a790737d2c1d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This just removes a '!' from a comment that should not be
a qdoc comment.
Change-Id: I1d90e80656fdcc1c8bd6c177529bd930dcc62932
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: Ic3555445b045edda884983aa01834a4ae243d6fa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
To do that, we needed to add virtual id() in QAbstractFileEngine and
override it in QFSFileEngine. It might be useful to return other types
of IDs for the other file engines, but this commit does not attempt that
just yet.
Change-Id: I1eba2b016de74620bfc8fffd14ccafe0762b3c38
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Can happen if we're using HRESULT from weird facilities.
Change-Id: I3d10feaa2e5854ff3c01b32dbd068309e5131d1b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
On Windows, qt_error_string() returns the string corresponding to the
Win32 API, not an errno. Replace those uses for a function that works
for errno values.
Change-Id: I1eba2b016de74620bfc8fffd14ccce6162bafdca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This removes a lot of duplicated code that existed in both qglobal.cpp
and qsystemerror.cpp, including the hack to get the correct strerror_r
signature.
This removes the incorrect use of EACCES, EMFILE, ENOENT, and ENOSPC
from qt_error_string on Windows. qt_error_string is supposed to be used
only with Win32 error codes from GetLastError(), despite there being a
lot of uses in cross-platform and even Windows-specific code that pass
errno constants.
It may or may not work: that depends on whether the constants happen to
match. ENOENT matches ERROR_FILE_NOT_FOUND and one could argue that
ENOSPC matching ERROR_OUT_OF_PAPER is acceptable, but EMFILE isn't the
same as ERROR_BAD_LENGTH nor is EACCES, ERROR_INVALID_DATA.
Change-Id: I1eba2b016de74620bfc8fffd14cccb7f77f4b510
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The MS documentation says that the high/low parts uniquely identify a
file within a system, but they actually mean the filesystem. The details
on how it's allocated make that clear. So we need the volume identifier.
Change-Id: I658f552684924f8aa2cafffd14cfc03c5a09c0e9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Move the code that sends geometry change events from
QWindowsIntegration::createPlatformWindow() to
QWindowsWindow::initialize(), using the obtained geometry
from the creation context. Drop the check for window flags
since they are not changed.
Complements change 4c855a9f9f
Task-number: QTBUG-61977
Change-Id: I0c23abefc45110cc4bf11e10d65dc7ddbb9d20d5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
... and group XI22 methods together under one ifdef clause.
The error message was:
qxcbconnection_xi2.cpp:1025:42: error: no ‘bool QXcbConnection::isTouchScreen(int)’ member function declared in class ‘QXcbConnection’
bool QXcbConnection::isTouchScreen(int id)
XInput 2.2 was released many years ago, this build failure could
in practice happen only on some really old platform.
Change-Id: I3c1741cbdffe15c0f5149c6d76592a743d1d8a91
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
ASN UTCTime uses two characters to encode a year (YY). When converting it
into QDate, it's quite naive to just add 2000. According to RFC 2459,
these YY represent dates in the range [1950, 2049].
This patch also introduces a helper function doing the checked conversion
from a string to int (to be reused in the following-up patches).
Task-number: QTBUG-61934
Change-Id: I3f6f471d24e8357b83b2f5973023b2b842751389
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Task-number: QTBUG-61987
Change-Id: I27219a6d06d7a81514e3f7b2ad5469676f724e04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Adds the hints that are read and used by the plasma-integration platform
theme, so naked Qt applications can integrate just as well on this
front.
Change-Id: I45a113e0081ea96c8cf543c22b28b69280ae7619
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>