We can reuse the main QThread definition for the no-thread
configuration and avoid having to keep them in sync.
Add stub definitions for member functions where needed.
Change-Id: I128db11684a6040d09c4a4ce114f1399cba523f8
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.
Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Add implementation for the no-thread configuration:
Assume access will only happen from one thread and
use a QScopedPointer to hold the data.
Unlike the real implementation this version will
delete the stored data on destruction, as opposed
to on QApplication destruction.
Change-Id: I9d8e89e7da18f967f463e2db7b50549c962acc84
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Set data->threadId, which makes the thread detection
used by Qt::AutoConnection work: it will now actually
select Qt::DirectConnection.
Change-Id: I9369e47eb7ed3ec88dba25f2d41e92139958bcd7
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
When glGetError returns GL_CONTEXT_LOST, on XCB + Nvidia at least, the
error does not get cleared until the next successful
glGetGraphicsResetStatus.
We can't handle this properly until the start of the next frame where we
will hopefully have a valid context, but in the meantime we should avoid
locking up completely.
Change-Id: Id438d44d83b926e1f3e4281ca3704231bf1a23cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
qt_nameprep() already reset the string to its original length to
indicate failure, but we didn't handle that in qt_ACE_do(). So make it
have a return value whcih makes it easier to handle that case and do
handle it.
[ChangeLog][QtCore][QUrl] Fixed a bug that caused URLs whose hostnames
contained unassigned or prohibited Unicode codepoints to report
isValid() = true, despite clearing the hostname.
Change-Id: I41e7b3bced5944239f41fffd1545b7274c4b419d
Reviewed-by: David Faure <david.faure@kdab.com>
... which is Qt's version of std::make_index_sequence / C++14.
The current Indexes generator is recursing O(N) times which is reaching
recursion limits level for long IndexesList.
This implementation has only O(log N) recursion.
Change-Id: I423ef05152d77b18f1f5a64c49b273f49aa958bb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's just adding the count of each half.
Change-Id: I9868946ceaf74002bde1fffd154b29908319007f
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The API originally proposed was flawed in the sense that the setter
function would use a modified version of the parameter given which would
have make it a black box for the user. This patch fixes that by removing
that setter and providing a static method that will return the pattern
suitably modified to be used by QRegularExpression the same way the
escape method does.
[ChangeLog][Core][QRegularExpression] Implemented support for wildcard
patterns through a static method.
Change-Id: I0054bcaffd7525dac569f54fa81f73b7e4544b2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- the usage of 'handled' variable was a mess.
- remove "generic" from API names. The naming was probably influenced
too much from underlying C API (xcb_generic_event_t):
- handleGenericEvent() -> handleNativeEvent() to be consistent with QWindow::nativeEvent().
- dropped unnecessary 'long *result' from signature. It is useful only on MS Windows.
- genericEventFilterType() -> nativeEventType(), it *is* an event type, not a filter type.
- XCB_CLIENT_MESSAGE was not passed to QWindow::nativeEvent(), which is done via
HANDLE_PLATFORM_WINDOW_EVENT.
- minor: added some 'auto's where it makes sense and improved some variable names.
Change-Id: Id1c9896054e2dbd9a79bacd88394149c8cf2cdea
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
I've tried to reproduce the failures in the CI a couple of times now,
but it keeps passing. Let's leave some debug output in the test so
that if/when it does fail, we might know a bit more about why it does
so.
Task-number: QTBUG-69492
Change-Id: I5b39ac692e9026ce4b25cd13d342b11e061b777b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Nathan Collins <nathan.collins@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Neglected in 44b6757fe5
Noted the need for this in a relevant script's instructions.
Change-Id: If69666f1799acebd434034c80b91056cb8777488
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
tst_QtEndian's transformRegion_template() was getting a
signed/unsigned comparison warning when T was unsigned in a
QCOMPARE(T-value, 0); so use T(0) instead.
Change-Id: I78cb2ab96f79393def65ed2c020aa3039017ab92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace lines of formatted output with dictionaries from which that
output can be generated efficiently (in sorted order). Tidy up the
python code, in the process.
Change-Id: Ifb74eb69342646c5dbabc3247b3a8ddef602e934
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The scripts that generate the C++ enum names clean out spaces, so
there's no need for enumdata.py to use the squished names; instead,
include spaces where they belong and use them in the relevant names
where they show up.
Change-Id: I7261c87d69e654bc2e89f44d7ebbc06bfb403c58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
That way, we'll get told all the cases that fail, rather than only the
first. Provoked by investigation of failures that turned out to be
caused by QTBUG-69875.
Change-Id: I8fa2902cbbcb307cbe1fdec2e7d8d6b0c3eb998a
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
It was added 558dd7f587
It was missed after 128a6eec06
Change-Id: I99f5c42ea45227bef08092e22d656e2d7d3cf60f
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
It's unclear what the original code was doing. It relied on 'm_release'
which could never be 'false' (ref. QTBUG-69679). It was subtracting event
times and comparing with arbitrary '10'. On X11 auto-repeat keys can be
detected by checking time and keycode of the current release event and
the next event in the queue. If an event is an auto-repeat, then next event
in the queue will be a key press with matching time and keycode.
Verified that auto-repeat was unreliable in Qt 4 as well. With this patch
auto-repeat works as expected.
Added support for Xlib's XPeekEvent in our XCB implementation QXcbConnection::checkEvent():
"The XPeekEvent() function returns the first event from the event queue,
but it does not remove the event from the queue."
Sneaking in one variable renaming: "string" -> "text", to match the QKeyEvent::text().
Task-number: QTBUG-57335
Task-number: QTBUG-69679
Change-Id: I0a23f138287f57eaaecf1a009bd939e7e0e23269
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Few lines above we use the same attributes to create the window.
If attributes don't change, there is not need to call
xcb_change_window_attributes()
Change-Id: I1335b8be866bdd9911d7911c87f09091bf77e955
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
... to check for buffered events. This makes the code less verbose and
easier to read. Changed the filter signature to pass an event type in addition
to the actual event, for the convenience of API user. And do not pass worthless
nullptr-s to the filter.
The only reason why KeyChecker from qxcbkeyboard.cpp was not converted
to lambda expression is that the code looks suspicious - KeyChecker::m_release
default value is 'true' and I don't see where it would ever be assigned
'false' (ref. QTBUG-69679) and the code is known to be buggy (ref. QTBUG-57335).
Those issues are out-of-scope for this patch.
Change-Id: If2fdd60fbb93eb983f3c9ad616aaf04834fede9f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Respect allowRootCertOnDemandLoading, as it's done in QSslSocket (well,
almost as in QSslSocket).
Change-Id: Ic6cbb24a91e92cdb20f5f749553f15a62aae8b02
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Previously, the function had a different name that made its purpose
clear - "abort after peer verification error was encoutered". Since
now it's just 'abort handshake', it also should abort an ongoing
handshake, even if no peer verification error found so that we
now have an API that can reset a QDtls object to its initial
'nothing done yet' state.
Change-Id: Idadfec6f82d65c8f07d1c2afa4467c921c7e85c4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Id0118e44e1ed44fecdd803dbc57ca0588a1afec0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We now include the phase, which is helpful, and we distinguish between
modern wheel events with a pixel and/or angle delta, and compatibility
events sent from QWindowSystemInterface::handleWheelEvent with the old
Qt 4 single value delta and orientation.
Change-Id: I2efe9fe7a55c43240ec94bfa70cafaac6d52603c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Expands the existing conversions for ARGB32<->RGB30 to also handle
RGBA8888 to avoid any performance regression of the 16bpc conversion
path.
Change-Id: I34e519a04276b0e7ff00c6125ba06c889045d2ac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Problem:
CMake Error in CMakeLists.txt:
A logical block opening on the line
.../qtbase/tests/auto/cmake/CMakeLists.txt:149 (if)
is not closed.
Broken by change 02ed1b36da
Change-Id: I6c04721edbccaa9fcdb53af92d33dfa87eeaebb8
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This update corrects several minor documentation errors that
were introduced by a recent change to QDtls.
Change-Id: I6ee6b0bf74c82dca86ba8d5f39acbd642829ec44
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This reverts commit 823acb069d.
It caused some test failures in qtdeclarative and etc.
Task-number: QTBUG-69891
Change-Id: I2e4038a46de254834e6389c63f6dad0c2e523b8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This caused a crash on destruction because as soon as you construct a
QTouchDevice it will register itself to a list of devices. On application
exit the function cleanupDevicesList() in qtouchdevice.cpp would go
through all registered QTouchDevices and destroy them. Therefore, there
is no need to delete the QTouchDevice from QWindowsPointerHandler.
This was a regression that was caused by
20d6dac63c
Change-Id: I58fb50016c047c3843a3f9677f2c2ef824223d43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
While the property is deprecated, we should still set it, even in the
legacy free constructor. The window system never sends x and y changes
at the same time, so either coordinate will be null, therefor add them.
This should restore the old behavior.
Task-number: QTBUG-69089
Change-Id: Ie329cb4196f53c70b25934cbbac5e2e48c65d2b3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
It is not relevant anymore. C++11 is a hard requirement for a while already.
Change-Id: Idb8fbdcd13398cc85fba583f40c2b5c4dc7c4943
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This update corrects several minor documentation errors that
cause qdoc warnings. These include incorrect or missing \fn
commands, incorrect uses of \e and \a commands together,
incorrect spellings, etc.
Change-Id: Ib26edef541fa3440025490bcf79cc101623e7f7b
Reviewed-by: Martin Smith <martin.smith@qt.io>
The lower bound shouldn't be the smallest (positive) value representable
by a double, but the *lowest* (finite) value.
Task-number: QTBUG-69862
Change-Id: Ia66610e3c0f8d9643c329714607f5af573206fd8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Otherwise there is a -Werror=narrowing error on big-endian
architectures (where htons does nothing).
Task-number: QTBUG-68390
Change-Id: Idb204a81aaedb9f4fde1d5fae406da36c7a1953e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from b206d1c808)
On macOS we pull out all the modifiers up front, which in the case
of incomplete key sequences such as "Meta+Shift+" will result in
an empty string as a result. The cross-platform code does not
handle that case, so we need to exit early.
This fixes an assert in tst_QKeySequence::parseString().
An assert has been added to QKeySequencePrivate::decodeString()
to make the assumption about the 'accel' argument explicit.
Change-Id: I135e62f9051a8b899202e5fb224b5d3c77bf2062
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QMessageBox window ignores QCloseEvent if it was created
with Ok button and the detailed text was set. But it can
be closed if it contains only one button.
Make it closable if there are two buttons and one of them
is the "Show Details..." button.
[ChangeLog][QtWidgets][QMessageBox] A message box with two
buttons, one of which is the "Show Details..." button,
can be closed by clicking the X button on the window's
title bar.
Task-number: QTBUG-69526
Change-Id: Iba09e38561eb3898dc2aecfd38d8519d512a71c1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This patch amends a62f1d0356.
If the initial backing store resize request is called with QSize(0, 0),
we end up with QXcbBackingStoreImage holding a default contructed QImage / m_qimage.
This happens because of the logic in QXcbBackingStoreImage::create(), where
if we detect that the requested segmentSize == 0, we do not allocate
any memory, and thus don't create a valid image in m_qimage. On subsequent
call to QXcbBackingStore::resize() we would only check if QXcbBackingStoreImage
object has been created, but not if it is in a valid state. This obviously
would cause problems.
This patch re-factors the logic to handle better resize to QSize(0, 0). And
make the code cleaner by:
- merging ::create and ::resize as semantically it is always resize().
- dropping unnecessary argument passing.
Task-number: QTBUG-69581
Change-Id: Ied337beb449dea8259fcf6b7d29f0a5bd553019d
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>