It is a valid use case to have a vertex shader with no
vertex attributes. Using gl_VertexID or gl_InstanceID
is enough to generate vertex data out of thin air.
Change-Id: If7689914624a84723923fd2d7aef355bda592e24
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It was marked internal anyway. Use the constructor taking a
QMetaType instead.
Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Both normal and relaxed constexpr are required by our new minimum of
C++17.
Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
isNull() would forward to the contained type and check that type's
isNull() method for some of the builtin types. Remove that behavior
and only return true in isNull(), if the variant is invalid, doesn't
contain data or contains a null pointer.
In addition, implement more consistent behavior when constructing
a QVariant using the internal API taking a copy from a void *.
isNull() should return true in both cases. This mainly changes behavior
for some corner cases and when using our internal API.
[ChangeLog][Important Behavior Changes] QVariant::isNull()
no longer returns true when the variant contains an object of some
type with an isNull() method, that returns true for the object;
QVariant::isNull() now only returns true when the variant contains
no object or a null pointer.
Change-Id: I3125041c4f8f8618a04aa375aa0a56b19c02dcf5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Remove the compare method in the QVariant::Handler struct. Rely
on the generic support provided by QMetaType instead.
[ChangeLog][Important Behavior Changes][QVariant] QVariant will now use builtin support in
QMetaType to compare its content. This implies a behavioral change
for some graphical types like QPixmap, QImage and QIcon that will
never compare equal in Qt 6 (as they do not have a comparison
operator).
Change-Id: I30a6e7116c89124d11ed9052537cecc23f78116e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We only support version 4 and 5 in Qt 6.0. 1 and 2 are already gone
(due to being based on binary JSON), now we remove 3 as well.
Task-number: QTBUG-81346
Change-Id: I3627dcc0587f1e36f11e93edf7172889e911d64e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Employ RO0; inherit the constructors from the base class; and
do some code tidies as a drive by.
The inherited constructors bring in goodies like initializer_list
support.
Change-Id: Ia00a3f9b0ccbf182bf837bc65ba2305110c8dc60
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
mkspecs/features/qt.prf adds a dependency on the system threading
library if the Qt Core thread feature is enabled. Because qt.prf is
loaded by any public or internal Qt project, it's essentially a public
dependency for any Qt consumer.
To mimic that in CMake, we check if the thread feature is enabled, and
and set the Threads::Threads library as a dependency of Qt6::Platform,
which is a public target used by all Qt modules and plugins and Qt
consumers.
We also need to create a Qt6Dependencies.cmake file so we
find_package(Threads) every time find_package(Qt6) is called.
For the .prl files to be usable, we have to filter out some
CMake implementation specific directory separator tokens
'CMAKE_DIRECTORY_ID_SEP' aka '::@', which are added because we call
target_link_libraries() with a target created in a different scope
(I think).
As a result of this change, we shouldn't have to hardcode
Threads::Threads in other projects, because it's now a global public
dependency.
Task-number: QTBUG-85801
Task-number: QTBUG-85877
Change-Id: Ib5d662c43b28e63f7da49d3bd77d0ad751220b31
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
QFontDatabase is a singleton and all instances would share
a single, mutex-protected global data pointer. But some functions
were implemented as non-static functions. This caused a lot
of code on the form
QFontDatabase().families(...)
since there was no static access. Other functions were implemented
as static.
To consolidate, we make all functions static. This should be
source-compatible, but not binary compatible.
[ChangeLog][QtGui][Fonts] Some functions in QFontDatabase were in
principle static, but previously not implemented as such. All
member functions have now been made static, so that constructing
objects of QFontDatabase is no longer necessary to access certain
functionality.
Fixes: QTBUG-83284
Change-Id: Ifd8c15016281c71f631b53387402c942cd9c43f6
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QQuickPointerEvent had them, so despite how trivial they look,
it's very convenient to keep using them in QQuickWindow rather than
duplicating these kinds of checks in various places, and for multiple
event types too.
Change-Id: I32ad8110fd2361e69de50a679ddbdb2a2db7ecee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
After enabling Qt::AA_UseHighDpiPixmaps, QIcon::pixmap()
now returns pixmaps larger than the requested size on
devicePixelRatio > 1 screens.
Adapt tests to account for this changed behavior.
Skip tests where it’s unclear what the the expected
behavior is, or where the test logic does not apply
to dpr > 1.
This gives a clearer indication of where we are
(39 passed, 0 failed, 9 skipped), and enables using
the qicon test to catch regressions also when running
at dpr > 1.
Remove the "lowdpi" testcase flags from the qmake and
cmake project files.
Change-Id: Ia7ce722ae356fc496a91b54e9f5d590d13b9df62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Only keep 3, 4, and 5 because 3 is the lowest version where binary JSON
is not used anymore.
Change-Id: Id0319e8eceb845017ed493d0ef6902b53050d5a6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Some compilers implicitly captures, and will warn about the unused capture.
Change-Id: Ib5e1cc3956c7eb0dc87cee834cce8a2b3dd0d30b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The previous implementation multiplexed callback-based event
notification into a single proxy event (cf. 85403d0af), which was
in turn object-waited for (this was the case since the beginning
of public qt history). It makes more sense to multiplex into a
posted message, because that also works with foreign event loops
that do not know anything about our event objects.
Task-number: QTBUG-64443
Change-Id: I97945ac8b5d7c8582701077134c0aef4f3b5a18f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Not sure why this was disabled in the first place.
Change-Id: I66329b55fd46d03fd96818c6c7004718ddea5c79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Move QWindowsMime (which was a public class in Qt 4 and moved to the QPA
plugin in Qt 5) to the platform namespace and add register functions to the
native application.
Move in test code from QtWinExtras.
Task-number: QTBUG-83252
Change-Id: Iaac440e2d5cb370110919921b1eeb779600b5b65
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add conversions from/to HBITMAP, HICON to QImage. Split the pixmap
conversion functions apart to use them.
Task-number: QTBUG-81876
Change-Id: Ic0c41a402a1f6e9bec572fc4d691357bd48e6423
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
As of 951d490750, high-DPI support
for pixmaps is enabled by default, which makes this test fail
when running on a local system with a high-DPI display.
Change-Id: I3fe4674d19a57bf82aa32b01d470c714092f7e62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Avoid parsing over the buffer limit, or interpreting non-hex
as hex.
This still leaves parsing of lines longer than 300 chars
unreliable
Change-Id: I1c57a7e530c4380f6f9040b2ec729ccd7dc7a5fb
Pick-to: 5.15 5.12
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
It is unnecessary to create a QList container just for comparison.
Split out helpers for comparing sequence sizes and sequences from
qCompare(QList) and add a template for an array with a non-type template
parameter for the size.
One can then write something like:
const int expected[] = {10, 12,...};
QCOMPARE(QFontDatabase.pointSizes(...), expected)
Unfortunately, any commas in such an array will be misread by macro expansion
as macro argument separators, so any expected array with more than one entry
needs an extra macro expanding __VA_ARGS__.
Change-Id: Ie7c8dc20bf669bbb25f6d7f8562455f8d03968c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Expand the getSetCheck to include all properties, and add a test to
verify the fallback logic for the tooltip property.
Use the meta object system to set and check properties in the
tooltip-test to verify that things don't break when migrating to
the new property system.
Change-Id: I56355e8b436ede46701a124a9241ed26d2c706c5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Change the functions to operate in float and add the
QPoint versions as overload calling them. This is
more in-line with the event accessors using float
and allows for removing some workarounds using a delta when
converting touch points.
Leave QPlatformWindow::map(To/From)Global() as is
for now and add helpers for float.
Change-Id: I2d46b8dbda8adff26539e358074b55073dc80b6f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In this case the srb represents the layout only, and can still be used
to create a pipeline. For setShaderResources() one will then need to use
another, layout compatible, srb that references valid resources.
Change-Id: I3ea5b63df3be8847540ca4c0c40fbd29dbed8fb7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Some goals that have hopefully been achieved are:
- make QPointerEvent and QEventPoint resemble their Qt Quick
counterparts to such an extent that we can remove those wrappers
and go back to delivering the original events in Qt Quick
- make QEventPoint much smaller than QTouchEvent::TouchPoint, with no pimpl
- remove most public setters
- reduce the usage of complex constructors that take many arguments
- don't repeat ourselves: move accessors and storage upwards
rather than having redundant ones in subclasses
- standardize the set of accessors in QPointerEvent
- maintain source compatibility as much as possible: do not require
modifying event-handling code in any QWidget subclass
To avoid public setters we now introduce a few QMutable* subclasses.
This is a bit like the Builder pattern except that it doesn't involve
constructing a separate disposable object: the main event type can be
cast to the mutable type at any time to enable modifications, iff the
code is linked with gui-private. Therefore event classes can have
less-"complete" constructors, because internal Qt code can use setters
the same way it could use the ones in QTouchEvent before; and the event
classes don't need many friends. Even some read-accessors can be kept
private unless we are sure we want to expose them.
Task-number: QTBUG-46266
Fixes: QTBUG-72173
Change-Id: I740e4e40165b7bc41223d38b200bbc2b403e07b6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Qt::UNICODE_ACCEL had no effect since at least Qt 4.0. We can drop
it in Qt 6. The whole Qt::Modifier enumeration is still widely
used, so we can't drop it yet, but we should aim at doing so in
Qt 7. Add a note.
[ChangeLog][QtCore][Qt::Modifier] The Qt::UNICODE_ACCEL enumerator
has been removed. It had no effect since Qt 4.0.
[ChangeLog][QtCore][Qt::Modifier] Usage of the enumerators in
the Qt::Modifier enumeration is discouraged. The enumeration
will likely get removed in the next major version of Qt.
Change-Id: If25f30d920878d32903b91a38044f5da042c7eab
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
And generate a few more test projects that were missing.
Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use pro2cmake with '--api-version 2' to force regenerate
projects to use the new prefixed qt_foo APIs.
Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This is in preparation for regenerating them with the new qt_foo
prefixed APIs.
Change-Id: Iff34932d642b1c0186ee39f952adf3ad367fd602
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
There doesn't seem to be any reason users will need to query tablet
devices by their IDs, because every event comes with a complete
instance already, and we have QInputDevice::devices() to list them all.
QPointingDevicePrivate::tabletDevice() can create a new instance if a
matching one is not found (and complains about that); it's intended
for use in QtGui, as a way to find the device if it was not part of the
QWSI event. Now it sets the parent of those auto-created instances
to QCoreApplication to avoid a memory leak.
On the other hand, queryTabletDevice() is intended for use in platform plugins
that need to check whether an instance exists; but they will take care
of creating new instances themselves, and thus have more control over the
parent and the details being stored. Now that the systemId can also be given,
the search is more likely to have a unique result, on window systems
that provide device IDs.
Rename id() to systemId() to clarify that it's a system-specific unique
device ID of some sort, not the same as the uniqueId that a stylus has.
However it seems that in practice, this will often be 0; so clarify that
if it's not unique, QInputDevicePrivate::fromId() and queryTabletDevice()
may not always find the right instance.
Clarify the function usage via comments.
Change-Id: I82bb8d1c26eeaf06f07c290828aa17ec4a31646b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is required to remove the ; from the macro with Qt 6.
Task-number: QTBUG-82978
Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The change creates a slight source incompatibility. The main
things to take care of are
* code using printf statements on list.size(). Using qsizetype in
printf statements will always require a cast to work on both 32
and 64 bit.
* A few places where overloads now get ambiguous. One example is
QRandomGenerator::bounded() that has overloads for int, uint and
double, but not int64.
* Streaming list.size() to a QDataStream will change the format
depending on the architecture.
[ChangeLog][QtCore][QList] QList now uses qsizetype to index into
elements.
Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the default format has letter and word spacing set then these
should be exported in the HTML's body tag. This also adds support
for the reading of letter-spacing and word-spacing set too, so that
the same html outputted can be read back in.
Fixes: QTBUG-83718
Change-Id: Ic4afca21eb05efb779dbf99c6b3c13373e851f15
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The API is available by including qopenglcontext.h as usual,
but scoped in the QPlatformInterface namespace. The namespace
exposes platform specific type-safe interfaces that provide:
a) Factory functions for adopting native contexts, e.g.
QCocoaGLContext::fromNative(nsContext, shareContext);
b) Access to underlying native handles, e.g.
openGLContext->platformInterface<QCocoaGLContext>->nativeContext()
c) Platform specific functionality, e.g.
static QWGLContext::openGLModuleHandle()
openGLContext->platformInterface<QEGLContext>->doSomething();
The platform interfaces live close to the classes they extend,
removing the need for complex indirection and plumbing, and
avoids kitchen-sink modules and APIs such as the extras modules,
QPlatformFunctions, or QPlatformNativeInterface.
In the case of QOpenGLContext these platform APIs are backed
by the platform plugin, so dynamic_cast is used to ensure the
platform plugin supports the requested interface, but this is
and implementation detail. The interface APIs are agnostic
to where the implementation lives, while still being available
to the user as part of the APIs they extend/augment.
The documentation will be restored when the dust settles.
Task-number: QTBUG-80233
Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Skip crashing tests and ignore failing tests on CMake platforms.
Add missing QTEST_ENVIRONMENT=ci env var assignment to Coin test
instructions. This was hardcoded by the Coin code for qmake
configurations.
Task-number: QTBUG-85364
Change-Id: Id2312e504a0d36b8f8596d4cebaa49c63731406e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The platform plugins are implemented to grab the entire screen if
no window ID is provided. They do not grab the entire virtual
screen, just the screen the method is called on.
On macOS, the implementation ignored the window parameter, and
always grabbed the entire virtual screen. This change fixes the
cocoa implementation. The test passes in local tests (with two
displays with different dpr). Since grabbing a screen returns an
image with managed colors, we need to convert it to sRGB color
spec first, otherwise displaying a grabbed image will produce
different results. This will need to be changed once Qt supports
a fully color managed flow.
The test does not cover the case where a window spans multiple
displays, since this is generally not supported at least on macOS.
The code that exists in QCocoaScreen to handle that case is
untested, but with the exception of the optimization it is also
unchanged.
Done-with: Morten Sørvig <morten.sorvig@qt.io>
Change-Id: I8ac1233e56d559230ff9e10111abfb6227431e8c
Fixes: QTBUG-84876
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Required by OpenXR. A VkPhysicalDevice or an adapter LUID + feature
level pair should be adoptable while leaving the rest (device, queue,
etc. setup) to QRhi as normal.
Change-Id: Iada0972671b037b4efb03e7831b7c9b8c5f2393d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
[ChangeLog][QtCore][QByteArray] Remove method overloads taking
QString as argument, all of which were equivalent to passing the
toUtf8() of the string instead.
Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The idea was to keep nagging us to update all the platform plugins to
do device registration. But besides being annoying, it would cause
test failures if we start adding QTest::ignoreMessage() all over,
and then some platforms start doing device registration properly.
Change-Id: Ia0fbb64cf86f33532be032ec9eebe6e4ad607f20
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
There is no reason for keep using our macro now that we have C++17.
The macro itself is left in for the moment being, as well as its
detection logic, because it's needed for C code (not everything
supports C11 yet). A few more cleanups will arrive in the next few
patches.
Note that this is a mere search/replace; some places were using
double braces to work around the presence of commas in a macro, no
attempt has been done to fix those.
tst_qglobal had just some minor changes to keep testing the macro.
Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This was causing some bogus failures in Qt Quick autotests.
Existing APIs like QQuickWindow::mouseGrabberItem() are not really
compatible with the idea of a mouse-less system; but perhaps we can
revisit this later.
Task-number: QTBUG-85114
Change-Id: Id1c2e5894e5cf13a79998aaea28d5f42fad920cf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We want every QInputEvent to carry a valid device pointer. It may be
some time until all QPA plugins are sending it, but it's necessary to
provide the functions for them to start doing that.
We now try to maintain the same order of arguments to all the functions.
handleTouchEvent(window, timestamp, device, the rest) was already there
(except "device" has changed type now), and is used in a lot of platform
plugins; so it seems easiest to let that set the precedent, and modify
the rest to match. We do that by adding new functions; we can deprecate
the older functions after it becomes clear that the new ones work well.
However the handleGestureEvent functions have only ever been used in
the cocoa plugin, so it's easy to change their argument order right now.
Modify tst_qwindow::tabletEvents() to test new tablet event API.
Task-number: QTBUG-46412
Change-Id: I1828b61183cf51f3a08774936156c6a91cfc9a12
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
...starting with a new feature: registering different devices at
different seats and verifying their capabilities and that we can get
them back again.
Change-Id: I8e58a49080633753d02a76e5fdc4932f5c674e0a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
We have seen during the Qt 5 series that QMouseEvent::source() does
not provide enough information: if it is synthesized, it could have
come from any device for which mouse events are synthesized, not only
from a touchscreen. By providing in every QInputEvent as complete
information about the actual source device as possible, we will enable
very fine-tuned behavior in the object that handles each event.
Further, we would like to support multiple keyboards, pointing devices,
and named groups of devices that are known as "seats" in Wayland.
In Qt 5, QPA plugins registered each touchscreen as it was discovered.
Now we extend this pattern to all input devices. This new requirement
can be implemented gradually; for now, if a QTWSI input event is
received wtihout a device pointer, a default "core" device will be
created on-the-fly, and a warning emitted.
In Qt 5, QTouchEvent::TouchPoint::id() was forced to be unique even when
multiple devices were in use simultaneously. Now that each event
identifies the device it came from, this hack is no longer needed.
A stub of the new QPointerEvent is added; it will be developed further
in subsequent patches.
[ChangeLog][QtGui][QInputEvent] Every QInputEvent now carries a pointer
to an instance of QInputDevice, or the subclass QPointingDevice in case
of mouse, touch and tablet events. Each platform plugin is expected to
create the device instances, register them, and provide valid pointers
with all input events. If this is not done, warnings are emitted and
default devices are created as necessary. When the device has accurate
information, it provides the opportunity to fine-tune behavior depending
on device type and capabilities: for example if a QMouseEvent is
synthesized from a touchscreen, the recipient can see which touchscreen
it came from. Each device also has a seatName to distinguish users on
multi-user windowing systems. Touchpoint IDs are no longer unique on
their own, but the combination of ID and device is.
Fixes: QTBUG-46412
Fixes: QTBUG-72167
Task-number: QTBUG-69433
Task-number: QTBUG-52430
Change-Id: I933fb2b86182efa722037b7a33e404c5daf5292a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The Vulkan spec changed the behavior for VkApplicationInfo::apiVersion
in 1.1, conveniently breaking compatibility with all existing 1.0 logic.
We can no longer assume that the 1.0 behavior, which was failing instance
creation with VK_ERROR_INCOMPATIBLE_DRIVER for an unsupported version,
is always in place. So do not rely on this in the test, and add a
reminder in QVulkanInstance docs as well.
Fixes: QTBUG-85040
Change-Id: I8f5c7a7830877b72d106c444aebfaea191083ee0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Amends 32b586864e, which added an override
of QStandardItemModel::roleNames(). It's good for it to have its own
QHash so that roles can be added, and because
QStandardItemModel::setItemRoleNames() remains un-deprecated; but before
that change, they were the roles that QAbstractItemModel had initialized
from QAbstractItemModelPrivate::defaultRoleNames(). In particular, we
need "display" to map to Qt::DisplayRole by default; several tests in
qtdeclarative depend on that.
Change-Id: I58b2d6aa6b6c78b1d618335ddc4ecb834af57274
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Remove QDestopWidget public header, simplify the implementation that
maintains a Qt::Desktop type QWidget for each QScreen, and turn
QWidget's initial target screen into a QScreen pointer.
QApplication::desktop() now takes an optional QScreen pointer, and
returns a QWidget pointer, so that applications and widgets can get
access to the root widget for a specific screen without having to
resort to private APIs.
QDesktopWidgetPrivate implementations to look up a screen for an index,
widget, or point are now all inline functions that thinly wrap
QGuiApplication::screens/screenAt calls. We should consider adding those
as convenience APIs to QScreen instead.
Note that QWidget::screen is assumed to return a valid pointer; there is
code that handles the case that it returns nullptr (but also code that
trusts that it never is nullptr), so this needs to be defined, verified
with tests, and asserted. We can then simplify the code further.
Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Many of these were generated by clazy using the new qevent-accessors check.
Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The default font on Windows 10 (Segoe UI) will return the
wrong minimum right bearing at some sizes, which will cause
us to skip the textWidthVsWIdth() test at some scale factors,
since we cannot trust the layout to be perfect in this case.
Based on experiment, Arial is more accurate, so in order to
avoid skipping the test, we default to this on Windows instead.
(Note: The problem has not been observed with the default fonts
on Linux or macOS, so we only do this for Windows specifically.)
Task-number: QTBUG-84415
Pick-to: 5.15
Change-Id: I8cdb5d0d9922915a6ed1574d62a561dda0e1dc5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
There are some slight differences between normal drawText()
and QGlyphRuns/QStaticText for decoration widths in certain
fonts. We decided to accept this and tried working around it
in the test by using ForceIntegerMetrics (since the difference
is < 0.5 pixel). This enum has been deprecated, so we move
the tests into Lancelot instead, since the idea here is to
test for regressions, not to compare the two painter commands.
Note that there is something off about decorations with
drawGlyphRuns() and drawStaticText() which is exposed
(not caused) by this, perhaps related to using a matrix
for positioning, since that was untested before.
This also takes the liberty of moving the emoji test string
from text.qps, since this was not in the statictext.qps yet.
Change-Id: Ib2d697095cbd11829cdd50b3c0268c85e9607c78
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.
Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We don't want to have untested qtbase.
This reverts commit 3598ffcc26.
This change also skips two network tests on b2qt.
Change-Id: I5c6f5e19487775f0a1c0feafa5e085208cbf7e9a
Reviewed-by: Liang Qi <liang.qi@qt.io>
The helper processes were not in the correct location.
Change-Id: I0a80a22a931625ea0c9370db38ff29c881b964cb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Since the variable names in QShaderDescription are later compared to
QByteArrays we can gain some performance from not having to convert them
to QByteArrays later.
Task-Id: QTBUG-83706
Change-Id: Iaf80d0966f45cbb09e7c1000b7854bc488e57bb3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Windows unexpectedly passes PM_NOYIELD flag in wParam parameter to the
hook procedure, if ::PeekMessage(..., PM_REMOVE | PM_NOYIELD) is called
from the event loop. So, to ignore undocumented flag, we should
interpret wParam as a bit field.
Thanks to Robin Lobel for research.
Pick-to: 5.15
Fixes: QTBUG-84562
Change-Id: Ib16d7d747aebc9a3628e4ee67478c4d3edeb96f1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Some fonts misreport the minimum right bearing, and in those cases
we may not be able to do a perfect text layout inside the bounds
set. This is a limitation we have chosen to accept.
To avoid random failure when testing this, we detect the case and
skip the test if we see that it may fail.
Fixes: QTBUG-84415
Pick-to: 5.15
Change-Id: I6b53ea2631c5c6e476e2902b5514829a2141796f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
ExtendedRgb should be treated as Rgb as it can be an automatic upgrade.
Pick-to: 5.15
Change-Id: I2942a1067ed5cacb2f60f303f467887cb44c36dd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
For historical reasons we use build and release instead of create and
destroy. This becomes confusing now that more modules in Qt start taking
QRhi into use. Migrate to the more familiar naming, so those who have
used QWindow or QOpenGLContext before will find it natural.
Change-Id: I05eb2243ce274c59b03a5f8bcbb2792a4f37120f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The bold+italic combination indicated by ***triple stars*** requires
this; but it enables combinations of italics, bold, strikeout, anchor
text (and associated link formatting), image alternate text, and inline
code formatting (monospace). A code span overrides the formatting from
surrounding spans (which might be a bug to fix in another patch, if we
compare to how md2html formats code nested in bold-italics for example),
but the format stack restores state when any char format span ends.
Task-number: QTBUG-81306
Pick-to: 5.15
Change-Id: I289556fa53de400eb50a4d159b9b344eafc517da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When storing a void* pointer to the texture handle, we had
to ensure that the variable would exist until the build phase,
which is error prone and caused errors in QQuickWidget because
we copied the texture ID from the FBO into a local variable
before passing it into QQuickWindow::setRenderTarget().
The reason for using a void* was that we cannot know the width
of the handles in the different backends, but we do know that
they are 64-bit at maximum, so instead of storing potentially
dangling pointers, we just make it a 64-bit integer and cast
it back and forth in the backends.
Task-number: QTBUG-78638
Change-Id: I7951e24351ddb209045ab6197d81eb1290b4da67
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The native command buffer handle was not updated, so the subsequent
finish() call attempted to record an invalid VkCommandBuffer. The
problem was not present with offscreen frames, only when finish() is
called with a swapchain-based frame active.
Task-number: QTBUG-84066
Change-Id: I9c4cb701c3dbbc28f237d6ae1cbf65aafd1fa95f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
It simplifies the API and reduces surprise to have rotation working by default.
On Android, the manifest specifies which orientations the application has
been designed to support; on iOS, it is controlled via the
UISupportedInterfaceOrientations property list key.
In addition, QWindow::contentOrientation() is another way to give
a hint to the window manager, or on iOS to directly control whether
the window's rotation is locked or not.
Task-number: QTBUG-35427
Task-number: QTBUG-38576
Task-number: QTBUG-44569
Task-number: QTBUG-51012
Task-number: QTBUG-83055
Change-Id: Ieed818497f686399db23813269af322bfdd237af
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Also remove dead code that isn't compiled anymore in Qt 6 builds.
Change-Id: I7a7ae35e61fb2ad9cc21180fb7224357ade1505f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
In that specific wrapping mode, it will first try a normal word wrap. If
it doesn't fit within the specified line width it will discard the
result of that and try WrapAnywhere by calling layout_helper()
recursively. The problem was that at the point it called itself again it
had already adjusted eng->maxWidth:
eng->maxWidth += line.textWidth;
This was not restored, but carried on to the recursive call to
layout_helper(), so the end result was that the maximumWidth would
accumulate text widths from parts of the same line twice.
Due to the same recursive behavior the minimumWidth also had a problem:
It always returned the width of the widest word because it took the
qMax() of the minimum widths of the two passes, (WordWrap and then
WrapAnywhere) effectively making the minimum width always be the width
of the widest word (even though it could wrap at finer granularity).
Pick-to: 5.15
Task-number: QTBUG-77337
Change-Id: Ie7e9c17b157506352c2da38cc7f4a8dfa1283966
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The proper solution is to use qint32 everywhere, but that is left as
a separate exercise.
Change-Id: Id0c06b102b56a1b3b48dd67c6c29c28da7d1f22d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
If there is a negative right bearing on the last character of the string,
it will stretch past the tab position (which aligns the advance position,
and not the right edge of the glyph). For certain fonts, this would cause
the actual ideal width to be calculated as 301 instead of 300 (which is
the right alignment edge set in the code).
Pick-to: 5.15
Fixes: QTBUG-46206
Change-Id: I03e8b8fb86e9ebe5337d3ba3384ade73d2ccdd69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Cleaning up those that are trivial to remove because they have direct
replacements.
Change-Id: I4f5c25884a01474fa2db8b369f0d883bd21edd5b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Those can be trivially removed as they have direct replacements, or
are completely unused.
The migration path for QCursor::bitmap and QCursor::mask is
QBitmap *pb = c.bitmap(); // up to 5.15, warns in 5.15
QBitmap vb = c.bitmap(Qt::ReturnByValue); // from 5.15, works in 6
QBitmap b = c.bitmap(); // from 6.0 on
Change-Id: I3b3acd1c7f09c4c8414e98b3ce11986f1ecd5eda
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Also extend autotesting, both for rendering into a given mip level
and for rendering into a given cubemap face.
Change-Id: Ida94b71150477ceb50a3b5616d8b7be13174558b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
When converting a text document to HTML, always convert it to utf-8,
as required by the HTML standard. This also means that we remove
the optional encoding parameter.
Change-Id: I0bd2fc9df2d06734e1c5b8053b964fbfbb6881e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The CommonMark spec shows that it's not necessary to have a space
between the code fence and the language string:
https://spec.commonmark.org/0.29/#example-112
This also avoids a needless trailing space after a code fence that
does not include a language string.
Change-Id: I2addd38a196045a7442150760b73269bfe4ffb22
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The end of a code block nested in a list item is now detected;
and if the text of the list item continues after the code block,
it continues to be indented.
Code blocks should never be word-wrapped.
Fixes: QTBUG-80603
Change-Id: I4427f8b1d4807d819616f5cb971e2d006170d9be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The QT_OPENGL_ES* macros are leftovers from an earlier,
ad hoc configuration system, which has since been
replaced by QT_CONFIG. To clean things up in Qt 6,
we use the new way instead.
Task-number: QTBUG-83467
Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The context—which lives in QtGui—now knows nothing about versioned functions.
This changes the public API for getting version functions for a context.
[ChangeLog][QtGui][OpenGL] QOpenGLContext::versionFunctions() has been removed.
QOpenGLVersionFunctionsFactory::get() from the QtOpenGL module should be used
instead.
Previously one would call
context->versionFunctions<QOpenGLFunctions_4_0_Core>();
Which now becomes
QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_0_Core>(context);
The rest of the API should be identical.
Since glgen no longer compiles, and the links to its input (gl.spec and gl.tm)
are dead, I've edited the previously generated files manually. If glgen is
fixed, it should be quite easy to make it generate the new way.
Task-number: QTBUG-74409
Change-Id: I800527e0af16a79005b276eeb74417770193c62f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This is required, so that QHash and QSet can hold more
than 2^32 items on 64 bit platforms.
The actual hashing functions for strings are still 32bit, this will
be changed in a follow-up commit.
Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Add a new QRangeCollection type to store and manage
multiple page ranges. This moves out the parser and validator
logic from the platform dependent (UNIX) dialog and makes it
publicly available from QPrinter.
This improves the usability of QPrinter in those applications
which doesn't use print dialog to configure printer.
(e.g.: QTextDocument, QWebEnginePage)
Change-Id: I0be5a8a64781c411f83b96a24f216605a84958e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Conflicts:
examples/opengl/doc/src/cube.qdoc
src/corelib/global/qlibraryinfo.cpp
src/corelib/text/qbytearray_p.h
src/corelib/text/qlocale_data_p.h
src/corelib/time/qhijricalendar_data_p.h
src/corelib/time/qjalalicalendar_data_p.h
src/corelib/time/qromancalendar_data_p.h
src/network/ssl/qsslcertificate.h
src/widgets/doc/src/graphicsview.qdoc
src/widgets/widgets/qcombobox.cpp
src/widgets/widgets/qcombobox.h
tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
tests/manual/diaglib/debugproxystyle.cpp
tests/manual/diaglib/qwidgetdump.cpp
tests/manual/diaglib/qwindowdump.cpp
tests/manual/diaglib/textdump.cpp
util/locale_database/cldr2qlocalexml.py
util/locale_database/qlocalexml.py
util/locale_database/qlocalexml2cpp.py
Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.
Updated CMakeLists.txt in each of
tests/auto/corelib/serialization/qcborstreamreader/
tests/auto/corelib/serialization/qcborvalue/
tests/auto/gui/kernel/
and generated new ones in each of
tests/auto/gui/kernel/qaddpostroutine/
tests/auto/gui/kernel/qhighdpiscaling/
tests/libfuzzer/corelib/text/qregularexpression/optimize/
tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
tests/libfuzzer/gui/text/qtextdocument/sethtml/
tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.
Changed target name in
tests/auto/gui/kernel/qaction/qaction.pro
tests/auto/gui/kernel/qaction/qactiongroup.pro
tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake
Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.
Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
- Moves QUndo* classes (except QUndoView) from src/widgets/utils to src/gui/utils
- Moves related auto tests from widgets to gui
- Replaces QUndoAction with lambdas that do text prefixing
[ChangeLog][Undo Framework] QUndo* classes (except QUndoView) were moved from Qt
Widgets to Qt GUI.
Done-with: volker.hilsheimer@qt.io
Fixes: QTBUG-40040
Change-Id: I3bd8d4d32c64f8dee548f62159a1df2126da89d8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QShortcut has only one widget specific feature, which is whatsThis; that
is just a QString, so the setters and getters can just as well be in
QtGui.
The widgets specific implementation of shortcut matching and of showing
the whatsThis balloon stays in QtWidgets, in the private implementation.
Using virtual functions in the private we can override the empty default
in QtGui, and by adding a virtual factory function in QGuiApplication,
the correct private is instantiated depending on the kind of application
running.
Change-Id: I09ae4a5482f9fb70940c5e2bfe76d3d7fd710afc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Duplicating the number of classes is a high price to pay to be able to
have some QAction functionality behave differently, or be only available
in widgets applications.
Instead, declare the entire API in QtGui in QAction* classes, and
delegate the implementation of QtWidgets specific functionality to
the private. The creation of the private is then delegated to the
Q(Gui)ApplicationPrivate instance through a virtual factory function.
Change some public APIs that are primarily useful for specialized tools
such as Designer to operate on QObject* rather than QWidget*. APIs that
depend on QtWidgets types have been turned into inline template
functions, so that they are instantiated only at the caller side, where
we can expect the respective types to be fully defined. This way, we
only need to forward declare a few classes in the header, and don't
need to generate any additional code for e.g. language bindings.
Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Currently depending if user uses QApplication
or QGuiApplication we end up in different behavior
when running post routines. For example QApplication
destructor calls post routines before stopping event dispatcher,
In case of QGuiApplication post routines are called
from QCoreApplication destructor, so no more event dispatcher.
This behavior is not consistent and creates troubles
when releasing resources of web engine.
Attached test will hang on windows with QGuiApplication,
however works fine with QApplication.
Task-number: QTBUG-79864
Change-Id: Ice05e66a467feaf3ad6addfbc14973649da8065e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
As QRegExp will be moved to a compat library in Qt 6.
Change-Id: I181aec45bd798f49d2c50a0e7fb64782e004b854
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
This exercises the multi-threaded codepath and also tests precision
a bit higher.
To avoid quadratic blowup, only a short set of formats are tested in
the larger conversion tests.
Task-number: QTBUG-82818
Change-Id: I411deb97aea61a69fbdb24cbaf6559dd9436b703
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The effect of the soft-hyphen needs to be updated once the final the
break point has been found.
This change cleans the logic by using two variables keeping track of
soft-hyphen at current evaluated position and at last confirmed break
point. Also adds tests for supression of soft-hyphens in the tight
WrapAnywhere case.
Fixes: QTBUG-35940
Fixes: QTBUG-44257
Change-Id: I7a89a8ef991b87691879bb7ce40cec4a3605fdd5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The area reserved for font properties was too small for
the properties we needed, and as a result font properties
were added outside of the area and special-cased (in the case
of FontLetterSpacingType) or ignored (in the case of
FontStretch) by conditions that check if the property is
within the designated area.
We reorganize the enum values now that we can, and allocate
some more space for the font properties area.
Fixes: QTBUG-65345
Change-Id: I8121ff7f72102d8022c6a6d2f8ed9c35dcdbb321
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Takes care of the first round of todos and deprecations for Qt6 in
qevent.
Not touching anything that might interfere with changing the class
hierarchy as the file also suggest.
Change-Id: If72d63d8932f1af588785bf77b34532358639a63
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Introduces a new QRhiShaderResourceBinding function that takes an array
of texture-sampler pairs. The existing function is also available and is
equivalent to calling the array-based version with array size 1.
It is important to note that for Metal one needs MSL 2.0 for array of
textures, so qsb needs --msl 20 instead of --msl 12 for such shaders.
Comes with an autotest, and also updates all .qsb files for said test
with the latest shadertools.
Task-number: QTBUG-82624
Change-Id: Ibc1973aae826836f16d842c41d6c8403fd7ff876
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
This reverts commit 5ebb03c476.
Reason for revert: Removing flagBits breaks the batchrenderer in declarative, which accesses them via QMatrix4x4_Accessor. If flagBits are still going to be removed, we need to first find a solution for the renderer.
Change-Id: Ib0a3fc7a327926f2245058c0e2ed30e8789aa75d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Quite a big change since it has been several years since
the last update. This drops the Harfbuzz source on top
of the existing code in Qt, and does the following
additional changes:
1. Deletes old source files that have been removed upstream
(everything named foo-private.hh is now renamed to just
foo.hh for instance).
2. Added a header guard to config.h because it may be
double-included.
3. Implement a memory barrier needed by hb-atomic.hh.
4. Changed the signature of hb_atomic_int_impl_add()
to take a pointer to match new upstream.
5. Updated .pro file to include new files and removed
old.
6. Updated qt_attribution.json
7. No longer disable deprecated APIs since
hb_ot_tags_from_script() is now deprecated and is used
from Qt code.
8. Updated and applied the patch in patches/ for CoreText.
9. Updated tst_qtextscriptengine::thaiWithZWJ() according to
changes in Harfbuzz and disabled it for system-harfbuzz,
since this may be an older version of harfbuzz depending on
the system.
Fixes: QTBUG-79606
Change-Id: I3f057a43ff44ee416628b75ef12fb1a221f31910
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The private object of QTextDocument has been exposed through
public APIs marked internal, which we should avoid as much as
possible, since it clutters the headers.
For accessing private data without adding friends, we have
a nice pattern of adding a static get() function to the
private class itself.
Fixes: QTBUG-55059
Change-Id: I03e949a677e03487e95f24e3608a06aa0a3511ab
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This is the first time that we add something to QShaderDescription
after migrating to the non-JSON based serialization system. This now
involves checking the "qsb version" when deserializing.
Task-number: QTBUG-82624
Change-Id: I2bd875ef21e461559b878dccc5537cdfa43feaa2
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
It was possible to end up with a dangling pointer in m_listStack.
This is now avoided by using QPointer and doing nullptr checks before
accessing any QTextList pointer stored there.
We have 2 specimens of garbage that caused crashes before; now they don't.
But only fuzz20450 triggered the dangling pointer in the list stack.
The crash caused by fuzz20580 was fixed by updating md4c from upstream:
4b0fc03077
Change-Id: I8e1eca23b281256a03aea0f55e9ae20f1bdd2a38
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred()
Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Freetype can give us non empty bounds for zero-width characters,
this change just makes us skip metrics of characters already found to
not contribute to text advance. The coretext and windows
font-engines already uses the already calculated advance.
Change-Id: I82b3521a4fb92614be509be5982cd5ab9c1eb7de
Fixes: QTBUG-58854
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Make the order checkable and checked are set in insignificant, by
storing ignored checked value for un-checkable actions.
Also gives checkable its own changed signal.
Change-Id: If03db7c92481a542b6220604860abddb322bb517
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Test was failing due to missing windows resource files which contain the
version information for the executable.
Change-Id: I19b0c747c6b833bac64f3667e9286350e7842b7c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Teste executables were not built in the right location.
Change-Id: Ice05d44d53f7d8c2e9ec5a7b5c011a24ceb02a09
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Modeled after QRhiTexture's NativeTexture query.
This becomes valuable in advanced cases of integrating external native
rendering code with Qt Quick(3D), because it allows using (typically
vertex and index) buffers created by Quick(3D) in the custom renderer as
well, without having to duplicate the content by manually creating native
buffers with the same vertex and index data.
Change-Id: I659193345fa1dfe6221b898043f0b75ba649d296
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Add a new queriable resource limit value MaxAsyncReadbackFrames. Change
the autotest to rely on this instead of relying on the unspecified,
works-by-accident relation between readbacks and FramesInFlight. This
way even if the behavior diverges in some backend in the future, clients
(well written ones, that is), will continue to function correctly.
Also clarify the docs for FramesInFlight, and change d3d and gl to return
the correct value (which is 1 from QRhi perspective; the expanded docs now
explain a bit what this really means and what it does not).
Change-Id: I0486715570a9e6fc5d3dc431694d1712875dfe01
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Goes through the Qt code and make sure bytes-per-line calculations are
safe when they are too big for 32bit integers.
Change-Id: I88b2d74b3da82e91407d316aa932a4a37587c0cf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Make the order of visible, group and enabled insignificant, by storing
ignored explicit values of enabled.
Also adds resetEnabled method QQuickAction has on the enabled property.
Change-Id: I9299dec0d1f74fdf655721bb4f72ba565ae85c7a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Widgets have a default palette and font that is influenced by several
factors: theme, style, QApplication-wide overrides, and the parent's.
If an application sets a font or palette on a parent, then widgets
inherit those settings, no matter when they are added to the parent.
The bug is that this is not true for widgets that have an application-
wide override defined by the platform theme. For those, we need to merge
parent palette and font attributes with the theme, and this is currently
not done correctly, as the respective masks are not merged and inherited.
This change fixes this for fonts and palettes. Children are inheriting
their parent's inheritance masks, combined with the mask for the
attributes set explicitly on the parent. This makes the font and palette
resolving code correctly adopt those attributes that are set explicily,
while leaving everything else as per the theme override.
The test verifies that this works for children and grand children added
to a widget that has a palette or font set, both when themed and
unthemed. Children with own entries don't inherit from parent.
The QFont::resetFont test had to be changed, as it was testing the
wrong behavior. If the child would be added to the parent before the
font property was set, then the test would have failed. Since this
change makes sure that children inherit fonts in the same way, no
matter on when they are added to their parent, the test is now
modified to cover both cases, and ensures that they return identical
results.
[ChangeLog][QtWidgets][QWidget] Fonts and palette settings are inherited
by children from their parents even if the children have application-
wide platform theme overrides.
Change-Id: I179a652b735e85bba3fafc30098d08d61684f488
Fixes: QTBUG-82125
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Currently QShaderGenerator will crash when encountering some expressions
in input nodes.
For example, this node prototype would make it crash:
"VERTEX_COLOR": {
"outputs": ["color", "alpha"],
"rules": [
"headerSnippets": ["in vec4 vertexColor;"],
"substitution": "vec3 $color = vertexColor.rgb;
float $alpha = vertexColor.a;"
]
}
Change-Id: I37abb8099d376843a4cb13228140467dc1b8f60c
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
It was already possible to declare a node prototype with multiple
outputs, but trying to assign to all those outputs was not possible and
instead resulted in a crash.
It is now possible to declare nodes like this without crashing:
"SEPERATE_XYZ": {
"inputs": ["vector"],
"outputs": ["x", "y", "z"],
"rules": [
{
"substitution": "float $x = $vector.x;
float $y = $vector.y;
float $z = $vector.z;"
}
]
}
Change-Id: I748e77e84c9120dc688c573eee33dc13c6bfbace
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
This fixes the shader generation for graphs like this one:
Function0 ------> Output0
(with unbound input)
Input ------> Function1 ------> Output1
With those graphs, createStatements will not return any statement for
nodes Function0 and Output0.
Change-Id: Iec32aa51623e176b03ae23e580f06d14df80a194
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Ensure that each image plugin really clips within the scaled coordinate
system, as documented. Always clipping from 0,0 wasn't interesting.
Task-number: QTBUG-81044
Change-Id: Ic06fe52f92f719e1ff9c0348f667215e53b60fb0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QShaderGenerator didn't handle substitutions like
`vec4 $color = mix($color1, $color2, $fac);`
Note that `$color` is a prefix to `$color1` and `$color2`. For the
substitution `QByteArray::replace` was used so if `$color` was handled
first and replaced by `v1`, `$color1` and `$color2` were never correctly
replaced and instead became `v11` and `v12` which caused a crash later
on.
Change-Id: Idaf800fdac468f33c323eb722701da5f8eb918d6
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
For graphs like this one:
Input ----> Function1 ----> Output
\
---> Function2
(unbound output)
We would have generated only 2 statements, for Function1 and Output.
This change fixes this by treating Function2 like an output.
Therefore it generates 4 statements: Input, Function1, Output and
Function2.
Change-Id: Iaada40b9b949d771806dd47efad4f7ef2a775b48
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Conflicts:
tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt
Hopefully final merge from wip/cmake, and then all cmake changes
should target dev directly.
Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
Conflicts:
examples/widgets/graphicsview/boxes/scene.h
src/corelib/Qt5CoreMacros.cmake
src/corelib/Qt6CoreMacros.cmake
src/network/ssl/qsslsocket.cpp
src/network/ssl/qsslsocket.h
src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
src/testlib/CMakeLists.txt
src/testlib/.prev_CMakeLists.txt
tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
Disabled building manual tests with CMake for now, because qmake
doesn't do it, and it confuses people.
Done-With: Alexandru Croitor <alexandru.croitor@qt.io>
Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
We added a work-around to disable the test when the Waree Book
font was not available, but this also excludes perfectly valid
versions of the font, so it is a bit unfortunate.
Change-Id: Ibeeff78d87acc384c1aa1b01e988edd524c60575
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I55cb9a6b3aebac68fb1b20127ba7aa501b4a3f2b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Remove temporarily the reference returned by QTransform::toAffine()
since we don't keep the QMatrix object internally anymore.
This is done in order to compile the rest of the code.
The follow-up patch is going to remove that method completely.
Task-number: QTBUG-81628
Change-Id: If7140eedb7582d81ac8da529017cf792174e86ab
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The "title" in markdown is the tooltip, not the name attribute of
a link. Also, tell the char format that it's an anchor.
Change-Id: I2978848ec6705fe16376d6fe17f31007cce4b801
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The change to using setters left a quirk from the previous un-mutable
design where you couldn't set values on an invalid color space and
create a valid one.
This changes that so it works as expected for an imperative API, but
is also needed for the declarative QML bindings.
Change-Id: I246cfc38b364b156238151c42c1df82a3f1cc9d3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
On the mac, the push button's bevel doesn't cover the entire widget
rectangle, but is smaller to leave space for focus frame, shadow, and
in general to meet style guidelines. Without this change, a click
anywhere inside the widget would activate the button.
QAbstractButton::hitButton can be reimplemented to limit the area in
which the button is triggered. However, getting the rectangle also
requires an addition to QStyle, so that we can query
QStyle::subElementRect for the actual area the button's bevel covers.
As a side effect, tests that use QPushButton and assume that it
responds to clicks at position 0,0 have to be fixed so that they
don't fail on mac.
Change-Id: I01b60a763bccf39090aee5b2369af300f922d226
Fixes: QTBUG-81452
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
They are now version 4, which is hopefully the final format,
relying on nothing but QDataStream.
Except for the qshader autotest which tests all the 1..4 versions
and so needs appropriate test data.
Also unifies the batch file naming.
Change-Id: Iec478be86d14dbec7ffb9d5f9b62c14fca5d7c9e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
We don't know which versions these blacklistings actually apply on
unless we actually get macOS 10.14 and 10.15 into the CI and running
tests, so let's start with that, and then granularize the blacklists
after that.
Task-number: QTBUG-75786
Change-Id: Id79642afa50cb20efa2cd209286b6933918d3a4a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Also moves the openglwindow test to the opengl folder, as it makes use of these
classes.
Task-number: QTBUG-74409
Change-Id: Id9f0013cedcc8bd1e87122c005641d7298525045
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Additional data should also be taken into account when using move
operator and function swap. This is already implemented for move
constructor.
Task-number: QTBUG-78544
Change-Id: I24ba34b0957a8fba7e15a934f2d08222dc95650f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The logic is now mostly handled in QGuiApplication, with QApplication
only dealing with the widget-specific palettes and interaction between
the style and the palette.
The application now picks up changes to the platform theme and will
re-resolve the current application palette appropriately. This also
works even if an explicit application palette has been set, in which
case any missing roles are filled in by the theme.
The palette can now also be reset back to the default application
palette that's fully based on the theme, by passing in the default
constructed palette (or any palette that doesn't have any roles set).
This is also correctly reflected in the Qt::AA_SetPalette attribute.
Conceptually this means QGuiApplication and QApplication follow the
same behavior as QWidget, where the palette falls back to a base or
inherited palette for roles that are not set, in this case the theme.
Behavior-wise this means that the default application palette of the
application does not have any roles set, but clients should not have
relied on this, nor does QWidget rely on that internally.
It also means that setting a palette on the application and then
getting it back again will not produce the same palette as set,
since the palette was resolved against the theme in the meantime.
This is the same behavior as for QWidget, and although it's a
behavior change it's one towards a more sane behavior, so we
accept it.
[ChangeLog] Application palettes are now resolved against the platform's
theme palette, the same way widget palettes are resolved against their
parents, and the application palette. This means the application palette
reflected through QGuiApplication::palette() may not be exactly the same
palette as set via QGuiApplication::setPalette().
Change-Id: I76b99fcd27285e564899548349aa2a5713e5965d
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
...but keep support for deserializing for all older versions in order to play
nice with existing .qsb files.
The usage of binary JSON and then CBOR is a historical artifact: relying
on the QJsonDocument (which we generate for purposes unrelated to binary
serialization) was a convenient shortcut. However, writing to and
reading from a QDataStream instead (which QShader already does) is trivial.
In order not to be limited by potential CBOR requirements in the future,
take it all into our own hands.
Extend the qshader autotest accordingly.
Task-number: QTBUG-81298
Change-Id: If0047b659bd6601ca47b5bbbce1b719630cde01e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
An empty QTextDocument already contains a block; so when the formatting
is fully determined, if the document is still empty, then instead of
inserting a new block, we can set formatting on the cursor, which
affects the pre-existing block, before inserting text. This avoids
leaving a blank line (the default block) above the inserted content.
Fixes: QTBUG-81060
Change-Id: I14e45e300a602493aa59680417d74d4c2b25862d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This amends a1f4321bbb as the font
families should take precedence over the font family set. If the font
family is already included in the families then it should keep its
placement. Otherwise it should be appended.
Task-number: QTBUG-80475
Change-Id: I0049189c88b6879e57619815ec780960e9c0a300
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Conflicts:
src/corelib/tools/qvector.h
Make QVector(DataPointer dd) public to be able to properly merge
5b4b437b30 from 5.15 into dev.
src/widgets/kernel/qapplication.cpp
tests/auto/tools/moc/allmocs_baseline_in.json
Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
The previous implementation did not take into account different color
groups in resolve mask. It led to some issues when resolving a
palette or checking whether a brush is set or not.
Task-number: QTBUG-78544
Change-Id: I9b67b2c444eb62c022643022a874dc400005e6ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
If the singular fontFamily() is given, then this is obviously the one to
be preferred over any plural fontFamilies(). Make sure it always ends up
first in the list of emitted font families.
Change-Id: I1e3b1ba29721c8298b1a0d4a1e1da49ba5b4e7ac
Fixes: QTBUG-80475
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Added new API setDocumentXmpMetadata/documentXmpMetadata and
addFileAttachment
[ChangeLog][QtGui][QPdfWriter] New API to provide external document XMP
metadata and attach files to PDF.
Fixes: QTBUG-78651
Fixes: QTBUG-78764
Change-Id: Ic0b37e8d12899f907001db469080594c14c87655
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
It wasn't tested and behaves in a very particular way.
Change-Id: I60a31681e5b221cf9a86df77e410a76ee4c10864
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This is not to be taken as supported and is still undefined behavior,
but I prefer we do not crash.
Change-Id: Icf4f3398bfd57fcbdc611a5a821a1f2de0838330
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The previous implementation was *extremely* expensive. It
relied on loading a binary JSON file from resources (which
involved decompressing it), then extracting information out of
it to build a gradient. Already-loaded gradients were kept in
a local cache, which had to be mutex protected.
Instead, this patch extends the gradient generator to build
static arrays filled with the web gradient data, sitting in
.rodata.
These arrays are used when building QGradient objects with a
web gradient. No explicit mutex protection is necessary, since
accesses will just read from the arrays.
As benefits, this patch removes:
* the binary json representation from QtGui's resources (~4KB
compressed, ~50KB uncompressed)
* the overhead of reading from the JSON for each used web
gradient;
* the startup costs of registering the webgradients in the
resources;
* all the overhead of mutex locking when building such
gradients;
* all the runtime memory allocations to load, parse and cache
the web gradients (including the memory + CPU spike on first
load due to the uncompression of the JSON data, as well as a
couple of deep copies).
Change-Id: If5c3d704430df76ce8faf55ee75ebd4639ba09c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When an existing item is replaced with a new one in
QStandardItemModel::setItem() then the persitent index is invalidated
which leads to some unexpected behaviors (like e.g the header size and
resize mode are reset).
Therefore we have to make sure that the invalidation does not happen.
This can be achieved by delaying the call to QStandardItem::setModel()
for the old item until the new is properly added. After this, the old
item no longer gets a valid QModelIndex from the model and therefore
can't invalidate the persistent index anymore.
Fixes: QTBUG-13605
Fixes: QTBUG-73000
Fixes: QTBUG-80586
Change-Id: I4e45e6feb81b7287c0859f638d7ab1a576fc2f0f
Reviewed-by: David Faure <david.faure@kdab.com>
When cloning a QTextDocument, the text fragment of the original document
is copied into the new one, which results into copying also the
formatting attributes. However, when the text document is empty, the
corresponding text fragment is also empty, so nothing is copied.
If we want to transfer the formatting attributes for an empty document,
we need to set them explicitly.
Fixes: QTBUG-80399
Change-Id: I382cd0821723436120af47c06ec7bfa849636307
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QDoubleValidator would accept "1,23" as valid in a locale which has ','
as a thousand separator. However, it should have been Intermediate
instead, as there is still one digit missing.
Fixes: QTBUG-75110
Change-Id: I6de90f0b6f1eae95dc8dfc8e5f9658e482e46db3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The new version takes/returns a value that can be unpacked and passed to
other functions without knowing which backend is in use.
The old API will be removed in a later change when dependent modules have
been updated
Task-number: QTBUG-78570
Change-Id: I18d928ceef3cb617c0c509ecccb345551a7990af
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The code was assuming that if the parsing of the value worked,
then it must be a list of 4 variants. But in this case it's just
a single length.
This came from <td> using 4 values for border-width
while other elements use a single value. But the storage
is shared. So the fix is to use 4 values everywhere.
When reading 4 and there's only one, it gets duplicated,
so the caller can just use the first one in that case.
Task-number: QTBUG-80496
Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The code was initially introduced in
9204b8c31e but getting the names were
conditioned on whether or not Windows identified it as a truetype font.
This excluded cases which had preferred names embedded but was not
truetype fonts. To fix that we run the code unconditionally.
[ChangeLog][Windows] Fixed a bug where some fonts would not be
accessible by referencing their typographic name.
Fixes: QTBUG-78556
Change-Id: I8823684b09cce3b1b8722b1e609a5bb49b13da13
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
For Metal and Vulkan this needs actual work because that's where
the concept of renderpass descriptors is relevant. GL and D3D can
just return true always.
The big benefit of this is that Qt Quick can now compare renderpass
descriptors via isCompatible() for its pipeline cache (similarly to
how it is already using isLayoutCompatible() for srbs), and so
renderpass descriptors for layers (Item.layer, ShaderEffect) will
typically be compatible and so can pick up pipelines created by other
layers from the cache.
Also add autotests for shader resource binding and renderpass descriptor
compatibility.
Task-number: QTBUG-80318
Change-Id: I0008bc51c4ee13b0113d2c8caf799e1257f18a18
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
While we are at it, remove the Border and MirrorOnce wrap modes that have
not been supported on OpenGL, because they are unsupported with Metal+iOS
as well.
Task-number: QTBUG-78580
Change-Id: I0db94b9d3a6125b3bb5d7b1db5d02a42cd94d2c2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reimplement QDomDocument using QXmlStreamReader and switch to the new
implementation starting from Qt 6.
The changes in the behavior are reflected in tests: some test cases
which were marked as "expected to fail" are now passing.
Task-number: QTBUG-76178
Change-Id: I5ace2f13c036a9a778de922b47a1ce35957ce5f6
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Calling QColor::setFoo() is currently inconsistent - some setter do
invalidate the colors, some don't. Unify it by calling invalidate in
every setter.
Task-number: QTBUG-62452
Change-Id: Ia4f0bd16ea30e9659bc989ffc2b319892438b84b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This was used to support QFlags f = 0 initialization, but with 0 used
as a pointer literal now considered bad form, it had been changed many
places to QFlags f = nullptr, which is meaningless and confusing.
Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It was converted over ARGB32PM, when it should have been directly
converted to not lose accuracy, instead there was an unnecessary direct
ARGB32->RGB30 conversion, which was converted to the necessary type.
This also improves the selection of conversion over ARGB32PM or RGBA64PM
for ARGB32 and RGBA8888 by using 32-bit conversion when alpha is not
relevant.
Change-Id: I5990d8a23b2909d3910d8c1213fa46477742b052
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
You can save a "skeletal" document with list items to fill in later,
the same as you can do in HTML or ODF format. Reading them back via
QTextDocument::fromMarkdown() isn't always perfect though.
Fixes: QTBUG-79217
Change-Id: Iacdb3e6792250ebdead05f314c9e3d00546eeb9f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The markdown parser generates empty lists in some cases when a character
that can be used as a bullet is found on a line by itself.
cbEnterBlock() and cbLeaveBlock() are called symmetrically in such cases.
QStack::pop() on an empty stack triggers an assert, so push and pop need
to be done symmetrically too. But it's difficult to actually create the
list as soon as the MD_BLOCK_UL or MD_BLOCK_OL callback occurs, without
breaking the case fixed in 7224d0e427 (and
probably other cases). That's because QTextCursor::insertList() creates
a list item at the same time as it creates the list itself, and also
inherits block formatting from the previous block. We now insert empty
lists with empty items whenever the need for that is detected though,
and there's a failsafe to prevent popping in case something still goes
wrong with that logic. We aren't strict about reproducing the original
markdown when regenerating it via toMarkdown(), but it's getting closer.
Fixes: QTBUG-78870
Change-Id: Ided194ce7aec2710c60dbac42761ee4169ed9b78
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
If a font with only a family set is resolved with one that has been setup
with setFamilies() then the family needs to be prepended to the families
list after resolving. This is so that the font still prefers the one set
as just a family with no famillies set.
This also amends the QFontDialog test to account for this too.
[ChangeLog][QtGui][Text] Resolving a font that just has a family set
with families set will prepend the family to the families so that it
is still the first preference for the font.
Task-number: QTBUG-46322
Change-Id: Icc4005732f95b2b4c684e592b06b31e133270e44
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
In qmake syntax there should be a colon or curly braces following a condition.
Change-Id: Ibd989662aef6320cec8093e7c6103bf8362b8255
Reviewed-by: Liang Qi <liang.qi@qt.io>
[ChangeLog][QtGui] Added QGuiShortcut and made the equivalent
existing classes in Qt Widgets derive from them. This provides
basic functionality for adding shortcut handling in QML.
Fixes: QTBUG-79638
Task-number: QTBUG-76493
Change-Id: I5bbd2c8f192660e93c4690b9f894643275090e4d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>