qtdeclarative/tests
Mitch Curtis ce77d45d89 Fix attached property propagation when accessed on QQuickPopupItem
As mentioned in the comments of QTBUG-68434, popups always inherit
their attributes from the parent window (unless they are explicitly
bound like in ComboBox). However, ComboBox was made an exception,
because the popup is an integral part of the control.

This means that although the following snippet shouldn't change the
background color of a Popup, it should do so for ComboBox's popup:

    Rectangle {
        Material.theme: Material.Dark

        ComboBox {
            model: 5
        }
    }

However, this didn't work.
Before 3ec6d04d97, material/ComboBox.qml
had the following binding in the popup's background Rectangle:

    color: control.popup.Material.dialogColor

That patch changed it in order to get deferred execution working:

    color: parent.Material.dialogColor

This causes the color to come from the window rather than the popup.
This would have almost been caught in test_comboBox, had we checked the
actual color when setting the theme.

To fix the bug without reverting to the previous QML and breaking
deferred execution, we modify findAttachedParent to return the popup's
attached object if the item passed to it is a QQuickPopupItem.

Doing this causes test_inheritance_popup to fail, so we fix that by
passing the attached object target (which can be a popup) to
findAttachedParent, rather than the item whose parent or window changed
(which is coincidentally what was already being done in initialize()).

The patch also adds categorised logging to help debug such issues in
the future. Conveniently, this will also help users who want to debug
their own QQuickAttachedPropertyPropagator subclasses, without them
needing to modify Qt itself.

Fixes: QTBUG-115322
Change-Id: Idc0495023a058bcb033c4002fb6ad233bae9feae
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c6b401a31a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-31 15:51:59 +00:00
..
auto Fix attached property propagation when accessed on QQuickPopupItem 2023-07-31 15:51:59 +00:00
baseline Adapt to Qt::Appearance to Qt::ColorScheme rename 2023-02-13 17:03:47 +00:00
benchmarks Make the colorresolving benchmark also a benchmark for cmake 2023-04-28 05:44:24 +00:00
global
libfuzzer/qml
manual Move imagine/musicplayer to tests/manual/imagine/musicplayer 2023-07-12 00:25:52 +02:00
system
testapplications
CMakeLists.txt
README

README

This directory contains autotests and benchmarks based on QTestlib. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.

Linux X11:

   * The user must be logged in to an active desktop; you can't run the
     autotests without a valid DISPLAY that allows X11 connections.

   * The tests are run against a KDE3 or KDE4 desktop.

   * Window manager uses "click to focus", and not "focus follows mouse". Many
     tests move the mouse cursor around and expect this to not affect focus
     and activation.

   * Disable "click to activate", i.e., when a window is opened, the window
     manager should automatically activate it (give it input focus) and not
     wait for the user to click the window.