MCPcopy Create free account
hub / github.com/abreheret/PixelAnnotationTool / MainWindow

Method MainWindow

src/main_window.cpp:23–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include "about_dialog.h"
22
23MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
24 : QMainWindow(parent, flags)
25{
26 setupUi(this);
27 setWindowTitle(QApplication::translate("MainWindow", "PixelAnnotationTool " PIXEL_ANNOTATION_TOOL_GIT_TAG, Q_NULLPTR));
28 list_label->setSpacing(1);
29 image_canvas = NULL;
30 _isLoadingNewLabels = false;
31 save_action = new QAction(tr("&Save current image"), this);
32 copy_mask_action = new QAction(tr("&Copy Mask"), this);
33 paste_mask_action = new QAction(tr("&Paste Mask"), this);
34 clear_mask_action = new QAction(tr("&Clear Mask mask"), this);
35 close_tab_action = new QAction(tr("&Close current tab"), this);
36 swap_action = new QAction(tr("&Swap check box Watershed"), this);
37 undo_action = new QAction(tr("&Undo"), this);
38 redo_action = new QAction(tr("&Redo"), this);
39 next_file_action = new QAction(tr("&Select next file"), this);
40 previous_file_action = new QAction(tr("&Select previous file"), this);
41 undo_action->setShortcuts(QKeySequence::Undo);
42 redo_action->setShortcuts(QKeySequence::Redo);
43 save_action->setShortcut(Qt::CTRL + Qt::Key_S);
44 swap_action->setShortcut(Qt::CTRL + Qt::Key_Space);
45 copy_mask_action->setShortcut(Qt::CTRL + Qt::Key_C);
46 paste_mask_action->setShortcut(Qt::CTRL + Qt::Key_V);
47 clear_mask_action->setShortcut(Qt::CTRL + Qt::Key_R);
48 close_tab_action->setShortcut(Qt::CTRL + Qt::Key_W);
49 next_file_action->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Down);
50 previous_file_action->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Up);
51 undo_action->setEnabled(false);
52 redo_action->setEnabled(false);
53
54 menuFile->addAction(save_action);
55 menuEdit->addAction(close_tab_action);
56 menuEdit->addAction(undo_action);
57 menuEdit->addAction(redo_action);
58 menuEdit->addAction(copy_mask_action);
59 menuEdit->addAction(paste_mask_action);
60 menuEdit->addAction(clear_mask_action);
61 menuEdit->addAction(swap_action);
62 menuEdit->addAction(next_file_action);
63 menuEdit->addAction(previous_file_action);
64
65 tabWidget->clear();
66
67 connect(button_watershed , SIGNAL(released()) , this, SLOT(runWatershed() ));
68 connect(swap_action , SIGNAL(triggered()) , this, SLOT(swapView() ));
69 connect(actionOpen_config_file, SIGNAL(triggered()) , this, SLOT(loadConfigFile()));
70 connect(actionSave_config_file, SIGNAL(triggered()) , this, SLOT(saveConfigFile()));
71 connect(close_tab_action , SIGNAL(triggered()) , this, SLOT(closeCurrentTab()));
72 connect(copy_mask_action , SIGNAL(triggered()) , this, SLOT(copyMask()));
73 connect(paste_mask_action , SIGNAL(triggered()) , this, SLOT(pasteMask()));
74 connect(clear_mask_action , SIGNAL(triggered()) , this, SLOT(clearMask()));
75 connect(next_file_action , SIGNAL(triggered()) , this, SLOT(nextFile()));
76 connect(previous_file_action , SIGNAL(triggered()) , this, SLOT(previousFile()));
77 connect(tabWidget , SIGNAL(tabCloseRequested(int)) , this, SLOT(closeTab(int) ));
78 connect(tabWidget , SIGNAL(currentChanged(int)) , this, SLOT(updateConnect(int)));
79 connect(tree_widget_img , SIGNAL(itemClicked(QTreeWidgetItem *,int)), this, SLOT(treeWidgetClicked()));
80

Callers

nothing calls this directly

Calls 1

defaultLabelsFunction · 0.85

Tested by

no test coverage detected