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. rounded corners on one side of the rectangle
Forum Updated to NodeBB v4.3 + New Features

rounded corners on one side of the rectangle

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 19.7k 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.
  • L Offline
    L Offline
    literA2
    wrote on last edited by
    #1

    Hi,

    Can you please provide tips on how to create a rectangle with rounded corner on one side only in QML.

    Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by mcosta
      #2

      HI,

      you can use two rectangles

      Rectangle {
        id: roundRect
        radius: 5
        color: Qt.black
      }
      
      Rectangle {
        id: squareRect
      
        color: Qt.black
        height: rondRect.radius
        anchors.bottom = roundRect.bottom
        anchors.left = roundRect.left
        anchors.right = roundRect.right
      
      }
      

      This is an example and you can create a custom component where you can specify

      • color
      • radius
      • side of the square corners

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      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