diff options
author | ccolin | 2021-01-02 01:51:52 +0100 |
---|---|---|
committer | ccolin | 2021-01-02 01:51:52 +0100 |
commit | a23067c1811576654bc8482748c8b1e3c6247dc2 (patch) | |
tree | 6ce0c0860a7711d49c6ef1cee00733ca24a5b1e3 /src/settings_pane.cc | |
parent | bb0da810d945d98b25390c65ab3f34e695914fd6 (diff) |
add clicking to a collision to seek to it
Diffstat (limited to 'src/settings_pane.cc')
-rw-r--r-- | src/settings_pane.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/settings_pane.cc b/src/settings_pane.cc index f37c14c..4e52d55 100644 --- a/src/settings_pane.cc +++ b/src/settings_pane.cc @@ -18,6 +18,8 @@ SettingsPane::SettingsPane(QWidget *parent) this, &SettingsPane::toggledTrajectories); connect(show_support_lines, &QCheckBox::stateChanged, this, &SettingsPane::toggledSupportLines); + connect(collisions, &QListWidget::itemClicked, + [&](QListWidgetItem *item) { emit collisionClicked(((CollisionItem *) item)->getFrame()); }); QFormLayout *layout = new QFormLayout; layout->addRow("Taille de la sphère de collision", sphere_radius); @@ -29,8 +31,9 @@ SettingsPane::SettingsPane(QWidget *parent) void SettingsPane::addCollision(int idA, int idB, int frame) { - QListWidgetItem *item = new QListWidgetItem(QString::number(frame) + ": " - + QString::number(idA) + " / " + QString::number(idB)); + CollisionItem *item = new CollisionItem(QString::number(frame) + ": " + + QString::number(idA) + " / " + QString::number(idB), + frame); item->setFlags(Qt::ItemIsEnabled | Qt::ItemNeverHasChildren); collisions->addItem(item); } |