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. How to draw shape and make slide event?
QtWS25 Last Chance

How to draw shape and make slide event?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 3 Posters 311 Views
  • 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.
  • M Offline
    M Offline
    Munkhtamir
    wrote on last edited by Munkhtamir
    #1

    Hello guys. I am a bit confused about drawing the following shape using Rectangle?

    When I click green buttons, a following blue menu should appear.

    4fd4fb95-ab50-4631-b524-54dbcd4fd8d2-image.png

    Thank you,

    J.HilkJ 1 Reply Last reply
    0
    • MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by
      #2

      I have no idea about the sliding part, your question is vague to say the least, but here is how I would create the 'l-shape' rectangle.

      I have deliberately left the lower part of the shape another shade of blue so you can see how it is 'joined'.

      import QtQuick 2.1    
      import QtQuick.Window 2.12
         
      Window {
      
          visible: true
          width: 640
          height: 540
      
          Rectangle {    
              id: panel    
              x: 10; y: 10    
              width: 300    
              height: 500    
              color: "lightblue"    
          }    
          Rectangle {    
              id: panelPart    
              x: 10; y: 10    
              anchors.left: parent.left +5    
              anchors.bottom: panel.bottom    
              height: 100; width: 400    
              color: "darkblue"    
          }    
      }
      

      Capture.JPG

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      1 Reply Last reply
      1
      • M Munkhtamir

        Hello guys. I am a bit confused about drawing the following shape using Rectangle?

        When I click green buttons, a following blue menu should appear.

        4fd4fb95-ab50-4631-b524-54dbcd4fd8d2-image.png

        Thank you,

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @Munkhtamir
        I think, what you're looking for is a Drawer
        https://github.com/DeiVadder/Topic112113


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        1
        • M Offline
          M Offline
          Munkhtamir
          wrote on last edited by
          #4

          Thank you for help guys. I have solved my problem using Canvas. @J-Hilk was also good idea.

          9b2b9ba6-99b0-4eb1-9409-5540b6eec44b-image.png

          1 Reply Last reply
          1

          • Login

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