X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=main.cpp;h=42d42cc0899300aefd254b5f3682e3856f308388;hb=98adfa69244097657696e8e183331ebfa1d47205;hp=d23c63e8c51d3e15be86ac36e78c433d2e1689c1;hpb=67da94217a271b0b76d42c75d1a78ee5ba942825;p=pkanalytics diff --git a/main.cpp b/main.cpp index d23c63e..42d42cc 100644 --- a/main.cpp +++ b/main.cpp @@ -47,6 +47,8 @@ MainWindow::MainWindow(EventsModel *events, PlayersModel *players, ui->setupUi(this); ui->event_view->setModel(events); + ui->event_view->setColumnWidth(1, 150); + ui->event_view->setColumnWidth(2, 150); connect(ui->event_view->selectionModel(), &QItemSelectionModel::currentRowChanged, [this, events](const QModelIndex ¤t, const QModelIndex &previous) { uint64_t t = events->get_time(current.row()); @@ -489,7 +491,10 @@ void MainWindow::formation_double_clicked(bool offense, unsigned row) return; } - // FIXME insert + id = formations->insert_new(new_formation_str.toStdString()); + QListView *view = offense ? ui->offensive_formation_view : ui->defensive_formation_view; + view->selectionModel()->select(formations->index(formations->get_row_from_id(id), 0), QItemSelectionModel::ClearAndSelect); + events->inserted_new_formation(id, new_formation_str.toStdString()); } else { events->set_formation_at(video->position(), offense, id); }