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. QFrame box style
QtWS25 Last Chance

QFrame box style

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 801 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.
  • JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #1

    I am under Linux, if it makes any difference to the outcome. When I create a QFrame with setFrameShape(QFrame::Box) I get a "hard, black" box frame. If I use a QGroupBox I get the box frame style/color/thickness/whatever that I would like, but don't want to use that as it has title-text space which I do not want.

    Does anyone know what I could do to a QFrame box to get similar look to that on a QGroupBox?

    1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #4

      While I wait for a better answer :), I am much happier with:

      QFrame qf;
      qf.setFrameShape(QFrame::Box);
      qf.setStyleSheet("QFrame { border: 1px solid lightgray; }");
      
      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bonnie
        wrote on last edited by Bonnie
        #2

        Refer to the doc of QFrame.
        It has a preview for all kinds of frame settings. Just choose what you like.
        https://doc.qt.io/qt-5/images/frames.png
        [EDITED]
        Oh, @JonB , didn't notice that you are the OP.
        I would guess you already know this.
        So the default settings can't meet your requirements?
        Then maybe you need to do that with stylesheet.

        JonBJ 1 Reply Last reply
        1
        • B Bonnie

          Refer to the doc of QFrame.
          It has a preview for all kinds of frame settings. Just choose what you like.
          https://doc.qt.io/qt-5/images/frames.png
          [EDITED]
          Oh, @JonB , didn't notice that you are the OP.
          I would guess you already know this.
          So the default settings can't meet your requirements?
          Then maybe you need to do that with stylesheet.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #3

          @Bonnie
          Yep, looked at those. And none of them looks like the frame on a QGroupBox! I'm wondering what is --- maybe it's just "grey" color on the box instead of black, making it look softer? I ought to try that... Just wondered if anyone knows what the QGroupBox frame style/color actually is?

          1 Reply Last reply
          0
          • JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #4

            While I wait for a better answer :), I am much happier with:

            QFrame qf;
            qf.setFrameShape(QFrame::Box);
            qf.setStyleSheet("QFrame { border: 1px solid lightgray; }");
            
            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