How to group two widgets so that they look like one widget?
Unsolved
General and Desktop
-
I need to display rich text on a checkbox. I tried grouping a QCheckBox and QLabel in a QHBoxLayout. The problem is that it doesn't look like one widget.
struct CheckBox : QWidget{ QHBoxLayout layout{this}; QCheckBox checkbox; QLabel label; CheckBox(){ layout.addWidget(&checkbox); layout.addWidget(&label); // layout.addStretch(); } };
If no stretch is added and the group has a large width, there will be a large space between the checkbox and label.
If a stretch is added after the label, other widgets cannot be added close next to the group.How to group the two widgets so that they look like one widget?