Nominate our 2022 Qt Champions!

I need to display a table after double clicking on qtablewidget dates column. How can I proceed with this?

  • I need a table which will pop up after I click on any of the date present in qtablewidget rows.

  • Moderators

    Simply connect to the appropriate signals of your table widget:

    • QTableView::doubleClicked(QModelIndex)
    • QTableWIdget::cellDoubleClicked(int row, int column)
    • QTableWidget::itemDoubleClicked(QTableWidgetItem*)

    And open up a new QTableWidget in the slot:

    QTableWidget* t = new QTableWidget( parent );
    t->setWindowFlags( Qt::Window );
    t->setAttribute( Qt::WA_DeleteOnClose );
    // initialize table widget

Log in to reply