Search code examples
c++qtqwidgetqlabel

TitledBorder for QLabel?


I'm new here and german, so excuse me for my english^^

I'm now working on a C++ Project with Qt-library 4.7 for university and I want to add some QLabels to a QGridLayout. In Java it's possible to set a TitledBorder to a JLabel to get a title for a JLabel.

Is there a way to add some kind of TitledBorder to a QLabel?


Solution

  • Indeed there is. Use a QGroupBox.

    This is the appearance

    enter image description here enter image description hereenter image description here

    From https://qt-project.org/doc/qt-4.7/qgroupbox.html