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. [Solved]QStyleSheet and QGroupBox
Qt 6.11 is out! See what's new in the release blog

[Solved]QStyleSheet and QGroupBox

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.3k 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
    stereomatching
    wrote on last edited by
    #1

    @ui_->renameGroup->setStyleSheet("border: 2px solid gray;border-radius: 5px;");@

    In the renameGroup, there are some QPushButton and QLabel, this solution will change the border
    of those QPushButton and QLabel too.I only want to change the border of the QGroupBox, what should
    I do?Thanks

    1 Reply Last reply
    0
    • L Offline
      L Offline
      liuyanghejerry
      wrote on last edited by
      #2

      You need a selector outset the rules, or it will considered as global selector: "*". Consider the way like this:
      @
      QGroupBox { // see, a selector
      border: 2px solid gray;
      border-radius: 5px;
      }
      @

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #3

        Thanks, it work and easy to use.

        1 Reply Last reply
        0

        • Login

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