QGroupBox label overlaps other components on Windows



  • alt text

    When I build for Linux (Ubuntu). It works ok, labels do not overlap other elements, but if I build for Windows the labels overlap other elements.
    How to fix it?
    I use Qt 5.8 (Ubuntu 14.04)



  • @Kofr

    Can you show some code how you place the widgets?

    Do you use different styles/fonts for windows and linux?



  • font of this groupBoxes is set in Qt Designer.
    The stylesheet applied to MainWindow is

    ".QWidget{"                                             \
                        "background: rgb( 220,      220,      250 ); "          \
                        "padding: 1px;"                                         \
                        "border-width: 3px;"                                    \
                        "border-style: inset;"                                  \
                        "border-left-color: rgb( 210,      210,      250 );"    \
                        "border-top-color: rgb( 210,      210,      250 );"     \
                        "border-right-color: rgb( 180,      180,      250 );"   \
                        "border-bottom-color: rgb( 180,      180,      250 )}"  \
                    "QWidget#centralWidget{"                                    \
                        "background: rgb(220,220,250);}"                        \
                    "QStatusBar{"                                               \
                        "background: rgb(220,220,250);}"                        \
                    "QTabWidget::pane{"                                         \
                        "background: rgb( 230,      230,      250 ); "          \
                        "border-width: 1px;"                                    \
                        "border-style: outset;"                                 \
                        "border-left-color: rgb( 180,      180,      250 );"    \
                        "border-top-color: rgb( 180,      180,      250 );"     \
                        "border-right-color: rgb( 210,      210,      250 );"   \
                        "border-bottom-color: rgb( 210,      210,      250 )}"  \
                    "QTabWidget::tab-bar {"                                     \
                        "left: 5px;}"                                           \
                    "QTabBar::tab{"                                             \
                        "background: rgb( 200,      200,      240 ); "          \
                        "border-color: rgb( 180,      180,      240 ); "        \
                        "border-top-left-radius: 7px;"                          \
                        "border-top-right-radius: 7px;"                         \
                        "border-style: solid;"                                  \
                        "border-width: 1px;"                                    \
                        "min-width: 100px;"                                     \
                        "margin-right: 1px;"                                    \
                        "min-height:20;}"                                       \
                    "QTabBar::tab:hover{"                                       \
                        "border-color: rgb( 140,      140,      240 ); "        \
                        "background: rgb( 190,      190,      240 );}"          \
                    "QTabBar::tab:selected{"                                    \
                        "background: rgb( 180,      180,      240 );"           \
                        "min-height:25;}"                                       \
                    "QFrame#frameButtonsFileInner{"                             \
                        "background: rgb( 220,220,250/*200,200,240*/); "        \
                        "border-width: 3px;"                                    \
                        "border-style: inset;"                                  \
                        "border-left-color: rgb( 180,      180,      250 );"    \
                        "border-top-color: rgb( 180,      180,      250 );"     \
                        "border-right-color: rgb( 210,      210,      250 );"   \
                        "border-bottom-color: rgb( 210,      210,      250 )}"  \
                    "QFrame#frameButtonsAuxInner{"                              \
                        "background: rgb( 220,220,250/*200,200,240*/); "        \
                        "border-width: 3px;"                                    \
                        "border-style: inset;"                                  \
                        "border-left-color: rgb( 180,      180,      250 );"    \
                        "border-top-color: rgb( 180,      180,      250 );"     \
                        "border-right-color: rgb( 210,      210,      250 );"   \
                        "border-bottom-color: rgb( 210,      210,      250 )}"  \
                    "QFrame#frameButtonsOuter{"                                 \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: outset;"                                 \
                        "border-left-color: rgb( 210,      210,      250 );"    \
                        "border-top-color: rgb( 210,      210,      250 );"     \
                        "border-right-color: rgb( 180,      180,      250 );"   \
                        "border-bottom-color: rgb( 180,      180,      250 )}"  \
                    "QFrame#frameAvatarOuter{"                                  \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: outset;"                                 \
                        "border-left-color: rgb( 210,      210,      250 );"    \
                        "border-top-color: rgb( 210,      210,      250 );"     \
                        "border-right-color: rgb( 180,      180,      250 );"   \
                        "border-bottom-color: rgb( 180,      180,      250 )}"  \
                    "QFrame#frameDebugSettings{"                                  \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: inset;"                                 \
                        "border-left-color: rgb( 180,      180,      250 );"    \
                        "border-top-color: rgb( 180,      180,      250 );"     \
                        "border-right-color: rgb( 210,      210,      250 );"   \
                        "border-bottom-color: rgb( 210,      210,      250 )}"  \
                    "QFrame#frameVideoOuter{"                                   \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: outset;"                                 \
                        "border-left-color: rgb( 210,      210,      250 );"    \
                        "border-top-color: rgb( 210,      210,      250 );"     \
                        "border-right-color: rgb( 180,      180,      250 );"   \
                        "border-bottom-color: rgb( 180,      180,      250 )}"  \
                    "QFrame#frameVideoInner{"                                   \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: inset;"                                  \
                        "border-left-color: rgb( 180,      180,      250 );"    \
                        "border-top-color: rgb( 180,      180,      250 );"     \
                        "border-right-color: rgb( 210,      210,      250 );"   \
                        "border-bottom-color: rgb( 210,      210,      250 )}"  \
                    "QFrame#frameSmilesOuter{"                                  \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: outset;"                                 \
                        "border-left-color: rgb( 210,      210,      250 );"    \
                        "border-top-color: rgb( 210,      210,      250 );"     \
                        "border-right-color: rgb( 180,      180,      250 );"   \
                        "border-bottom-color: rgb( 180,      180,      250 )}"  \
                    "QFrame#widgetServerSettings{"                              \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: outset;"                                 \
                        "border-left-color: rgb( 210,      210,      250 );"    \
                        "border-top-color: rgb( 210,      210,      250 );"     \
                        "border-right-color: rgb( 180,      180,      250 );"   \
                        "border-bottom-color: rgb( 180,      180,      250 )}"  \
                    "QFrame#frameEmotionsInner{"                                \
                        "background: rgb( 220,220,250/*200,200,240*/); "        \
                        "padding: 1px;"                                         \
                        "border-width: 3px;"                                    \
                        "border-style: inset;"                                  \
                        "border-left-color: rgb( 180,      180,      250 );"    \
                        "border-top-color: rgb( 180,      180,      250 );"     \
                        "border-right-color: rgb( 210,      210,      250 );"   \
                        "border-bottom-color: rgb( 210,      210,      250 )}"  \
                    "QFrame#frameGraphsOuter{"                                  \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: outset;"                                 \
                        "border-left-color: rgb( 210,      210,      250 );"    \
                        "border-top-color: rgb( 210,      210,      250 );"     \
                        "border-right-color: rgb( 180,      180,      250 );"   \
                        "border-bottom-color: rgb( 180,      180,      250 )}"  \
                    "QFrame#frameGraphsInner{"                                  \
                        "background: rgb( 220,      220,      250 ); "          \
                        "border-width: 3px;"                                    \
                        "border-style: inset;"                                  \
                        "border-left-color: rgb( 180,      180,      250 );"    \
                        "border-top-color: rgb( 180,      180,      250 );"     \
                        "border-right-color: rgb( 210,      210,      250 );"   \
                        "border-bottom-color: rgb( 210,      210,      250 )}"  \
                    "QLabel#labelLieSpontActive{"                               \
                        "background: #FF0000;"                                  \
                        "border-top-left-radius: 80px 80px;"                    \
                        "border-top-right-radius: 80px 80px;"                   \
                        "border-bottom-left-radius: 80px 80px;"                 \
                        "border-bottom-right-radius: 80px 80px;}"               \
                    "QLabel#labelLieSpontActiveBackground{"                     \
                        "border-color: #FF0000;"                                \
                        "border-style: solid;"                                  \
                        "border-width: 3px;"                                    \
                        "border-top-left-radius: 80px 80px;"                    \
                        "border-top-right-radius: 80px 80px;"                   \
                        "border-bottom-left-radius: 80px 80px;"                 \
                        "border-bottom-right-radius: 80px 80px;}"               \
                    "QLabel#labelLieSpontDodge{"                                \
                        "background: #00FF00;"                                  \
                        "border-top-left-radius: 80px 80px;"                    \
                        "border-top-right-radius: 80px 80px;"                   \
                        "border-bottom-left-radius: 80px 80px;"                 \
                        "border-bottom-right-radius: 80px 80px;}"               \
                    "QLabel#labelLieSpontDodgeBackground{"                     \
                        "border-color: #00BB00;"                                \
                        "border-style: solid;"                                  \
                        "border-width: 3px;"                                    \
                        "border-top-left-radius: 80px 80px;"                    \
                        "border-top-right-radius: 80px 80px;"                   \
                        "border-bottom-left-radius: 80px 80px;"                 \
                        "border-bottom-right-radius: 80px 80px;}"               \
                    "QLabel#labelLiePrepActive{"                                \
                        "background: #669900;"                                  \
                        "border-top-left-radius: 60px 55px;"                    \
                        "border-top-right-radius: 60px 55px;"                   \
                        "border-bottom-left-radius: 60px 55px;"                 \
                        "border-bottom-right-radius: 60px 55px;}"               \
                    "QLabel#labelLiePrepDodge{"                                 \
                        "background: #996600;"                                  \
                        "border-top-left-radius: 60px 55px;"                    \
                        "border-top-right-radius: 60px 55px;"                   \
                        "border-bottom-left-radius: 60px 55px;"                 \
                        "border-bottom-right-radius: 60px 55px;}"               \
                    "QPushButton#buttonExamplePES_1:enabled{"                   \
                        "background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," \
                        "stop: 0 #DDDDFF, stop: 0.5 #DDDDFF,"                   \
                        "stop: 0.51 #9999FF, stop: 1.0 #9999FF);}"              \
                    "QLineEdit#lineEdit_9{"                                     \
                        "background: #FFFFFF;}"                                 \
                    "QLineEdit{"                                                \
                        "background: #E0E0FF;}"                                 \
                    "QRadioButton::indicator:unchecked{"                        \
                        "image: url(:/Images/radiobutton_off_25x25.png);"           \
                        "}"                                                     \
                    "QRadioButton::indicator:checked{"                          \
                        "image: url(:/Images/radiobutton_on_25x25.png);"            \
                    "}"                                                     \
                    "QRadioButton#radioButtonServerSettings1::indicator:unchecked{" \
                        "image: url(:/Images/radiobutton_off_11x11.png);"           \
                    "}"                                                     \
                    "QRadioButton#radioButtonServerSettings1::indicator:checked{"   \
                        "image: url(:/Images/radiobutton_on_11x11.png);"            \
                    "}"                                                     \
                    "QRadioButton#radioButtonServerSettings2::indicator:unchecked{" \
                        "image: url(:/Images/radiobutton_off_11x11.png);"           \
                    "}"                                                     \
                    "QRadioButton#radioButtonServerSettings2::indicator:checked{"   \
                        "image: url(:/Images/radiobutton_on_11x11.png);"            \
                    "}"  
    
    

    This stylesheet came to me from other developer, however there was no problem with 5.7 so fat I know (I can be wrong). And it is weird that when it is build with g++ for Linux it is all ok.


  • Qt Champions 2016

    @Kofr
    Sanity check. :)
    If you remove stylesheet its then ok ?


Log in to reply
 

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