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. GroupBox example
Forum Updated to NodeBB v4.3 + New Features

GroupBox example

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.7k Views 2 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.
  • A Offline
    A Offline
    AM577
    wrote on last edited by
    #1

    In the GroupBox example, the group boxes in the illustration have borders drawn round them. But when I compile and run the code on Qt 5.2.1 (Mint Linux 17.1) the borders are absent. I played around with groupbox->setFlat(false) and so on but that had no effect.
    What am I missing ?
    AM577

    1 Reply Last reply
    0
    • C Offline
      C Offline
      charlycoste
      wrote on last edited by
      #2

      I guess it's because it's not part of the Mint's look&feel... Is it?

      "It's not because things are difficult that we dare not venture. It's because we dare not venture that they are difficult." - Lucius Annaeus Seneca

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

        To be sure, just try to launch your application this way:

        ./your_binary -style motif
        

        or

        ./your_binary -style fusion
        

        You will probably get a border around your group boxes. This is because Qt will adapt to your environment.
        If your desktop environment doesn't draw borders around group boxes, you won't have one by default. If it does, you would see it.

        "It's not because things are difficult that we dare not venture. It's because we dare not venture that they are difficult." - Lucius Annaeus Seneca

        A 1 Reply Last reply
        0
        • C charlycoste

          To be sure, just try to launch your application this way:

          ./your_binary -style motif
          

          or

          ./your_binary -style fusion
          

          You will probably get a border around your group boxes. This is because Qt will adapt to your environment.
          If your desktop environment doesn't draw borders around group boxes, you won't have one by default. If it does, you would see it.

          A Offline
          A Offline
          AM577
          wrote on last edited by
          #4

          Thanks, that works OK.
          Can I set this style permanently within the code ?

          1 Reply Last reply
          1
          • C Offline
            C Offline
            charlycoste
            wrote on last edited by
            #5

            This is not a good practice so I should not tell you, but if you really want to do this you can use QApplication::setStyle()

            "It's not because things are difficult that we dare not venture. It's because we dare not venture that they are difficult." - Lucius Annaeus Seneca

            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