add speed limit violations interface to the settings pane
This commit is contained in:
parent
d48a05212b
commit
72c6a89727
@ -25,6 +25,8 @@ SettingsPane::SettingsPane(QWidget *parent)
|
|||||||
this, &SettingsPane::toggledGuides);
|
this, &SettingsPane::toggledGuides);
|
||||||
connect(collisions, &QListWidget::itemClicked,
|
connect(collisions, &QListWidget::itemClicked,
|
||||||
[&](QListWidgetItem *item) { emit bookmarkClicked(((BookmarkItem *) item)->getFrame()); });
|
[&](QListWidgetItem *item) { emit bookmarkClicked(((BookmarkItem *) item)->getFrame()); });
|
||||||
|
connect(speeding_violations, &QListWidget::itemClicked,
|
||||||
|
[&](QListWidgetItem *item) { emit bookmarkClicked(((BookmarkItem *) item)->getFrame()); });
|
||||||
|
|
||||||
QTabWidget *tabs = new QTabWidget();
|
QTabWidget *tabs = new QTabWidget();
|
||||||
|
|
||||||
@ -50,9 +52,26 @@ void SettingsPane::addCollision(int idA, int idB, int frame) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsPane::addSpeedingViolation(int id, int frame, double speed) {
|
||||||
|
BookmarkItem *item = new BookmarkItem("Frame " + QString::number(frame) + ": #"
|
||||||
|
+ QString::number(id) + " (" + QString::number(speed) + ")",
|
||||||
|
frame);
|
||||||
|
item->setFlags(Qt::ItemIsEnabled | Qt::ItemNeverHasChildren);
|
||||||
|
speeding_violations->addItem(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SettingsPane::clearCollisions() {
|
void SettingsPane::clearCollisions() {
|
||||||
QListWidgetItem *item;
|
QListWidgetItem *item;
|
||||||
while ((item = collisions->takeItem(0)) != nullptr) {
|
while ((item = collisions->takeItem(0)) != nullptr) {
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SettingsPane::clearSpeedingViolations() {
|
||||||
|
QListWidgetItem *item;
|
||||||
|
while ((item = speeding_violations->takeItem(0)) != nullptr) {
|
||||||
|
delete item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -28,10 +28,13 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addCollision(int idA, int idB, int frame);
|
void addCollision(int idA, int idB, int frame);
|
||||||
|
void addSpeedingViolation(int id, int frame, double speed);
|
||||||
void clearCollisions();
|
void clearCollisions();
|
||||||
|
void clearSpeedingViolations();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sphereRadiusChanged(double sqRadius);
|
void sphereRadiusChanged(double sqRadius);
|
||||||
|
void speedLimitChanged(double limit);
|
||||||
void toggledTrajectories(int shown);
|
void toggledTrajectories(int shown);
|
||||||
void toggledGuides(int shown);
|
void toggledGuides(int shown);
|
||||||
void bookmarkClicked(int frame);
|
void bookmarkClicked(int frame);
|
||||||
|
Loading…
Reference in New Issue
Block a user