In the process, also have it only scan number systems once, caching
the result, rather than scanning all of them for each locale. This
means we only see the new warning messages once, too.
Task-number: QTBUG-69324
Change-Id: Ia0695a0ba6159b50748a61e9949ad5bd07e4c4c3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
When I wrote zoneMSecsToEpochMSecs I seem to have copied names from
localMSecsToEpochMSecs, that need a s/local/zone/ change to their
names to make sense in this context. Flipped an if/else for clarity
in the process.
Change-Id: If2b288532b16d999f6ff0b9241e2dbcbc016b010
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is the introduction text to signals and slots and should rather
show best practices. Using context is generally advisable to have
life-time of connections under control.
Change-Id: I213b13d978a38e13834cdbccf1bea06d53ba8320
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Some colors, like selectedMenuItemColor, won't return
the right value anymore. Other can be updated to new
system UI element colors for more accuracy.
Task-number: QTBUG-68891
Change-Id: I781ef47791648f332208eb780361c60ffb6fcb96
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
They return regular iterators, since the container has been modified.
Change-Id: Id59bdd8f1a804b809e22fffd153f92d4460f9b76
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
By using constFind(), we won't detach if the item isn't there. Both
extract() and erase() can take const_iterators.
Change-Id: Id59bdd8f1a804b809e22fffd153f92989ef84644
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
All supported compilers support it.
Doing this just for the new API. We should do it throughout Qt, but only
if it won't interfere with the header review.
Change-Id: Id59bdd8f1a804b809e22fffd153f9254688e5152
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It's a false positive, since we've checked that the item HasByteData.
But it's cheap to rewrite so the warning is silenced.
>>> CID 190741: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a null pointer "this->byteData(idx)".
Change-Id: If48c5c2e920c433298f1fffd153f7534be42a30b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Found by Coverity:
>>> CID 190746: API usage errors (STREAM_FORMAT_STATE)
>>> Changing format state of stream "dbg" for category basefield without later restoring it.
Change-Id: If48c5c2e920c433298f1fffd153f74f9bbe7ef29
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In order to add the listener, we need to hook into the internal HWND.
Creating the QThreadData (thus adopting the thread) and the event
dispatcher are ok because they would happen anyway. QFileSystemWatcher
works only with the Qt event loop.
[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that caused
addPaths() to crash on Windows if adding a path to be watched on
removeable storage, if that addPaths() was called on a thread not
created by QThread and no QEventLoop has been created yet.
Task-number: QTBUG-69320
Change-Id: If48c5c2e920c433298f1fffd153ee20bea56c62f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
In some places we call startingUp(), in others we don't. It's probably
ok for those that have just created an object of a given class, which
knows whether the virtual call is necessary or not. But for the generic
case, we do call it.
Change-Id: If48c5c2e920c433298f1fffd153ee1cc75703204
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No need in ugly macro ioErr and if-ery, no need in generic noErr.
SecureTransport has its own, more specific error codes: errSecIO
and errSecSuccess (which have the equivalent values).
Change-Id: Ifd99fbcbee290fe27caa0c258923f4527c047ba8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
There was no public API for doing case-insensitive comparisons
of QStringView.
Task-number: QTBUG-69389
Change-Id: I1b021eefec35e135b97fb87704c8dc137232d83d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The flow of changing the window state, especially for fullscreen, is
complicated enough that it helps to keep the code together.
Change-Id: I216ff95c03fc149f42a0199f7c3bc4fb04ff5e6e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
OpenSSL has 'no-dtls' configure option (or can be too ancient to properly
support it), we shall respect such builds. This patch extends configure.json
with a 'dtls' test and adds protection against linkage/compile-time
issues in the QtNetwork's code.
Change-Id: I0c0dd94f5c226115cee4285b82c83aa546555aea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
These are leftovers from the prototype version of DTLS connection
and no code is using them now.
Change-Id: I3970a56303a59ce95e9c22344fac89e89f6559c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Replaces the handling of tablet/touchscreen/touchpad/mouse input with a
unified implementation based on the Windows Pointer Input Messages added
to Windows 8. The legacy implementation is still used for Windows 7.
Task-number: QTBUG-60437
Change-Id: I0a0f48ee9d5365f84ba528aa04c6ab1fe4253c50
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fixing some issues that could cause intermittent or environment-dependent
failures. One kind regards the use of multiple QTest::mouseMove()
calls in sequence internally using the QCursor API, causing timing
dependent failures. Switching to the override that does not require the
QCursor API, where possible. Other test could fail depending on the size
of the screen.
Change-Id: I4a368955ddbb48f729dcdf74c20eb163329936b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The logic seems to be simple - if client code on error signal
tries to close TLS socket and this socket has buffered data,
it calls 'flush' and 'transmit' or even 'startHandshake' as
a result, which in turn will set and emit error again. To auto-
test this, we initiate a handshake with pre-shared key hint
on a server side and both client/server sockets incorrectly
configured (missing PSK signals). We also do early write
into the client socket to make sure it has some data
buffered by the moment we call 'close'.
Task-number: QTBUG-68089
Task-number: QTBUG-56476
Change-Id: I6ba6435bd572ad85d9209c4c81774a397081b34f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This patch allows the developer to pick which keyboard modifier
increases the number of steps a QAbstractSpinBox takes when the user
interacts with it.
The modifier can be either Qt::ControlModifier (default),
Qt::ShiftModifier or Qt::NoModifier. Qt::NoModifier disables the step
modifier. Note that on macOS, Control corresponds to the Command key.
Holding the modifier increases the step rate when:
- scrolling;
- pressing the up/down keys;
- pressing the spin box up/down buttons.
[ChangeLog][QtWidgets][QStyle] QStyle::SH_SpinBox_StepModifier allows
the developer to pick which keyboard modifier increases the number of
steps a QAbstractSpinBox takes for the following interactions:
scrolling, up/down keyboard keys and the spin box buttons. The
Qt::ShiftModifier can now be used, or the feature can be disabled
using Qt::NoModifier. Previously, only Qt::ControlModifier could be
used as the modifier.
Change-Id: Ib5518127e86a8f67798a9a1d6e860c6e35896e6f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Do not return false for loading an empty .qm file - that is, a valid
file without any translations. We're already shipping empty .qm
files for English translations of Qt since a while, mainly as a
stop for the QTranslator::load(const QLocale &, ...) logic.
Note that QCoreApplication::installTranslator() will still return
false for an empty translation file - which is ok, because it
arguably does not make much sense to install it.
[ChangeLog][QtCore][QTranslator] It is now possible to load qm files
without any translations. This is particularly useful for the
language the untranslated strings are written in; logic to
load translations can now handle the source language like all
other languages.
Task-number: QTBUG-31031
Change-Id: Ibcb84aa755538cb2fa21b14f8635295a58440bbb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
- Detect the tray icon window in the platform plugin by the object
name. This way we don't need
QXcbWindowFunctions::requestSystemTrayWindowDockIdentifier().
- Get rid of unused calls
QXcbIntegrationFunctions::xEmbedSystemTrayVisualHasAlphaChannel()
and QXcbWindowFunctions::setParentRelativeBackPixmap().
- Mark the tray icon window as embedded to be able to get the correct
result from QWindow::mapToGlobal(). It allows to drop
QXcbWindowFunctions::systemTrayWindowGlobalGeometry().
This change allows to remove the intermediate level between
the QSystemTrayIconSys widget and the xcb plugin. The code looks
clearer.
Change-Id: I7d067131287a6dec162b36f0bddc8cb518aaa38c
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
With the current method of painting the tray icon with 24 bpp
visuals we grab the window's background once on the first show
and then use it in all paint operations. This leads to a wrong
background if an application shows the system tray icon when
the lock screen is active.
We can avoid this by painting with XRender when it's available.
This change introduces QXcbSystemTrayBackingStore and moves the
selection of a suitable painting method from QSystemTrayIconSys
into it. In addition the visual for the window is selected
according to the system tray specification and the platform window
for the tray icon is created without needless OpenGL and Vulkan
support.
Task-number: QTBUG-55540
Change-Id: Ib3ca42bc02dcbdd4ccfe5d6e23f870ef22f0d25a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This flag was introduced to serve as a replacement for a dedicated "interactive" boolean
argument in method calls guarded by Polkit.
Change-Id: Ida91c9872e70f8ca6672563d0ca6642f38c498ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
To resolve the challenge of connecting Docker containers from the host
without extra user-efforts, Avahi is used to publish the Docker-based
test servers (Docker containers) on a local network. It is a free
Zeroconf implementation, and it provides multicast DNS (mDNS) service
discovery. By default, mDNS only resolves hostname ending with the
".local" domain. In this change, the domain name of test servers is
changed to "test-net.qt.local". As stated in the standard, the DNS query
for a local domain will be sent to the mDNS multicast address. It avoids
the need for root access to modify system files.
Task-number: QTQAINFRA-1686
Change-Id: I255fba0720ee6d0e84c9cb5ca9289d4466578922
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
the callback is specific to qtbase/configure.json, so it belongs into
qtbase/configure.pri.
amends d90db0f136.
Change-Id: I905f985e2d3d2e42c4587cbacdea8dc3eb09a5be
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
- Remove redundant pingTimer.start() call (timer is not a single
shot timer and already started before this point in code).
- Use connected UDP sockets to show that it can work with QDtls.
- Replace (translated) string concatenations with formatted strings
and 'arg' where needed.
Change-Id: I8dba54f43464a718062cd897d24f89b75b99f2a4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It can be useful to detect that a window belongs to an
application running on a remote host. E.g. a window manager
may display the name of the remote host in the window title.
Or it can detect whether a client can be killed.
This property is set by Xlib's function XSetWMProperties(),
which is called by GTK and Qt 4, so it's also good to do
for consistency.
Change-Id: I0693156635cb2696b2fbe7006cbecb25d2680513
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
We're no longer using this code path for QWindow::requestUpdate()
Change-Id: I000304a4f1a6ea2c3a4e8268ae978dedd968e07c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We need to use macros because MSVC is a crappy C compiler.
Change-Id: Ieb48f7c0dd0e4e0fb35efffd153b8af62d34ebdf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Libraries are placed in a subdir "haswell/" of the main library dir,
whereas plugins are simply named with ".avx2" appended to the plugin
name (plugin.so.avx2). The "haswell/" library directory suffix is a
convention found in glibc since version 2.26, whereas the ".avx2" and
".avx512" suffixes are a convention found in the Clear Linux OS for
Intel Architecture.
This patch implements this for all Unix OSes, except for Darwin, where
the fat file format already has a sub-architecture for Haswell
(x86_64h).
We could also implement the "sse2/" subdir search for libraries, but I
don't think it's worth the cost in 2018.
Change-Id: Iff4151c519c144d580c4fffd1539fe5ee9a4d7b1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As the comment says, Haswell is a nice divider and is a good
optimization target.
I'm using -march=core-avx2 instead of -march=haswell because the latter
form was only added to GCC 4.9 but we still support 4.7 and that has
support for AVX2.
This commit changes the AVX2-optimized code in QtGui to Haswell-
optimized instead. That means, for example, that qdrawhelper_avx2.cpp
can now use the FMA instructions.
Change-Id: If025d476890745368955fffd153129c1716ba006
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We never call [QNSView init] directly, so there's no point in splitting
up the logic.
Change-Id: Ie40705a3a78c0d732a3f3378c6e8fa76dc6c68e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Items in the cache may be part of the parent/child hierarchy. Make sure
not to have dangling pointers in the cache, but rather cleanly remove
all interfaces that get deleted since they may delete each other (TabBar
deletes its child interfaces for example.
Task-number: QTBUG-69283
Change-Id: Iad17cd1d3356804b3d8cbba8632ec22b836c3521
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>