matchshowsetting.cpp 765 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

#include <QVBoxLayout>

#include "matchshowsetting.hpp"

namespace cvv{ namespace qtutil {

MatchShowSetting::MatchShowSetting(std::vector<cv::DMatch>, QWidget *parent):
	MatchSettings{parent}
{
	auto layout=util::make_unique<QVBoxLayout>();
	auto button=util::make_unique<QPushButton>();

	button_=button.get();

	button_->setEnabled(true);
	button_->setCheckable(true);


	connect(button.get(),SIGNAL(clicked()),this,SLOT(updateAll()));
	connect(button.get(),SIGNAL(clicked()),this,SLOT(updateButton()));

	button->setChecked(true);
	layout->addWidget(button.release());

	setLayout(layout.release());
	updateButton();
}

void MatchShowSetting::updateButton()
{
	if(button_->isChecked()){
		button_->setText("show");
	}else{
		button_->setText("hide");
	}
}

}}