|
@@ -271,7 +271,6 @@ ImageLabeler::ImageLabeler(QWidget *aParent) :
|
|
|
button_tagging_tool_ = new QPushButton(frame_toolbox_);
|
|
|
button_tagging_tool_->setText(tr("tagging"));
|
|
|
button_tagging_tool_->setEnabled(false);
|
|
|
- button_tagging_tool_->setCheckable(true);
|
|
|
button_clear_selection_tool_ = new QPushButton(frame_toolbox_);
|
|
|
button_clear_selection_tool_->setText(tr("clear selection"));
|
|
|
button_clear_selection_tool_->setEnabled(false);
|
|
@@ -285,7 +284,6 @@ ImageLabeler::ImageLabeler(QWidget *aParent) :
|
|
|
group_tools_ = new QButtonGroup;
|
|
|
group_tools_->addButton(button_bound_box_tool_);
|
|
|
group_tools_->addButton(button_polygon_tool_);
|
|
|
- group_tools_->addButton(button_tagging_tool_);
|
|
|
|
|
|
button_confirm_selection_ = new QPushButton(central_widget_);
|
|
|
button_confirm_selection_->setText(tr("Confirm selection"));
|
|
@@ -331,6 +329,7 @@ ImageLabeler::ImageLabeler(QWidget *aParent) :
|
|
|
layout_toolbox_->addWidget(label_toolbox_);
|
|
|
layout_toolbox_->addWidget(button_bound_box_tool_);
|
|
|
layout_toolbox_->addWidget(button_polygon_tool_);
|
|
|
+ layout_toolbox_->addSpacing(10);
|
|
|
layout_toolbox_->addWidget(button_tagging_tool_);
|
|
|
layout_toolbox_->addSpacing(10);
|
|
|
layout_toolbox_->addWidget(button_clear_selection_tool_);
|
|
@@ -510,6 +509,12 @@ ImageLabeler::ImageLabeler(QWidget *aParent) :
|
|
|
this,
|
|
|
SLOT(setPolygonTool(bool))
|
|
|
);
|
|
|
+ connect(
|
|
|
+ button_tagging_tool_,
|
|
|
+ SIGNAL(clicked()),
|
|
|
+ &line_edit_form_,
|
|
|
+ SLOT(setTags())
|
|
|
+ );
|
|
|
connect(
|
|
|
button_clear_selection_tool_,
|
|
|
SIGNAL(clicked()),
|
|
@@ -624,12 +629,12 @@ ImageLabeler::ImageLabeler(QWidget *aParent) :
|
|
|
this,
|
|
|
SLOT(onSelectionStarted())
|
|
|
);
|
|
|
-// connect(
|
|
|
-// &image_description_form_,
|
|
|
-// SIGNAL(descriptionSet(QString)),
|
|
|
-// this,
|
|
|
-// SLOT(setDescription(QString))
|
|
|
-// );
|
|
|
+ connect(
|
|
|
+ &line_edit_form_,
|
|
|
+ SIGNAL(dataSet(QString)),
|
|
|
+ this,
|
|
|
+ SLOT(setDataFromForm(QString))
|
|
|
+ );
|
|
|
connect(
|
|
|
image_holder_,
|
|
|
SIGNAL(imageScaled()),
|
|
@@ -2187,6 +2192,7 @@ ImageLabeler::loadImage()
|
|
|
newImage->labeled_ = 1;
|
|
|
newImage->pas_ = 0;
|
|
|
addImage(newImage);
|
|
|
+ enableTools();
|
|
|
return;
|
|
|
/* NOTREACHED */
|
|
|
}
|
|
@@ -3041,6 +3047,7 @@ ImageLabeler::enableTools()
|
|
|
action_redo_->setEnabled(true);
|
|
|
button_bound_box_tool_->setEnabled(true);
|
|
|
button_polygon_tool_->setEnabled(true);
|
|
|
+ button_tagging_tool_->setEnabled(true);
|
|
|
button_add_label_->setEnabled(true);
|
|
|
button_remove_label_->setEnabled(true);
|
|
|
button_prev_image_->setEnabled(true);
|
|
@@ -3058,6 +3065,7 @@ ImageLabeler::disableTools()
|
|
|
action_save_legend_->setEnabled(false);
|
|
|
action_bound_box_tool_->setEnabled(false);
|
|
|
action_polygon_tool_->setEnabled(false);
|
|
|
+ button_tagging_tool_->setEnabled(false);
|
|
|
action_add_description_->setEnabled(false);
|
|
|
action_undo_->setEnabled(false);
|
|
|
action_redo_->setEnabled(false);
|
|
@@ -3105,10 +3113,15 @@ ImageLabeler::labelListPopupMenu(const QPoint &aPos)
|
|
|
}
|
|
|
|
|
|
void
|
|
|
-ImageLabeler::setDescription(QString aDescription)
|
|
|
+ImageLabeler::setDataFromForm(QString aData)
|
|
|
{
|
|
|
- image_description_ = aDescription;
|
|
|
- setWindowTitle(image_description_);
|
|
|
+ if (ImageDescriptionPurpose == line_edit_form_.purpose()) {
|
|
|
+ image_description_ = aData;
|
|
|
+ setWindowTitle(image_description_);
|
|
|
+ }
|
|
|
+ else if (TaggingPurpose == line_edit_form_.purpose()) {
|
|
|
+ tags_ = aData;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void
|