Commit cbb2f7ae authored by pixhawk's avatar pixhawk

[landauf] added button to clear the pattern and letter lists

parent 5cd0d543
......@@ -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<QAction*>(sender());
......
......@@ -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();
......
......@@ -13,25 +13,37 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="10,10" columnminimumwidth="0,0">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QListWidget" name="listWidget"/>
</item>
<item row="1" column="0" colspan="2">
<item row="1" column="0" colspan="3">
<widget class="QListWidget" name="letterListWidget"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="imageLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
<horstretch>10</horstretch>
<verstretch>10</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
<width>110</width>
<height>110</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>2</width>
<height>2</height>
</size>
</property>
<property name="baseSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="text">
......@@ -39,7 +51,7 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="2" column="1" colspan="2">
<widget class="QLabel" name="letterLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
......@@ -47,6 +59,12 @@
<verstretch>10</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>110</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>2</width>
......@@ -78,6 +96,19 @@ color: white;</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="clearButton">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment