@@ -441,7 +441,7 @@ class WASimUIPrivate
441441
442442 if (FAILED (client->saveDataRequest (req)) && row < 0 )
443443 return ;
444- const QModelIndex idx = reqModel->addRequest (req);
444+ const QModelIndex idx = ui-> requestsView -> mapFromSource ( reqModel->addRequest (req) );
445445 ui->requestsView ->selectRow (idx.row ());
446446 ui->requestsView ->scrollTo (idx);
447447 }
@@ -493,7 +493,7 @@ class WASimUIPrivate
493493 }
494494
495495 void removeSelectedRequests () {
496- removeRequests (ui->requestsView ->selectionModel ()-> selectedRows (RequestsModel::COL_ID));
496+ removeRequests (ui->requestsView ->selectedRows (RequestsModel::COL_ID));
497497 }
498498
499499 void removeAllRequests () {
@@ -509,7 +509,7 @@ class WASimUIPrivate
509509 {
510510 if (!checkConnected ())
511511 return ;
512- const QModelIndexList list = ui->requestsView ->selectionModel ()-> selectedRows (RequestsModel::COL_ID);
512+ const QModelIndexList list = ui->requestsView ->selectedRows (RequestsModel::COL_ID);
513513 for (const QModelIndex &idx : list)
514514 client->updateDataRequest (reqModel->requestId (idx.row ()));
515515 }
@@ -660,7 +660,7 @@ class WASimUIPrivate
660660 }
661661
662662 void removeSelectedEvents () {
663- removeEvents (ui->eventsView ->selectionModel ()-> selectedRows (EventsModel::COL_ID));
663+ removeEvents (ui->eventsView ->selectedRows (EventsModel::COL_ID));
664664 }
665665
666666 void removeAllEvents () {
@@ -677,7 +677,7 @@ class WASimUIPrivate
677677 {
678678 if (!checkConnected ())
679679 return ;
680- const QModelIndexList list = ui->eventsView ->selectionModel ()-> selectedRows (EventsModel::COL_ID);
680+ const QModelIndexList list = ui->eventsView ->selectedRows (EventsModel::COL_ID);
681681 for (const QModelIndex &idx : list)
682682 client->transmitEvent (eventsModel->eventId (idx.row ()));
683683 }
@@ -975,7 +975,7 @@ WASimUI::WASimUI(QWidget *parent) :
975975 for (int i = RequestsModel::COL_FIRST_META; i <= RequestsModel::COL_LAST_META; ++i)
976976 hdr->hideSection (i);
977977 // connect double click action to populate the request editor form
978- connect (ui.requestsView , &QTableView::doubleClicked, this , [this ](const QModelIndex &idx) { d->populateRequestForm (idx); });
978+ connect (ui.requestsView , &QTableView::doubleClicked, this , [this ](const QModelIndex &idx) { d->populateRequestForm (ui. requestsView -> mapToSource ( idx) ); });
979979 // Connect to table view selection model to en/disable the remove/update actions when selection changes.
980980 connect (ui.requestsView ->selectionModel (), &QItemSelectionModel::selectionChanged, this , [=]() { d->toggleRequestButtonsState (); });
981981
@@ -986,7 +986,7 @@ WASimUI::WASimUI(QWidget *parent) :
986986 ui.eventsView ->horizontalHeader ()->resizeSection (EventsModel::COL_ID, 45 );
987987 ui.eventsView ->horizontalHeader ()->resizeSection (EventsModel::COL_CODE, 140 );
988988 // connect double click action to populate the event editor form
989- connect (ui.eventsView , &QTableView::doubleClicked, this , [this ](const QModelIndex &idx) { d->populateEventForm (idx); });
989+ connect (ui.eventsView , &QTableView::doubleClicked, this , [this ](const QModelIndex &idx) { d->populateEventForm (ui. eventsView -> mapToSource ( idx) ); });
990990 // Connect to table view selection model to en/disable the remove/update actions when selection changes.
991991 connect (ui.eventsView ->selectionModel (), &QItemSelectionModel::selectionChanged, this , [=]() { d->toggleEventButtonsState (); });
992992
0 commit comments