mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-19 21:29:59 +01:00
working on enable/disable keys
This commit is contained in:
@@ -110,6 +110,7 @@ void ChromaWindow::createControls() {
|
||||
connect(color_okay, SIGNAL(clicked()), this, SLOT(colorSet()));
|
||||
connect(lowButton, SIGNAL(clicked()), this, SLOT(setColorLow()));
|
||||
connect(highButton, SIGNAL(clicked()), this, SLOT(setColorHigh()));
|
||||
connect(keys_enabled, SIGNAL(clicked()), this, SLOT(toggleKey()));
|
||||
}
|
||||
|
||||
|
||||
@@ -251,3 +252,20 @@ void ChromaWindow::setColorHigh() {
|
||||
}
|
||||
}
|
||||
|
||||
void ChromaWindow::enableKey(bool op) {
|
||||
if(op) {
|
||||
if(colorkeys_vec.size()==0) {
|
||||
QMessageBox::information(this, "Needs a Key", "Please set a key to enable this feature");
|
||||
keys_enabled->setChecked(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChromaWindow::toggleKey() {
|
||||
if(keys_enabled->isChecked()) {
|
||||
enableKey(true);
|
||||
} else {
|
||||
enableKey(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ public:
|
||||
bool checkInput(cv::Vec3b &low, cv::Vec3b &high);
|
||||
bool checkEdit(QLineEdit *edit);
|
||||
void setEditFromColor(int val, QColor color);
|
||||
void enableKey(bool op);
|
||||
public slots:
|
||||
void openColorSelectRange();
|
||||
void openColorSelectTolerance();
|
||||
@@ -20,6 +21,7 @@ public slots:
|
||||
void setColorLow();
|
||||
void setColorHigh();
|
||||
void setImage();
|
||||
void toggleKey();
|
||||
private:
|
||||
void createControls();
|
||||
QRadioButton *button_select_range, *button_select_tolerance;
|
||||
|
||||
Reference in New Issue
Block a user