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>
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>
Revert SHA1 - b1708efeeb as it causes a
problem with QtMultimedia.
Change-Id: I0ba366fa6ddccff3715917f5f455b20c73c2e49e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Sometimes AppKit will pass in a proposed size that's smaller than the
geometry of the screen. We don't know why, but shouldn't assert.
Change-Id: I9970c5f587e1e0fb3f2fa932de5a32ac4e1eb76d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A deadlock can occur if the user does
QLocalSocket *ls = new QLocalSocket;
ls->moveToThread(t);
...
delete ls;
Then QLocalSocket calls QWindowsPipeReader::stop() in a different thread
than the I/O operation is running in. The waitForNotified(-1) call would
then wait indefinitely until the I/O thread is in alertable wait state
again. Especially on application shut down this might never be the case,
and the application would deadlock.
Solve this by detaching the Overlapped object from the
QWindowsPipe{Reader|Writer} in stop() and delete it in the callback.
Task-number: QTBUG-61643
Change-Id: Ie262d75c5fd92ac7cf7dfcdbf1519050be9fd3c4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Do not try to set the default value of dialog buttons in fusion, but
let the common style handle it that asks the platform theme.
This adds icons to dialog buttons on platforms that usually has that
(such as KDE).
Change-Id: I29cfa49cfd993224220bc992c523f5b2df20870d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
The old docs contained obsolete information. Also, the new docs
match the new docs for the other Apple OS deployment targets.
Change-Id: Id773fa2086f291d8a2552fe1b339ec1e13c19d74
Reviewed-by: Jake Petroules <jake.petroules@qt.io>