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

[solved] QTableView and QLineEdit



  • Hi,
    I'd like to put QLineEdit above QTableView and adhere to QTableView's columns. When I resize column or table every line edit should have the same width with coulumn below. How can i do this ?

    alt text



  • HI and welcome to devnet,

    you can connect a slot to the QHeaderView::sectionResized() signal to be notified when a column is resized

    connect(tableView->horizontalHeader(), &QHeaderView::sectionResized, 
                   this, &MyWIdget::slotColumnResized);