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

Remove Horizontal header of table



  • I have a function setHorizontalHeader,which adds a header to the table by adding header items one by one using setHorizontalHeaderItem.If I want to delete a header which function should I use?
    Looks that takeHorizontalHeaderItem() suits, but it removes the item without deleting it.
    After caling takeHorizontalHeaderItem for all items I get the header with numbers inside it.
    I need to entirely delete the header (data + cells) - How do I implement it correctly?


  • Lifetime Qt Champion

    Hi,

    Do you need to delete it or have it not visible ?



  • view->horizontalHeader()->hide();


Log in to reply