Change-Id: I5a2758065d3155f4f33b76c022c43955a9b096c2
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
When running on a desktop machine (using Windws SDK 10.0.14393) the
palette had fully transparent text colors which were assigned in the
"phone only" part of the theme's initialization. By checking the API
contract we can avoid that part of the initialization and thus return
proper values.
Change-Id: Id770a686c1c7e447a9594830fd7670352116eb21
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
__has_cpp_attribute(nodiscard) is 1 in all compilation modes, but if you
use it outside of C++1z, you get a warning.
LLVM-bug: https://bugs.llvm.org/show_bug.cgi?id=33518
Task-number: QTBUG-61840
Task-number: QTBUG-62085
Change-Id: I84e45059a888497fb55ffffd14d3683f4808978b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Explicitly declare which DRM event context version we want to use,
rather than just the latest one libdrm supports. New versions may change
semantics, or extend the structure, in ways we're unaware of.
Stick with version 2, which is the version that introduced
page_flip_handler.
Change-Id: I1d2066d5ab485ea571f016a8660829f435821c82
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Currently QLocale::c().bcp47Name() returns "C" which, according to [BCP47], is
not a valid language tag. In particular it does not conform to the ABNF grammar
in section 2.1 which specifies a minimum length of 2 characters for all language
tags.
[BCP47]: https://tools.ietf.org/html/bcp47
This patch changes the return value to "en" seeing as the documentation for
QLocale::Language states that the C language is identical in behavior to
English.
Task-number: QTBUG-61949
Change-Id: I2a381def8fb7156467e01d105da92bb1f4821204
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
&operator<<(QDebug &, const QVectorPath &) was modifying the QDebug
state without restoring it after finishing.
Change-Id: I28c377bc99bfeb5a7bc67ca9affa8123f04583df
Coverity-Id: 11375
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
CID 10994 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
The font database was not destroyed in the destructor.
Coverity-Id: 10994
Change-Id: Ibd4cb0b65d1e554593295a3654e8d8c946551cc2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
The QT_NO_ITEMVIEWS queries in corelib/ seem to had no effect at all.
Change-Id: I494ee2309a96b0cf25de18781fc9a675878a2ee9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
internalInsert() will set the cursor to the right position which accounts
for any input mask set on the control as well. Therefore it will already
be placed at the next correct position and should not be changed again
after that.
Task-number: QTBUG-40943
Change-Id: Ic0f5fad6999ddd367e435ec4409a5db5b9eacb7b
Reviewed-by: Daniel Teske <qt@squorn.de>
Reviewed-by: David Faure <david.faure@kdab.com>
Do not print a critical message when the pipe connection dropped as this
can happen with regular QLocalSocket usage as demonstrated in
qtremoteobjects.
Change-Id: If79915ce5d83b8cae5e090c04e893dafcb5a88a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The Microsoft documentation says that CreateFile cannot be used to
create directories, so you can only use it on a directory with
OPEN_EXISTING and FILE_FLAG_BACKUP_SEMANTICS. This commit implements
that.
Change-Id: I658f552684924f8aa2cafffd14cfc0e5660a4a62
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since b13aa15e10 the event must not be
accepted when calling "canDrop()" method. Inside it "dropOn()" method
is called which requires not accepted event. Otherwise the event will
be ignored later in "QListView::dragMoveEvent()". On next movement it
will be accepted again - the event is now ignored, so "dropOn() method
will work properly.
If "filterDragMoveEvent()" returns false for any reason, the event
acceptance is not changed - the same behavior as before.
Task-number: QTBUG-61951
Change-Id: I2d49ce5b15300c42e2efc745e8e32d3d17f34a2f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The original fd was already FD_CLOEXEC due to qt_safe_open.
Change-Id: Ief61d358e2b54a0fac37fffd14d2394ee02da059
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
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>
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>
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>
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>