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>
It's broken due to tst_QWidget::testDeletionInEventHandlers,
but the root cause is not known yet.
Task-number: QTBUG-61986
Change-Id: I5b77efaf6910123d10a1456c54b873100e538a69
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We no longer support Windows XP (or Vista, for that matter). We can
directly link to those functions.
Change-Id: Ie9104b1dca6fc2a626399778e68b04e9f8a9d5af
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The QWidget overload of qWaitForWindowExposed waits for the widget's
top level QWindow, which for the viewport is the graphics-view.
We want to explicitly wait for the viewport to be exposed, as the
viewport is covering the whole graphics-view, preventing it from
being exposed. See a6991376c.
Change-Id: I86df43871126562f09e4ce14931bc6fc7f06263d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: I7dbe9c7a91301e0002f9e1827f6d0b495d2b9ec5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The QWindow::create method calls createPlatformWindow, and assigns the
result to d->platformWindow. If the platform sends any sort of events
synchronously during the creation, the event will be delivered to a
QWindow that doesn't have a handle() yet, resulting in noop handling
of the event, or crashes.
To mitigate this situations, platforms should do as little a possible
in the QPlatformWindow constructor, and leave initialization to the
new method, where the QWindow will have a handle().
The macOS platform plugin still has a m_initialized guard, to prevent
sending geometry changes during initialization, as this will result
in a resize event before a show event. This forced behavior seems
dubious, but is left for a followup patch.
Task-number: QTBUG-61977
Change-Id: I04d32d93391e89d068752b719270438e7024ad46
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@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>
The following variables were not documented:
- QMAKE_IOS_DEPLOYMENT_TARGET
- QMAKE_TVOS_DEPLOYMENT_TARGET
- QMAKE_WATCHOS_DEPLOYMENT_TARGET
Change-Id: I5cfb6c0024d92e943aed882fd01bc2a4f2c7c042
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
We forgot to update the warnings when removing qt_cancelIo.
Also, use %p instead of %x, because HANDLE is void*.
This amends commit fade2958.
Change-Id: Ia11d7d094aa6beb939e0be4bbe4ab3654eaa1c02
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
de63bbd2f8 introduced a new
QPlatformTheme::standardButtonShortcut which would then unconditionally
overwrite the QPushButton shortcut, even when empty, breaking activating
mnemonics potentially included in the button's text.
Task-number: QTBUG-61197
Change-Id: I2a5a460a820a5ab4054eb44f349066aaeca1436f
Reviewed-by: Marco Martin <notmart@gmail.com>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
silent.prf modifies the compiler commands by prefixing them with a
silencing echo command. For MSVC, the used $< syntax is only valid in
inference rules. However, the PCH rule is not an inference
rule and breaks when silent.prf is used.
Remove the echo command for MSVC. The compiler already outputs the
currently compiled file. There's no need to do it twice.
Task-number: QTBUG-61688
Change-Id: I7e2c1211e471c9c149c16cac8e87406e88ee2d97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
By deferring the image resizing until the first beginPaint after the
resize we can be sure to have a platform window, simplifying the logic.
Change-Id: I5409522563a62794b111dac7f817bc3cae6bf4e8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
.. thus making it purely into a _runtime_ check of XInput 2 version.
If Qt was build with -no-xinput2, it does not make sense to compile
in code that always returns "false". Simply exclude code that is not
relevant for -no-xinput2 builds with XCB_USE_XINPUT2 ifdefs. In
addition, this improves readability of the code.
Now, trying to use ::isAtLeastXI21() in a -no-xinput2 build will
result in the following build error:
error: ‘class QXcbConnection’ has no member named ‘isAtLeastXI21’
Change-Id: If242510d43d71829b327edc1f76322f3a0db0e08
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The tests uses QWindow::requestActivate() to verify that a window does
not become active when a modal dialog is running, but on macOS we have
no guards for this, so the test can potentially fail.
In addition, due to a bug in QCocoaEventDispatcher, we end up waiting
5 seconds for that failure to manifest.
Task-number: QTBUG-61965
Task-number: QTBUG-61964
Change-Id: I2f1b62d953e9b6dabf2df0c3023564f27919c498
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
There is no need to check for it explicitly.
Change-Id: I66958bf1ff4539ee75fec635c96f056524da8ddb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Some of the functions had wording that suggested people subclass
QBackingStore, probably because the docs came from QWindowSurface
in QWS times.
Clarify the role of the region, window, and offset arguments
to flush(), in the case of flushing child windows.
Document that paintDevice() is only valid after calling beginPaint(),
and should not be cached.
Although our own QRasterWindow, and the rasterwindow example, both
allow backingstores for child windows, and it works in practice on
a few platforms, we keep the documentation stating that they should
only be used for top level windows, until we've verified and
formalized support for this across platforms.
Change-Id: I7b4d6128a0cd2faeb2af9405ac1bcca46440ead1
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The square root of a sum of squares is easier to read and should be
computed more accurately if done for us by hypot(). Variables set
only once should be set as an initializer and declared const, to make
clear this is what's happening. Loop variables can be local to loops.
Adding a value to, or subtracting one from, a multiple of itself just
multiplies it be one plus (or minus) the multiplier; assigning the
result to the same variable is clearer as a *= (especially when the
factors are now overt numeric constants). An array of 16k floats all
updated in locksteck to the same value can be replaced by a single
float that holds that value. Simple things should not be needlessly
made more complicated - especially in example code, which should be
pedagogic.
Change-Id: Idab585cd7df1399c250d4b9f1396a085ae8f3864
Reviewed-by: hjk <hjk@qt.io>
The test assumes that resizing a QWidget to 0x0 will result in the
QWindow ending up with that size, and hence not being exposed, but
this is not the case. On a QWindow level we treat 0x0 as a trigger
for the platform layer to set the default size, and the window
ends up exposed.
Ideally QWindows should allow 0x0 sizes, but this is a bigger change.
In the meantime, we skip the tests so that other changes can be
integrated without the test failing.
Task-number: QTBUG-61953
Change-Id: Ib17187b4afd1b06eaa76653be18e93abea555b59
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
The classes themselves and their equality operators are used in
constexpr functions/ctors (in QKeyValueIterator) so Visual Studio 2017 expects
them to be marked constexpr as well. Currently this causes a compilation error
when instantiating a QKeyValueIterator using either of these iterators.
Change-Id: I2e3eeaf3b3f11f381a63875e6575dfd82fe56fcb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
By printing the corresponding QPlatformWindow and QWindow for a given
QNSView we make it easier to track issues regardless of which of the
views/windows are being logged.
Change-Id: I4a42eff7f87cf3c8e722cd6ad8baccd4eeab8eb3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It was used in QWS to account for window decorations, but hasn't been set
to anything since 2011, when the code that set it was removed in 6ce6b8a3.
Change-Id: Ibfd37b37c2055221029341443fb768ad620effa2
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The references to the this pointer look somewhat alien in the
documentation, because it isn't part of the signature. Rather make
the relationship explicit.
Change-Id: I6de516e165ea6e9c4ee2898836e9490fbaf4545c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Consider the raw string \\\\. The previous algorithm would consider
the last 3 \ to be escaped because the previous character is a \ and
thus calculating a maxLength of 3.
But this should be treated as two escaped \ with a maxLength of 2.
Change-Id: I6c4b8d090a2e1c6e85195d5920ce8b80aea1bc2d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Things that were broken:
- The return values of XIQueryVersion interpreted wrongly. BadRequest
means no XI2 support on the server. Nesting more XIQueryVersion
calls to check for lower minor version of XI2 in this case does not
make sense. On Success, server's supported X Input version is returned.
Server's supported version can be lower than the version we have announced
to support. In this case Qt client will be limited by X server's supported
version (which is ok, as we do check the available version at runtime via
QXcbConnection::isAtLeastXI2*).
- The code was _always_ announcing to X server that we support XI 2.2,
by ignoring what actually is supported in the specific build (see
XCB_USE_XINPUT ifdefs).
- qCDebug messages and logging categories were wrong too.
Change-Id: Ia84457f125474aa851b7a91ed19fc5b904ac359e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This includes:
- Better sharing of common code.
- Less argument passing.
- Improved code readability:
It is somewhat confusing to read when QXcbWindow::handleEnterNotifyEvent
calls connection()->handleEnterEvent().
- Better organizing of ifdefs.
Change-Id: I4405390cada13b51db78f9fd30e26bb1793395ff
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
... as XI2 reuses device ids and we might end up with some bogus
objects in m_touchDevices (the same touch device after reconnecting
might have a new device id).
With this patch, m_touchDevices is handled similarly to tablets
and scolling devices. This patch also removes unnecessary calls
to X (XIQueryDevice). We already have device information available
for all devices when populating m_touchDevices list, so calling
XIQueryDevice again for every device id (which we haven't already
concluded to be a tablet device) is a redundant round trip to X.
For consistency with other device types, extend touch device data
structure to store the necessary device details, instead of holding
pointers to XIDeviceInfo. And allocate touch device objects on
stack instead of heap, also for the consistency reasons (this way
we won't need to special case m_touchDevices when running some
management task on _all_ devices, e.g. removing a device with id=n
when it was disconnected).
Change-Id: I9f6edfaf24da911dd21ec45cd48dfdd6d0dcdf8b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The documentation claims that QGuiApplication forwards the top-level
windows. However this appears to be a search & replace mistake from the
QApplication <> QGuiApplication separation times. Only QApplication
forwards the event to top-level widgets and changeEvent() is a virtual
method of QWidget. Nothing is implemented for plain QGuiApplication and
QWindow.
Change-Id: I71b05ecebc90f7c28e150590764438ebaa90e88f
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Change-Id: I419f884f4145dbe2b60751bf6cde3968cf34fe4a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: Ia4f4f62675a2c2e63e36c5fbf6d869e0ab8e1a9f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: If0dc8f90c657e09fc71bfae1fbffe6be980453da
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When you are using a query that pulls from a number of different tables
then it can be ambiguous as to which table a particular field belongs to.
So this will make it possible to determine the table that a given field
belongs to if it is set.
Task-number: QTBUG-7170
Change-Id: I49b7890c0523d81272a153df3860df800ff853d5
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QVariant claims to be able to QVariantHash and QVariantMap, but the
actual conversion implementation is missing.
Task-number: QTBUG-61471
Change-Id: I0cba74642aa77dc423effed289bc7619922a89eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>