Hi All,
I wonder if anyone can help, I have a QTableView where I'm displaying list of records, to display further details of any record I'm opening a new window by clicking on the record, all well apart from that I can open the SAME record more than once, How can I prevent this happening ?

this is what I have so far
Qt Code:
  1. while(qry.next())
  2. {
  3. model->setQuery(qry);
  4. }
  5. connect(ui->tableView_visitLog, SIGNAL(pressed(const QModelIndex&)), this,
  6. SLOT(on_tableView_visitorLog_clicked(const QModelIndex&)));
  7.  
  8.  
  9. void ControlPanel::on_tableView_visitorLog_clicked(const QModelIndex& index)
  10. {
  11. const QAbstractItemModel* tableModel = ui->tableView_visitLog->model();
  12. int visitor_id = tableModel->data(tableModel->index(index.row(),0), Qt::DisplayRole).toInt();
  13. visitordetails = new VisitorDetails(visitor_id, this);
  14. visitordetails->show();
  15. }
To copy to clipboard, switch view to plain text mode