mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-17 12:20:00 +01:00
still working on interface
This commit is contained in:
@@ -77,9 +77,23 @@ void ChromaWindow::createControls() {
|
|||||||
color_remove->setGeometry(320-10, 155, 75, 20);
|
color_remove->setGeometry(320-10, 155, 75, 20);
|
||||||
color_okay = new QPushButton(tr("Set Keys"), this);
|
color_okay = new QPushButton(tr("Set Keys"), this);
|
||||||
color_okay->setGeometry(320-10,210, 75, 20);
|
color_okay->setGeometry(320-10,210, 75, 20);
|
||||||
|
|
||||||
|
lowColor = new QLabel("Set", this);
|
||||||
|
highColor = new QLabel("Set", this);
|
||||||
|
|
||||||
|
lowColor->setGeometry(330, 65, 25, 20);
|
||||||
|
highColor->setGeometry(330, 90, 25, 20);
|
||||||
|
|
||||||
|
lowButton = new QPushButton("Set", this);
|
||||||
|
lowButton->setGeometry(300, 65, 25, 20);
|
||||||
|
highButton = new QPushButton("Set", this);
|
||||||
|
highButton->setGeometry(300, 90, 25, 20);
|
||||||
|
|
||||||
connect(color_add, SIGNAL(clicked()), this, SLOT(colorAdd()));
|
connect(color_add, SIGNAL(clicked()), this, SLOT(colorAdd()));
|
||||||
connect(color_remove, SIGNAL(clicked()), this, SLOT(colorRemove()));
|
connect(color_remove, SIGNAL(clicked()), this, SLOT(colorRemove()));
|
||||||
connect(color_okay, SIGNAL(clicked()), this, SLOT(colorSet()));
|
connect(color_okay, SIGNAL(clicked()), this, SLOT(colorSet()));
|
||||||
|
connect(lowButton, SIGNAL(clicked()), this, SLOT(setColorLow()));
|
||||||
|
connect(highButton, SIGNAL(clicked()), this, SLOT(setColorHigh()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -129,7 +143,7 @@ void ChromaWindow::colorAdd() {
|
|||||||
void ChromaWindow::colorRemove() {
|
void ChromaWindow::colorRemove() {
|
||||||
int index = color_keys->currentRow();
|
int index = color_keys->currentRow();
|
||||||
if(index >= 0) {
|
if(index >= 0) {
|
||||||
QListWidgetItem *i = color_keys->takeItem(index);
|
/*QListWidgetItem *i = */color_keys->takeItem(index);
|
||||||
auto in = colorkeys_vec.begin()+index;
|
auto in = colorkeys_vec.begin()+index;
|
||||||
if(!colorkeys_vec.empty()) {
|
if(!colorkeys_vec.empty()) {
|
||||||
colorkeys_vec.erase(in);
|
colorkeys_vec.erase(in);
|
||||||
@@ -143,3 +157,24 @@ void ChromaWindow::colorSet() {
|
|||||||
QMessageBox::information(this, "Set Key Values", text);
|
QMessageBox::information(this, "Set Key Values", text);
|
||||||
ac::setBlockedColorKeys(colorkeys_vec);
|
ac::setBlockedColorKeys(colorkeys_vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ChromaWindow::setColorLow() {
|
||||||
|
QColorDialog *dialog = new QColorDialog(this);
|
||||||
|
QColor color= dialog->getColor();
|
||||||
|
QVariant variant= color;
|
||||||
|
QString colcode = variant.toString();
|
||||||
|
set_low_color = color;
|
||||||
|
lowColor->setStyleSheet("QLabel { background-color :"+colcode+" ; color : blue; }");
|
||||||
|
lowColor->setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChromaWindow::setColorHigh() {
|
||||||
|
QColorDialog *dialog = new QColorDialog(this);
|
||||||
|
QColor color = dialog->getColor();
|
||||||
|
QVariant variant= color;
|
||||||
|
QString colcode = variant.toString();
|
||||||
|
set_high_color = color;
|
||||||
|
highColor->setStyleSheet("QLabel { background-color :"+colcode+" ; color : blue; }");
|
||||||
|
highColor->setText("");
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public slots:
|
|||||||
void colorAdd();
|
void colorAdd();
|
||||||
void colorRemove();
|
void colorRemove();
|
||||||
void colorSet();
|
void colorSet();
|
||||||
|
void setColorLow();
|
||||||
|
void setColorHigh();
|
||||||
private:
|
private:
|
||||||
void createControls();
|
void createControls();
|
||||||
QRadioButton *button_select_range, *button_select_tolerance;
|
QRadioButton *button_select_range, *button_select_tolerance;
|
||||||
@@ -23,7 +25,10 @@ private:
|
|||||||
QLabel *string_low, *string_high;
|
QLabel *string_low, *string_high;
|
||||||
QListWidget *color_keys;
|
QListWidget *color_keys;
|
||||||
QPushButton *color_add, *color_remove, *color_okay;
|
QPushButton *color_add, *color_remove, *color_okay;
|
||||||
|
QLabel *lowColor, *highColor;
|
||||||
std::vector<ac::Keys> colorkeys_vec;
|
std::vector<ac::Keys> colorkeys_vec;
|
||||||
|
QPushButton *lowButton, *highButton;
|
||||||
|
QColor set_low_color, set_high_color;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user