aboutsummaryrefslogtreecommitdiff
path: root/src/settings_pane.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings_pane.cc')
-rw-r--r--src/settings_pane.cc7
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);
}