Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Binding QML window to the rectangle as a parent-child relationship
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amey
    wrote on last edited by p3c0
    #1

    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);
           }
      }
    }
    
    p3c0P 1 Reply Last reply
    0
    • A Amey

      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);
             }
        }
      }
      
      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @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.

      157

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Amey
        wrote on last edited by
        #3

        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

        p3c0P 1 Reply Last reply
        0
        • DuinoD Offline
          DuinoD Offline
          Duino
          wrote on last edited by
          #4

          @Amey said:

          Can you put the 3D model in a Rectangle?

          Just enjoy coding.

          1 Reply Last reply
          0
          • A Amey

            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

            p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #5

            @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.

            157

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved