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. custom sliding menu or navigation drawer
Forum Updated to NodeBB v4.3 + New Features

custom sliding menu or navigation drawer

Scheduled Pinned Locked Moved Solved QML and Qt Quick
9 Posts 2 Posters 2.4k Views 2 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.
  • S Offline
    S Offline
    saeidparand
    wrote on last edited by
    #1

    Dear Friend ,
    I am newer in to Qt Qml , I want to make a custom drawer like this picture , But I don't have any Idea about making this kind of custom drawer
    0_1522939824378_images.jpg
    thanks for you help.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Look into the cinematic demo http://quitcoding.com/?page=work#cinex

      Basically you'll need to use a Path and lay out your menu items along that path.

      (Z(:^

      S 1 Reply Last reply
      1
      • sierdzioS sierdzio

        Look into the cinematic demo http://quitcoding.com/?page=work#cinex

        Basically you'll need to use a Path and lay out your menu items along that path.

        S Offline
        S Offline
        saeidparand
        wrote on last edited by
        #3

        @sierdzio
        Thanks for your help ,
        Don't you have any sample code ?

        sierdzioS 1 Reply Last reply
        0
        • S saeidparand

          @sierdzio
          Thanks for your help ,
          Don't you have any sample code ?

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @saeidparand said in custom sliding menu or navigation drawer:

          @sierdzio
          Thanks for your help ,
          Don't you have any sample code ?

          No, I don't. Check the example I've sent you in my last message.

          (Z(:^

          S 1 Reply Last reply
          0
          • sierdzioS sierdzio

            @saeidparand said in custom sliding menu or navigation drawer:

            @sierdzio
            Thanks for your help ,
            Don't you have any sample code ?

            No, I don't. Check the example I've sent you in my last message.

            S Offline
            S Offline
            saeidparand
            wrote on last edited by saeidparand
            #5

            we can use this kind of code for making Drawer and listview

            import QtQuick 2.7
            import QtQuick.Controls 2.2
            import Qt.labs.calendar 1.0
            ApplicationWindow {
            id:root
            visible: true
            width: 640
            height: 480
            // property alias mousearea: mousearea
            title: qsTr("Hello World")

            Drawer {
                id: drawer
                width: parent.width/3
                height: root.height
                edge: Qt.LeftArrow
                dragMargin: 20
                dim: false
                modal: false
                //opacity: 0.5
                PathView {
                    id:path
                    width: drawer.width//400
                    height:drawer.height//400
                    anchors.centerIn: parent
                    model: ListModel {
                        ListElement { name: "element1" }//; myimage:"images/1.png"}
                        ListElement { name: "element2" }
                        ListElement { name: "element3" }
                        ListElement { name: "element4" }
                        ListElement { name: "element5" }
                        ListElement { name: "element6" }
                        ListElement { name: "element7" }
                        ListElement { name: "element8" }
                    }
                    delegate: Rectangle {
                        id:delrect
                        width: 40
                        height: 40
                        radius: 20
                        color: "blue"
                        Text {
                            text: name
                            anchors.centerIn: parent
                            transform: [
                                Translate {y:-30}
                            ]
                        }
                                       
                    }
                    path: Path {
                        id:path2
                        startX: 200
                        startY: 0
                        //PathArc { x: 200; y: 400; radiusX: 200; radiusY: 200; useLargeArc: true }
                        PathArc { x: 200; y: 400; radiusX: 200; radiusY: 200; useLargeArc: true }
                        PathArc { x: 200; y: 0; radiusX: 200; radiusY: 200; useLargeArc: true }
                    }
                    
                }
            }
            

            }

            S 1 Reply Last reply
            1
            • S saeidparand

              we can use this kind of code for making Drawer and listview

              import QtQuick 2.7
              import QtQuick.Controls 2.2
              import Qt.labs.calendar 1.0
              ApplicationWindow {
              id:root
              visible: true
              width: 640
              height: 480
              // property alias mousearea: mousearea
              title: qsTr("Hello World")

              Drawer {
                  id: drawer
                  width: parent.width/3
                  height: root.height
                  edge: Qt.LeftArrow
                  dragMargin: 20
                  dim: false
                  modal: false
                  //opacity: 0.5
                  PathView {
                      id:path
                      width: drawer.width//400
                      height:drawer.height//400
                      anchors.centerIn: parent
                      model: ListModel {
                          ListElement { name: "element1" }//; myimage:"images/1.png"}
                          ListElement { name: "element2" }
                          ListElement { name: "element3" }
                          ListElement { name: "element4" }
                          ListElement { name: "element5" }
                          ListElement { name: "element6" }
                          ListElement { name: "element7" }
                          ListElement { name: "element8" }
                      }
                      delegate: Rectangle {
                          id:delrect
                          width: 40
                          height: 40
                          radius: 20
                          color: "blue"
                          Text {
                              text: name
                              anchors.centerIn: parent
                              transform: [
                                  Translate {y:-30}
                              ]
                          }
                                         
                      }
                      path: Path {
                          id:path2
                          startX: 200
                          startY: 0
                          //PathArc { x: 200; y: 400; radiusX: 200; radiusY: 200; useLargeArc: true }
                          PathArc { x: 200; y: 400; radiusX: 200; radiusY: 200; useLargeArc: true }
                          PathArc { x: 200; y: 0; radiusX: 200; radiusY: 200; useLargeArc: true }
                      }
                      
                  }
              }
              

              }

              S Offline
              S Offline
              saeidparand
              wrote on last edited by
              #6

              But , Unfortunately It is not responsive , how can I fix it?

              sierdzioS 1 Reply Last reply
              0
              • S saeidparand

                But , Unfortunately It is not responsive , how can I fix it?

                sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                @saeidparand said in custom sliding menu or navigation drawer:

                But , Unfortunately It is not responsive , how can I fix it?

                What kind of responsiveness do you expect? If the elements should be clickable, then you need to add a mouse area in the delegate, and handle the clicks there.

                (Z(:^

                S 1 Reply Last reply
                0
                • sierdzioS sierdzio

                  @saeidparand said in custom sliding menu or navigation drawer:

                  But , Unfortunately It is not responsive , how can I fix it?

                  What kind of responsiveness do you expect? If the elements should be clickable, then you need to add a mouse area in the delegate, and handle the clicks there.

                  S Offline
                  S Offline
                  saeidparand
                  wrote on last edited by
                  #8

                  @sierdzio
                  this listview is in the Drawer ,but when I resize the window this listview doesn't resize ,
                  how can I fix it?

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    Code seems OK. Maybe try using Layout or anchors.fill: parent instead of binding to height and width?

                    (Z(:^

                    1 Reply Last reply
                    2

                    • Login

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