Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Binding QML window to the rectangle as a parent-child relationship



  • Hi,

    How to create a window in qml which is child of a rectangle. something like below.
    so when a rectangle is moved the window is also moved relative to it.

    Rectangle
    {
        color: "transparent"
        anchors.fill: parent
       
       Window
        {
                id: myWindow
               width: parent.width 
               height: parent.height
        
            Component.OncCompleted:
           {
                 myWIndow.show();
                 myWindow.setVisible    (true);
           }
      }
    }
    

  • Moderators

    @Amey Why do you want to put a Window inside an Item ? Window object creates a top level window and is meant to be a container for other objects including other Window.



  • I have to display the 3D in the window using custom render engine. This window is part of List view which is oriented horizontally. The list view has 3 pages and I can scroll the view.
    So when I scroll I am unable to scroll window as it is not child of item.
    Also is there a way to clip the window once its content goes out of view



  • @Amey said:

    Can you put the 3D model in a Rectangle?


  • Moderators

    @Amey As @Duino said try putting that 3D scene inside an Item.

    Also is there a way to clip the window once its content goes out of view

    clip property is only for Item derived components.


Log in to reply