Commit 3336e1311a07a89b1462c418c4659b951b06e9ce
1 parent
f1ef0460
added clear command to GUI
Showing
5 changed files
with
23 additions
and
1 deletions
CHANGELOG.md
| 1 | 0.4.0 - ??/??/?? | 1 | 0.4.0 - ??/??/?? |
| 2 | ================ | 2 | ================ |
| 3 | +* Added simple GUI frontend | ||
| 3 | * Added -evalLandmarking and -plotLandmarking for evaluating and plotting landmarking accuracy (#9) | 4 | * Added -evalLandmarking and -plotLandmarking for evaluating and plotting landmarking accuracy (#9) |
| 4 | * Added -evalDetection and -plotDetection for evaluating and plotting object detection accuracy (#9) | 5 | * Added -evalDetection and -plotDetection for evaluating and plotting object detection accuracy (#9) |
| 5 | * Deprecated Transform::backProject | 6 | * Deprecated Transform::backProject |
app/OpenBR/OpenBR.cpp
| @@ -44,6 +44,11 @@ public: | @@ -44,6 +44,11 @@ public: | ||
| 44 | gridLayout->setRowStretch(2, 0); | 44 | gridLayout->setRowStretch(2, 0); |
| 45 | 45 | ||
| 46 | QMenuBar *menuBar = new QMenuBar(); | 46 | QMenuBar *menuBar = new QMenuBar(); |
| 47 | + QMenu *file = new QMenu("File"); | ||
| 48 | + QAction *clear = new QAction("Clear", this); | ||
| 49 | + clear->setShortcut(QKeySequence("Ctrl+C")); | ||
| 50 | + connect(clear, SIGNAL(triggered()), tail, SLOT(clear())); | ||
| 51 | + file->addAction(clear); | ||
| 47 | Algorithm *algorithm = new Algorithm(); | 52 | Algorithm *algorithm = new Algorithm(); |
| 48 | algorithm->addAlgorithm("FaceRecognition", "Face Recognition"); | 53 | algorithm->addAlgorithm("FaceRecognition", "Face Recognition"); |
| 49 | algorithm->addAlgorithm("PP5", "PittPatt"); | 54 | algorithm->addAlgorithm("PP5", "PittPatt"); |
| @@ -54,6 +59,7 @@ public: | @@ -54,6 +59,7 @@ public: | ||
| 54 | helpMenu->addAction(contactAction); | 59 | helpMenu->addAction(contactAction); |
| 55 | connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); | 60 | connect(aboutAction, SIGNAL(triggered()), this, SLOT(about())); |
| 56 | connect(contactAction, SIGNAL(triggered()), this, SLOT(contact())); | 61 | connect(contactAction, SIGNAL(triggered()), this, SLOT(contact())); |
| 62 | + menuBar->addMenu(file); | ||
| 57 | menuBar->addMenu(algorithm); | 63 | menuBar->addMenu(algorithm); |
| 58 | menuBar->addMenu(helpMenu); | 64 | menuBar->addMenu(helpMenu); |
| 59 | 65 |
openbr/gui/progress.cpp
| 1 | #include <openbr/openbr.h> | 1 | #include <openbr/openbr.h> |
| 2 | -#include <QDebug> | 2 | + |
| 3 | #include "progress.h" | 3 | #include "progress.h" |
| 4 | 4 | ||
| 5 | /**** PROGRESS ****/ | 5 | /**** PROGRESS ****/ |
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | br::Progress::Progress(QWidget *parent) | 7 | br::Progress::Progress(QWidget *parent) |
| 8 | : QStatusBar(parent) | 8 | : QStatusBar(parent) |
| 9 | { | 9 | { |
| 10 | + setContentsMargins(0, 0, 0, 0); | ||
| 10 | pbProgress.setVisible(false); | 11 | pbProgress.setVisible(false); |
| 11 | pbProgress.setMaximum(100); | 12 | pbProgress.setMaximum(100); |
| 12 | pbProgress.setMinimum(0); | 13 | pbProgress.setMinimum(0); |
openbr/gui/tail.cpp
| @@ -10,6 +10,7 @@ Tail::Tail(QWidget *parent) | @@ -10,6 +10,7 @@ Tail::Tail(QWidget *parent) | ||
| 10 | : QWidget(parent) | 10 | : QWidget(parent) |
| 11 | { | 11 | { |
| 12 | layout = new QHBoxLayout(this); | 12 | layout = new QHBoxLayout(this); |
| 13 | + layout->setContentsMargins(0, 0, 0, 0); | ||
| 13 | slider = new QSlider(this); | 14 | slider = new QSlider(this); |
| 14 | slider->setOrientation(Qt::Horizontal); | 15 | slider->setOrientation(Qt::Horizontal); |
| 15 | lhs = new QLabel(this); | 16 | lhs = new QLabel(this); |
| @@ -24,6 +25,18 @@ Tail::Tail(QWidget *parent) | @@ -24,6 +25,18 @@ Tail::Tail(QWidget *parent) | ||
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | /*** PUBLIC SLOTS ***/ | 27 | /*** PUBLIC SLOTS ***/ |
| 28 | +void Tail::clear() | ||
| 29 | +{ | ||
| 30 | + targetGallery = File(); | ||
| 31 | + queryGallery = File(); | ||
| 32 | + targetFiles.clear(); | ||
| 33 | + queryFiles.clear(); | ||
| 34 | + scores.clear(); | ||
| 35 | + slider->setMaximum(0); | ||
| 36 | + setIndex(0); | ||
| 37 | + setVisible(false); | ||
| 38 | +} | ||
| 39 | + | ||
| 27 | void Tail::setIndex(int index) | 40 | void Tail::setIndex(int index) |
| 28 | { | 41 | { |
| 29 | index = std::min(std::max(slider->minimum(), index), slider->maximum()); | 42 | index = std::min(std::max(slider->minimum(), index), slider->maximum()); |
openbr/gui/tail.h
| @@ -28,6 +28,7 @@ public: | @@ -28,6 +28,7 @@ public: | ||
| 28 | explicit Tail(QWidget *parent = 0); | 28 | explicit Tail(QWidget *parent = 0); |
| 29 | 29 | ||
| 30 | public slots: | 30 | public slots: |
| 31 | + void clear(); | ||
| 31 | void setIndex(int index); | 32 | void setIndex(int index); |
| 32 | void setTargetGallery(const File &gallery); | 33 | void setTargetGallery(const File &gallery); |
| 33 | void setQueryGallery(const File &gallery); | 34 | void setQueryGallery(const File &gallery); |