Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What's the equivalent c++ code for border-radius in qss?
Forum Updated to NodeBB v4.3 + New Features

What's the equivalent c++ code for border-radius in qss?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 202 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.
  • S Offline
    S Offline
    Sauntor
    wrote on last edited by Sauntor
    #1

    You can set the border radius for a QWidget with stylesheet:

    border-radius: 6px;
    

    but if you want implement it only using c++ ( no setStylesheet() ), it find out to be too complicated(, on my opinion)!
    so, is there a simple to achieve it?
    or on the other hand, can we achieve it by using QProxyStyle without reimplementing many draw*() functions?

    Pl45m4P 1 Reply Last reply
    0
    • S Sauntor

      You can set the border radius for a QWidget with stylesheet:

      border-radius: 6px;
      

      but if you want implement it only using c++ ( no setStylesheet() ), it find out to be too complicated(, on my opinion)!
      so, is there a simple to achieve it?
      or on the other hand, can we achieve it by using QProxyStyle without reimplementing many draw*() functions?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Sauntor

      Use the paint() event of your QWidget and draw your custom shape, like drawRoundedRect()


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      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