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] Editing QGroupBox border
QtWS25 Last Chance

[SOLVED] Editing QGroupBox border

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 8.1k 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.
  • C Offline
    C Offline
    Clint Westwood
    wrote on last edited by Clint Westwood
    #1

    At the moment I'm using QFrame to enclose some of my widgets. I want to change it to QGroupBox. However, I don't see any border control options here like in QFrame (frameShape and frameShadow). How do I change border options for QGroupBox?

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

      Hi,

      You have to use Qt's style sheet for that. See here for an example.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Clint Westwood
        wrote on last edited by
        #3

        Yeah, I've just discovered style sheets, but I can't seem to get them to work. It shows in Qt Creator but once app is compiled no style sheet changes are applied.

        This is just a test:

        #MainWindow {
        background: yellow;
        }
        
        #centralWidget {
        border: 3px solid gray;
        border-radius: 40px;
        background: yellow;
        }
        

        In Qt creator in the top right corner I go to MainWindow, right click on it, use change stylesheet. A window pops up, I write code in it, hit "apply". Shows in Qt creator, doesn't show when I compile.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Do you mean that your widgets don't use the style sheet ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Clint Westwood
            wrote on last edited by
            #5

            Yes, I see my style sheet changes only in Qt creator design mode, but once application is compiled I do not see any changes.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Clint Westwood
              wrote on last edited by
              #6

              I've fixed it. I've included a separate .qss file instead of working with style sheets from design mode. Using designer in Qt creator to implement style sheets seems to be extremely buggy to the point that I had to restore my form file from previous build.

              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