From cbb2f7ae540902378c4b6f147d78b03dba279202 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Sat, 3 Jul 2010 21:45:10 +0200 Subject: [PATCH] [landauf] added button to clear the pattern and letter lists --- src/ui/ObjectDetectionView.cc | 9 +++++++ src/ui/ObjectDetectionView.h | 1 + src/ui/ObjectDetectionView.ui | 47 +++++++++++++++++++++++++++++------ 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/ui/ObjectDetectionView.cc b/src/ui/ObjectDetectionView.cc index 884c7b70f..4439591d4 100644 --- a/src/ui/ObjectDetectionView.cc +++ b/src/ui/ObjectDetectionView.cc @@ -56,6 +56,7 @@ ObjectDetectionView::ObjectDetectionView(QString folder, QWidget *parent) : connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setUAS(UASInterface*))); letterTimer.start(1000); connect(&letterTimer, SIGNAL(timeout()), this, SLOT(decreaseLetterTime())); + connect(m_ui->clearButton, SIGNAL(clicked()), this, SLOT(clearLists())); } ObjectDetectionView::~ObjectDetectionView() @@ -183,6 +184,14 @@ void ObjectDetectionView::updateLetterList() m_ui->letterListWidget->addItem(pattern.name + separator + "(" + QString::number(pattern.count) + ")" + separator + QString::number(pattern.confidence)); } +void ObjectDetectionView::clearLists() +{ + patternList.clear(); + letterList.clear(); + m_ui->listWidget->clear(); + m_ui->letterListWidget->clear(); +} + void ObjectDetectionView::takeAction() { QAction* act = dynamic_cast(sender()); diff --git a/src/ui/ObjectDetectionView.h b/src/ui/ObjectDetectionView.h index 574c8fb26..57f442996 100644 --- a/src/ui/ObjectDetectionView.h +++ b/src/ui/ObjectDetectionView.h @@ -76,6 +76,7 @@ public slots: void newLetter(int uasId, QString letter, float confidence, bool detected); void decreaseLetterTime(); void updateLetterList(); + void clearLists(); /** @brief Accept an internal action, update name and preview image label */ void takeAction(); diff --git a/src/ui/ObjectDetectionView.ui b/src/ui/ObjectDetectionView.ui index 5630b1ee6..e35e48dc3 100644 --- a/src/ui/ObjectDetectionView.ui +++ b/src/ui/ObjectDetectionView.ui @@ -13,25 +13,37 @@ Form - - + + - + - 1 - 1 + 10 + 10 - 64 - 64 + 110 + 110 + + + + + 2 + 2 + + + + + 10 + 10 @@ -39,7 +51,7 @@ - + @@ -47,6 +59,12 @@ 10 + + + 110 + 110 + + 2 @@ -78,6 +96,19 @@ color: white; + + + + + 80 + 16777215 + + + + Clear + + + -- 2.22.0