Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/labels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ LabelInfo::LabelInfo(QString name, QString categorie, int id, int id_categorie,
shortcut = nullptr;
}

LabelInfo::~LabelInfo() {

delete item;
delete shortcut;
}

void LabelInfo::read(const QJsonObject &json) {
id = json["id"].toInt();
name = json["name"].toString();
Expand Down
2 changes: 2 additions & 0 deletions src/labels.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class LabelInfo {
LabelInfo(QString name, QString categorie, int id, int id_categorie, QColor color);
void read(const QJsonObject &json);
void write(QJsonObject &json) const;

~LabelInfo();
};

class Name2Labels : public QMap<QString, LabelInfo> {
Expand Down
5 changes: 5 additions & 0 deletions src/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
undo_action->setEnabled(false);
redo_action->setEnabled(false);

watershed_shortcut = new QShortcut(QKeySequence("Ctrl+F"), this);
connect(watershed_shortcut, SIGNAL(activated()), this, SLOT(runWatershed()));
button_watershed->setText(button_watershed->text() +
QString("(%1)").arg(watershed_shortcut->key().toString()));

menuFile->addAction(save_action);
menuEdit->addAction(close_tab_action);
menuEdit->addAction(undo_action);
Expand Down
2 changes: 2 additions & 0 deletions src/main_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class MainWindow : public QMainWindow, public Ui::MainWindow {
QAction * swap_action;
QAction * redo_action ;
QString curr_open_dir;
QShortcut * watershed_shortcut;

public:
QString currentDir() const;
QString currentFile() const;
Expand Down