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

QML Popup and children are invisible to Spix name/id lookup #104

Open
davidljung opened this issue Mar 11, 2024 · 1 comment
Open

QML Popup and children are invisible to Spix name/id lookup #104

davidljung opened this issue Mar 11, 2024 · 1 comment

Comments

@davidljung
Copy link

davidljung commented Mar 11, 2024

Spix's item lookup fails to find and QML Item of Popup type or children of it (even when it is visible/open).
e.g.

Popup {
  id: mypopup
  Rectangle {
    id: myrect
  }
}

Spix isn't able to find mypopup or myrect.

We uses Popups for various kinds of dialog questions with buttons in our app and Spix isn't able to click on any of the dialog buttons or even find the Popup itself to determine visibility (when the popups are open), so we can't even add helper functions to click the buttons etc.

The Qt docs talk about some kind of dynamic re-parenting and there are properties contentItem, contentChildren and contentData (but no children as it inherits from QtObject not Item, which does have an objectName).

Any ideas where to look troubleshooting or seeing how to add support for that?

@auxxos
Copy link

auxxos commented Mar 12, 2024

We open our messages with a Loader. With Spix you can than open the popup with this loader.

Popup in Loader:

Loader {
    id: popupLoader
    active: false

    Popup {
      id: myPopup

      width: 200
      height: 200

      visible: popupLoader.active
      onClosed: popupLoader.active = false;

      Rectangle {
        id: myRect
        anchors.fill: parent

        color: "red"
      }
    }
}

Example how to open popup from a test case and change color of the rectangle:

 setStringProperty("mainWindow/popupLoader", "active", "true");
 wait(1500);
 setStringProperty("mainWindow/myRect", "color", "green");
 wait(1500);
 setStringProperty("mainWindow/popupLoader", "active", "false");

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

No branches or pull requests

2 participants