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. Extend Page container
Qt 6.11 is out! See what's new in the release blog

Extend Page container

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 272 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.
  • P Offline
    P Offline
    poucz
    wrote on last edited by
    #1

    Hello,
    I'm using Page container for design my application.
    Now I would like to extend Page by adding menu-section.

    screen.png

    I would like to behavior MyPage.qml was same like Page.
    Usage:

    MyPage{
    header:Text{
            text:"Hello"
        }
    
    menu:Text{
            text:"This is menu- here will be Column of button for example"
        }
    
    }
    

    How Can I do It right way?

    Now I do it like this: (but I suppose not good way)

    //MyPage.qml
    Page {
        property alias menuRect: menuRect
        property alias contentRect: contentRect
        Rectangle{
            id: menuRect
            anchors.top: parent.top
            anchors.bottom: parent.bottom
            anchors.right: parent.right
            width: 100
        }
        Rectangle{
            id: contentRect
            anchors.top: parent.top
            anchors.bottom: parent.bottom
            anchors.left: parent.left
            anchors.right: menuRect.left
        }
    }
    
    //use it: FirstPage.qml
    MyPage {
      Text{
            anchors.fill:menuRect
            text:"Hello"
        }
    
      Text{
            anchors.fill:contentRect
            text:"Hello"
         }
    }
    
    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