Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



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



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


  • @Bonnie
    Tried it but without luck.


  • Qt Champions 2019

    @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



  • @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?



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


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



  • @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"?



  • @Bonnie
    You are right. Thanks!


Log in to reply