GroupBox example



  • 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



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



  • 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.



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



  • 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()


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.