Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize n,2n-width fonts as monospace #102

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Artoria2e5
Copy link

CJK monospace fonts come in widths of n and 2n, where n is the width of a Latin character. This fixes https://bugreports.qt.io/browse/QTBUG-67612.

CJK monospace fonts come in widths of n and 2n, where n is the width of a Latin character. This fixes https://bugreports.qt.io/browse/QTBUG-67612.
langlor-autodesk pushed a commit to autodesk-forks/qtbase that referenced this pull request Nov 11, 2024
* Add QWidgetPrivate::closestParentWidgetWithWindowHandle helper method

In contrast to nativeParentWidget(), we return the closest widget with a
QWindow, even if this window has not been created yet.

Pick-to: 6.7 6.6 6.5
Change-Id: Icac46297a6052a7a5698d752d4aa871bd5c2bdd8
Reviewed-by: Axel Spoerl <[email protected]>
(cherry picked from commit b571634)

* Reparent QWindow children when reparenting QWidget

When a QWidget was reparented, we would take care to reparent its
backing QWidgetWindow as well, into the nearest QWindow of the
new QWidget parent.

However we would only do this for the reparented widget itself,
and not any of its child widgets. In the case where the widget
has native children with their own QWindows, the widget itself
may not (yet) be native, e.g. if it hasn't been shown yet, or
if the user has set Qt::WA_DontCreateNativeAncestors.

In these scenarios, we would be left with dangling QWindows,
still hanging off their original QWindow parents, which
would eventually lead to crashes.

We now reparent both the QWindow of the reparented widget (as
long as it's not about to be destroyed), and any QQWindow
children we can reach. For each child hierarchy we can stop
once we reach a QWindow, as the QWindow children of that
window will follow along once we reparent the QWindow.

QWindowContainer widgets don't usually have their own
windowHandle(), but still manage a QWindow inside their
parent widget hierarchy. These will not be reparented
during QWidgetPrivate::setParent_sys(), but instead
do their own reparenting later in QWidget::setParent
via QWindowContainer::parentWasChanged(). The only
exception to this is when the top level is about to
be destroyed, in which case we let the window container
know during QWidgetPrivate::setParent_sys().

Finally, although there should not be any leftover
QWindows in the reparented widget once we have done
the QWidgetWindow and QWindowContainer reparenting,
we still do a pass over any remaining QWindows and
reparent those too, since the original code included
this as a possibility.

We could make further improvements in this areas, such
as moving the QWindowContainer::parentWasChanged() call,
but the goal was to keep this change as minimal as possible
so we can back-port it.

Fixes: QTBUG-122747
Pick-to: 6.5
Change-Id: I4d1217fce4c3c48cf5f7bfbe9d561ab408ceebb2
Reviewed-by: Volker Hilsheimer <[email protected]>
(cherry picked from commit c956eb8)
Reviewed-by: Tor Arne Vestbø <[email protected]>
(cherry picked from commit 8ee25c6)
(cherry picked from commit 2c0a4d6)

---------

Co-authored-by: Tor Arne Vestbø <[email protected]>
langlor-autodesk pushed a commit to autodesk-forks/qtbase that referenced this pull request Nov 11, 2024
…#102)" (qt#105)

#28746 was made to use an older artifact for Maya 2025.2 to save precious hours that would have been otherwise spent on waiting for the Qt build to complete. This PR aims to solve it properly by reverting the offending change specifically. This also allows us to resolve MAYA-132068

This reverts commit aaca5d7.
Copy link

cla-assistant bot commented Nov 15, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant