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. how to set borders (top/bot etc) with different width/color in C++?

how to set borders (top/bot etc) with different width/color in C++?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 782 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.
  • Q Offline
    Q Offline
    qtpi
    wrote on last edited by
    #1

    hi folks. I'm wondering if you can set the different borders with different width/color for a QWidget. I checked the setStyleSheet, it seems there's no such example...

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      This made top line red and rest green.
      QWidget {
      border: 2px solid green;
      border-top: 2px solid red;
      border-radius: 4px;
      padding: 2px;
      background-image: url(images/welcome.png);
      }

      Q 1 Reply Last reply
      1
      • mrjjM mrjj

        hi
        This made top line red and rest green.
        QWidget {
        border: 2px solid green;
        border-top: 2px solid red;
        border-radius: 4px;
        padding: 2px;
        background-image: url(images/welcome.png);
        }

        Q Offline
        Q Offline
        qtpi
        wrote on last edited by
        #3

        @mrjj said:

        border-top: 2px solid red;

        thx for the help! that worked.

        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