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

QGroupBox size



  • Hi at all,
    I use a QTableWidget inside a QGroupBox.
    The problem is that the QGroupBox doesn't resize to contains the QTableWidget and then I see this last cutted.
    My idea (but if you have a better idea I haven't a problem to ear you) is to set size of QGroupBox when the QMainWindow drawing finished.
    The problem is that I know that when QMainWindow finish the drawing emit a signal, but I don't remember which signal and I didn't even find it in the documentation.
    Can you help me?
    Thanks.


  • Lifetime Qt Champion

    Hi,

    Did you put a layout on your QGroupBox ?



  • Hi SGaist,
    Yes, I added QVBoxLayout because on top of QGroupBox I've some widgets and below a QTableWidget.
    But now I tried:

    tw->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    

    and seems to solve my problem very good.


Log in to reply