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. Is there an option to control the display of QGroupBox border?
Forum Update on Monday, May 27th 2025

Is there an option to control the display of QGroupBox border?

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 875 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.
  • M Offline
    M Offline
    Mr Pang
    wrote on last edited by
    #1

    Screenshot_20200617_155133.png Screenshot_20200617_155109.png

    My ui file doesn't have custom setting of border. Both picture are fusion style, but the first one has no border.
    The first one is compiled using custom toolchain and static linking with Qt.
    The second one is a KDE desktop building.

    I want the border to make the boundaries clear. May it relate to static linking/ or qt version?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by
      #2

      AFAIK, the fusion style uses a qrc image as the background of QGroupBox to show the border.
      According to the doc, you'll need to force initialization the resource in the case of static linking.
      So try this in your main.cpp:

      QApplication app(argc, argv);
      Q_INIT_RESOURCE(qstyle);
      
      M 1 Reply Last reply
      0
      • B Bonnie

        AFAIK, the fusion style uses a qrc image as the background of QGroupBox to show the border.
        According to the doc, you'll need to force initialization the resource in the case of static linking.
        So try this in your main.cpp:

        QApplication app(argc, argv);
        Q_INIT_RESOURCE(qstyle);
        
        M Offline
        M Offline
        Mr Pang
        wrote on last edited by
        #3

        @Bonnie
        Tried it but without luck.

        B 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Mr-Pang said in Is there an option to control the display of QGroupBox border?:

          May it relate to static linking/ or qt version?

          It depends on the style you use. But you can set if you want to have drawn it flat or with a frame - see https://doc.qt.io/qt-5/qgroupbox.html

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • M Mr Pang

            @Bonnie
            Tried it but without luck.

            B Offline
            B Offline
            Bonnie
            wrote on last edited by
            #5

            @Mr-Pang
            It's theoretical 'cause I don't have a static qt to test.
            Do you build the static version by yourself or use some prebuilt ones?

            M 1 Reply Last reply
            0
            • B Bonnie

              @Mr-Pang
              It's theoretical 'cause I don't have a static qt to test.
              Do you build the static version by yourself or use some prebuilt ones?

              M Offline
              M Offline
              Mr Pang
              wrote on last edited by
              #6

              @Bonnie
              Here is the option

              Command line: -v -prefix /usr -hostprefix /root/br/amd64-glibc/host -headerdir /usr/include/qt5 -sysroot /root/br/amd64-glibc/host/x86_64-buildroot-linux-gnu/sysroot -plugindir /usr/lib/qt/plugins -examplesdir /usr/lib/qt/examples -no-rpath -nomake tests -device buildroot -device-option CROSS_COMPILE=/root/br/amd64-glibc/host/bin/x86_64-pqy-linux-gnu- -device-option 'BR_COMPILER_CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static' -device-option 'BR_COMPILER_CXXFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static -static' -optimized-qmake -no-cups -no-iconv -system-zlib -system-pcre -no-pch -shared -static -no-optimize-debug -no-avx -no-kms -no-gbm -release -opensource -confirm-license -no-sql-mysql -no-sql-psql -no-sql-sqlite -gui -system-freetype -no-harfbuzz -widgets -no-linuxfb -no-directfb -xcb -xkbcommon -no-opengl -qpa xcb -no-eglfs -openssl -fontconfig -no-gif -no-libjpeg -no-libpng -no-dbus -no-tslib -no-glib -no-icu -nomake examples -no-libinput -no-gtk -no-journald
              
              M 1 Reply Last reply
              0
              • M Mr Pang

                @Bonnie
                Here is the option

                Command line: -v -prefix /usr -hostprefix /root/br/amd64-glibc/host -headerdir /usr/include/qt5 -sysroot /root/br/amd64-glibc/host/x86_64-buildroot-linux-gnu/sysroot -plugindir /usr/lib/qt/plugins -examplesdir /usr/lib/qt/examples -no-rpath -nomake tests -device buildroot -device-option CROSS_COMPILE=/root/br/amd64-glibc/host/bin/x86_64-pqy-linux-gnu- -device-option 'BR_COMPILER_CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static' -device-option 'BR_COMPILER_CXXFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static -static' -optimized-qmake -no-cups -no-iconv -system-zlib -system-pcre -no-pch -shared -static -no-optimize-debug -no-avx -no-kms -no-gbm -release -opensource -confirm-license -no-sql-mysql -no-sql-psql -no-sql-sqlite -gui -system-freetype -no-harfbuzz -widgets -no-linuxfb -no-directfb -xcb -xkbcommon -no-opengl -qpa xcb -no-eglfs -openssl -fontconfig -no-gif -no-libjpeg -no-libpng -no-dbus -no-tslib -no-glib -no-icu -nomake examples -no-libinput -no-gtk -no-journald
                
                M Offline
                M Offline
                Mr Pang
                wrote on last edited by
                #7

                @Mr-Pang
                Command line: -v -prefix /usr -hostprefix /root/br/amd64-glibc/host -headerdir /usr/include/qt5 -sysroot /root/br/amd64-glibc/host/x86_64-buildroot-linux-gnu/sysroot -plugindir /usr/lib/qt/plugins -examplesdir /usr/lib/qt/examples -no-rpath -nomake tests -device buildroot -device-option CROSS_COMPILE=/root/br/amd64-glibc/host/bin/x86_64-pqy-linux-gnu- -device-option 'BR_COMPILER_CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static' -device-option 'BR_COMPILER_CXXFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -static -static' -optimized-qmake -no-cups -no-iconv -system-zlib -system-pcre -no-pch -shared -static -no-optimize-debug -no-avx -no-kms -no-gbm -release -opensource -confirm-license -no-sql-mysql -no-sql-psql -no-sql-sqlite -gui -system-freetype -no-harfbuzz -widgets -no-linuxfb -no-directfb -xcb -xkbcommon -no-opengl -qpa xcb -no-eglfs -openssl -fontconfig -no-gif -no-libjpeg -no-libpng -no-dbus -no-tslib -no-glib -no-icu -nomake examples -no-libinput -no-gtk -no-journald

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  Bonnie
                  wrote on last edited by
                  #8

                  @Mr-Pang
                  I've thought again, you don't use the resource directly, so you don't need to initialize it.
                  So the problem should be with your static qt.
                  Would the "-no-libpng" option be the problem because you actually need to show ":/qt-project.org/styles/commonstyle/images/fusion_groupbox.png"?

                  M 1 Reply Last reply
                  1
                  • B Bonnie

                    @Mr-Pang
                    I've thought again, you don't use the resource directly, so you don't need to initialize it.
                    So the problem should be with your static qt.
                    Would the "-no-libpng" option be the problem because you actually need to show ":/qt-project.org/styles/commonstyle/images/fusion_groupbox.png"?

                    M Offline
                    M Offline
                    Mr Pang
                    wrote on last edited by
                    #9

                    @Bonnie
                    You are right. Thanks!

                    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