The resize event should not be used to draw, as there will be a follow-up
exposeEvent delivered just after, and we don't want to draw twice.
This is how QRasterWindow operates too, except it defers the backingstore
resize to beginPaint() instead of resizing in the reizeEvent.
It's also how QOpenGLWindow operates, which also has a note for the
virtual resizeGL method saying: "Scheduling updates from here is not
necessary. The windowing systems will send expose events that trigger
an update automatically."
Change-Id: I2a9740018508c2eb129149f53237ee8e378c03b1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The updateLayer function is only called when the layer is a
_NSViewBackingLayer instance, which is what the default
implementation of [NSView makeBackingLayer] returns.
Once we move to optionally returning a CAMetalLayer, we need
to use the more generic displayLayer: API, so we do that now
as a first step.
This matches the way we draw and send expose events on iOS.
Change-Id: I49721ff005ca9dfddebff645705f96b5ab46abb4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QRegExpEngine is immutable once created, so we can easily share
them between different QRegExp instances. This requires a QHash for
engines that are currently in use in addition to the cache for
currently unused engines.
Task-number: QTBUG-65710
Change-Id: I165c12a7b065c488ecd14258a7cdfe0e62666632
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
If we pass nullptr as a buffer parameter, ERR_error_string uses
a local array with static storage duration, which makes ERR_error_string
non thread-safe. Instead we can use ERR_error_string_n with our
own buffer. As for the size: docs are inconsistent, sometimes
they say 'at least 120 bytes long', sometimes 'at least 256 ...'.
Their code (ERR_error_string implenented via call to ERR_error_string_n)
has buf[256] and so we do. I know this will enrage our Mr. Bot, but I've
removed a stray whitespace.
Change-Id: I4b8cc7b6b9af1a34fc87a760927a493332cdd0a5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
selectFile() is a no-op if the dialog is visible and
its line edit has focus, which will happen at some
point after show() is called.
In other words this is a race, and the test will pass/fail
depending on the timing of the platform implementation.
Task-number: QTBUG-66536
Change-Id: I03957edb6496d17af7a8ed1d4ca86435375e0d40
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Don’t assume that there is an active modal widget
on QApplication::focusChanged(). That signal can also
be emitted on focus clear during dialog destruction.
Task-number: QTBUG-66536
Change-Id: I20c64339c56a52b39c26a7683b62779deba576d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add null-pointer checks to QCocoaEventDispatcher::
currentModalSession():
- window->handle() may return nullptr if the window
has been destroyed.
- We call beginModalSessionForWindow, which processes
events. This can potentially destroy or delete the
current window; pointers to it must be checked again.
This also has the effect that currentModalSessionCached
is not set to a session that does not have a window,
also prevents clearing the cleanupModalSessionsNeeded
flag for such sessions.
Task-number: QTBUG-66536
Change-Id: Ie055933c872a8ede3c938882fb2d4f7cf8ff3c81
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add qWaitForWindowExposed() calls in addition to the
existing qWaitForWindowActive().
Depending on the platform, window activation events may
be synchronous, which means that a window can (and will)
become active before it becomes exposed.
This causes test failures for tests that count paint
event, and does not wait-for-exposed, when the expose/paint
event is delivered after waitForWindowActive() has returned.
We need to keep the waitForWindowActive() as well: the
test has several qWait() calls with he comment:
“Increase the probability of window activation not
causing another repaint of test items”.
These qWait() calls can possibly be removed in a future
commit.
Task-number: QTBUG-66536
Task-number: QTBUG-61967
Change-Id: Ie61bba058b583fdd1d80e600475aff3efccc32eb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This test function was removed from the blacklist as
a part of the cleanup in 2056bc6b, but is still flaky
on CI.
Change-Id: I348ed167dff6fd618ede28456ada6da86ee341cd
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Previously we were using a treeview that wasn't very clear it
was editable, now we simply use QComboBoxes that are much
more clear the user can change the values
Change-Id: Ied9bca195f4cb275115213631e21cd6a15544311
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This patch adds several macros, functions and typedefs,
needed by DTLS, into our qsslsocket_openssl_symbols.
Change-Id: I9e4dccc0c576b26b3f629cee6e3245e707604674
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This allows to share the connector id for external applications
and drm layers embedding.
Change-Id: I87d4c257c8d8600665eb2328f8b44df3f1ac3c0a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
We need to make sure we update the eglfs plane properly even
when we are forcing the rendering plane index.
Change-Id: I0cd19fbc53c34f28d55708ba2c8e84278e1d7e7d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Although not defined, the jpeg comment field 'content' is treated as
utf-8 nowadys. At least exiftool and exiv2 (tested via gwenview) are
expecting utf-8 here. So we should do the same.
Task-number: QTBUG-44709
Change-Id: If84dafac3e337c7993f09cd59792e721977c9adb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QTreeView is stretching the last section by default which was not
considered in this test. It worked by accident on linux because
there the default section size is 100 and the default window width
is also 100. On windows this was not the case and therefore the
test failed.
Task-number: QTBUG-51149
Change-Id: I9be1c1e942fc19817713773fe29d4afa93d73232
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Add larger pixmaps for the title bar and tool bar extension
icons.
Task-number: QTBUG-38776
Change-Id: If2514f7aa66fa46d25133165ca45318a5045d387
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Make way for adding equivalent icons to QCommonStyle.
Task-number: QTBUG-38776
Change-Id: Idcaee880dcd8727565ddf8cdb5ac5685670f9716
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Factor out the line edit displaying the code to a class and add
another instance for displaying raw string literals.
Task-number: QTBUG-60635
Change-Id: I4614e4a56e355bad5158523c58edf784868dbf4d
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This is used by qfloat_f16c.c → qsimd_p.h → qsimd_x86_p.h.
Change-Id: I359898686ce545f69847fffd151c785237a54b94
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Makes it easier to get an overview of the code, work on separate
sections/areas in isolation, and highlights which part of the APIs
we are using from outside of QNSView, and internally between the
different parts of QNSView.
Change-Id: Ia2c5ab9a68bf75feddba853ac20d3bb397f7564b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We've never had the policy to declare every function that we override,
so to clean up the headers and for consistency we remove any declaration
that's not part of the public interface.
Change-Id: Ie71dc062b9d2252872e1434ca19f8f537cdd6f96
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
- Format selectors consistently
- Use proper style for init methods
Follow-up to ba871065e0
Change-Id: I5742e248b83d5955b1d110038dd1b4d79d701fbb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Change the code to detect mouse mode only the first packet after
receiving the enter proximity event, using the current tablet
position. This should prevent mis-detecting mouse mode due to lags, etc.
There is a theoretical chance of failing to detect mouse mode should the
positions match resulting in differing speeds of mouse/tablet positions, but
this seems to be a negligible risk.
Task-number: QTBUG-36937
Task-number: QTBUG-64781
Change-Id: I27ca4a17786164dc8b25c4614a88672e150d5fe3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When network access is disabled, every QNAM request returns a
QDisabledNetworkReply instance, which emits error and finished
immediately. However isFinished() was still false, which could confuse
application code.
Change-Id: Ifd43c86364b11a9583a38fde536e6c09c109b55f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This patch will allow to set the video mode with DRM atomic API when available.
Using Atomic ModeSetting will allow further to enable framebuffer upscaling which is
something not possible with DRM legacy API or at least not supported on all devices
in a reliable way.
Change-Id: Ie340585cf4cbf5d65555c9a7c547dcbadb327fc0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
When Qt is configured for both debug and release, and frameworks are
enabled, we produce two dynamic libraries inside each framework, eg:
QtCore.framework/QtCore
QtCore.framework/QtCore_debug
When building an executable against these frameworks, we pass -framework
QtCore, and the resulting executable will have its LC_LOAD_DYLIB load
commands pointing to e.g.:
@rpath/QtCore.framework/Versions/5/QtCore
When running the executable, the dynamic loader will load the dynamic
library dependencies based on these load commands.
By setting the DYLD_IMAGE_SUFFIX environment variable at runtime to
'_debug', the dynamic loader will prefer the debug versions of each
library inside the frameworks.
Unfortunately the use of an environment variable to choose debug or
release versions leaves room for mismatches between the executable
and the libraries that are loaded. An executable built in debug
mode will at runtime pick up the release versions of the Qt libraries
unless the DYLD_IMAGE_SUFFIX has also been set to match the build
configuration of the executable.
This results in confusing situations such as building your application
in debug mode, and then stepping into Qt code but not getting any
symbols. Qt Creator has an option to run the application with
DYLD_IMAGE_SUFFIX set, but this is not enabled by default due
to the startup cost of loading the Qt debug libraries.
More critically, it results in tests failing when the tests are using
QTest::ignoreMessage to ignore warnings produced by Qt, and these
calls are ifdefed (correctly) inside QT_NO_DEBUG, as the test
(built in debug mode) will then expect warnings from Qt, but those
warnings are not emittet, as the test is run against the release
version of the Qt libraries.
To mitigate this mismatch, we now link the Qt frameworks using
an explicit suffix, just like we would for no-framework builds
on macOS, for debug and release builds on Windows, and for
normal builds on other Unixes, leaving the dependency chain
for the application predictable:
@rpath/QtCore.framework/Versions/5/QtCore_debug
This also conceptually matches how Xcode builds applications and
frameworks, where it never relies on DYLD_IMAGE_SUFFIX, and instead
uses two separate build directories, one for each configuration.
The change means that Qt Creator will always load the Qt debug
libraries if the application is built in debug mode. For Qt
development this is a good thing, as you expect to be able to
step into Qt code. For our users, the added startup cost can
be mitigated by shipping our binary packages as release-only,
but with separate debug info enabled.
Change-Id: Ib9f1f2dab90ed00b9fb011200e3a69c71955e399
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
If a target item was passed, QGtk3Menu tried using gtk_menu_set_active()
to select the target item. However, the function does not do what you'd
imagine. Even the documentation states:
This is used by the GtkComboBox and should not be used by anyone else.
The correct function, gtk_menu_shell_select_item(), is in the GtkMenuShell
"base class".
Change-Id: Ia2c03f87bb97f618c041c03011af8c676108aea5
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
When using QTextOption::ShowTabsAndSpaces then spaces and nbsps
would appear the same. So since using the degree symbol to
illustrate nbsps is an accepted standard, we use that and spaces
are illustrated as before.
[ChangeLog][QtGui] Display non-breaking spaces as a degree symbol
when QTextOption::ShowTabsAndSpaces is used.
Task-number: QTBUG-57479
Change-Id: I20c72c9e1640457c034b87587a8975cb73228803
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
There was an offset equivalent to all the margins we add to
the action rectangles. We need to subtract it in order for
both menu items, parent and sub-menu, to be aligned. This
amount is given by the sub-menu's first action position
relative to its popup.
Change-Id: I141bbe3cfb81825a25b12e4059b93e61c29df518
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Matches glibc commit 9a0cc8c1bd7645bf3c988890ffb59639c07a5812.
[ChangeLog][QtCore][QUrl] Fixed a bug in parsing IPv6 addresses with
more than 4 hex digits in a component.
[ChangeLog][QtNetwork][QHostAddress] Fixed a bug in parsing IPv6
addresses with more than 4 hex digits in a component.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=9a0cc8c1bd7645bf3c988890ffb59639c07a5812
Change-Id: I2701038131d91eb108aebb3bec16278e4efe3de2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Useful for making sense of the event dispatcher, especially when running
tests.
Change-Id: Iea84bcfb40d4954439c2e31ffc0197c64907e800
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This reverts commit fdddb3a481.
After b85b272c26810e54a4ceb0707cf4569f87517b67, Windows 10
(msvc2017-x86) is tested on Windows 10 (msvc2017-x86_64). The
failure is gone.
Task-number: QTBUG-66798
Task-number: QTBUG-66216
Change-Id: Iba353b18b0be1346007fde674a9f768c4b9bf384
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This reverts commit a0db55040d.
After b85b272c26810e54a4ceb0707cf4569f87517b67, Windows 10
(msvc2017-x86) is tested on Windows 10 (msvc2017-x86_64). The
failure is gone.
Task-number: QTBUG-66756
Change-Id: I4a8e8c62b4a021d144d570c38c4f4c10e8b1317c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Many Android systems come with a locked down system call list, causing
the statx(2) system call to fail with an unexpected error code or by
delivering a signal to the application. Because of the signal, we can't
do runtime detection...
This is not our bug: it's obviously a mistake in the SECCOMP rules in
Android. But we work around the issue.
Unfortunately, because of a few manufacturers who can't configure their
rules properly, everyone will suffer.
Task-number: QTBUG-64490
Change-Id: I39332e0a867442d58082fffd1507a49415917384
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
There is no codepath that can result in d->baseTheme being nullptr.
Remove the checks and get rid unneeded and sometimes dangerous fallbacks
(createPlatformMenuBar(), showPlatformMenuBar() and three more methods
could overflow the stack because of infinity recursion).
Change-Id: Ib03adadf56c169286de42671e2da506502df7aea
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the VK is hidden keep cursor handle the cursor handle visible for
~4s after user last activity.
Task-number: QTBUG-66806
Change-Id: I8122c5886efaeee86bb691ad971aa7a3e3d7f8e1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
- turn CursorHandleShowMode in a QFlag for better control
- add ScopedValueChangeBack which is useful to control m_blockUpdateSelection
- implement longPress word selection
Change-Id: Ieed709644db991e10077d5be5d5a59f16f4fc3a8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>