Skip to content

Commit 0a03f4b

Browse files
committed
set a correct ui state about the computation threshold values after invalid value set with cancel button used after
1 parent 6393619 commit 0a03f4b

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

sourceCode/application/ui/computationParameters/dialog_computationparameters.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ void Dialog_computationParameters::feed(
205205
_qvectb_layersToCompute[eLA_PX2] = bCorrScoreMapAvailable_forPX1PX2;
206206
_qvectb_layersToCompute[eLA_deltaZ] = bCorrScoreMapAvailable_forDeltaZorOther;
207207

208+
slot_rejectionValue_validityChanged(); //@LP evaluate if threshold values are ok
209+
208210
}
209211

210212

sourceCode/application/ui/computationParameters/widget_correlScoreMapParameters.cpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ void Widget_correlScoreMapParameters::feedWithEmptyDefault() {
4444
//set checkboxes states and options values if requiered
4545
//------------------
4646
//thresholdRejection
47-
setUiEnableAndChecked_option_rejection(bUse, _corrScoreMapParameters_inEdition._thresholdRejection._bUse);
4847
setUiValueFromFloat_lineEdit_rejectionValue_rejectIfBelow(_corrScoreMapParameters_inEdition._thresholdRejection._f_rejectIfBelowValue);
48+
setUiEnableAndChecked_option_rejection(bUse, _corrScoreMapParameters_inEdition._thresholdRejection._bUse);
49+
//setUiValueFromFloat_lineEdit_rejectionValue_rejectIfBelow(_corrScoreMapParameters_inEdition._thresholdRejection._f_rejectIfBelowValue);
4950

5051
//-----------------
5152
// exponent for weighting
@@ -113,37 +114,53 @@ bool Widget_correlScoreMapParameters::get_correlScoreMapParameters(S_Correlation
113114
void Widget_correlScoreMapParameters::slot_lineEdit_rejectionValue_rejectIfBelow_textEdited(const QString& text) {
114115
bool bValidityChanged = updateFieldAndWidget(text, _qstrRejectionValue, _bqstrRejectionValueValid);
115116
if (bValidityChanged) {
116-
signal_rejectionValue_validityChanged();
117+
emit signal_rejectionValue_validityChanged();
117118
}
118119
}
119120

120121
bool Widget_correlScoreMapParameters::updateFieldAndWidget(const QString& text, QString& qstr, bool &bValid) {
121122

122123
bool bMatch = string_isDecimalDigitsOnly(text);
124+
qDebug() << __FUNCTION__ << "string_isDecimalDigitsOnly(" << text << ") => bMatch = " << bMatch;
125+
123126
if (bMatch) {
127+
124128
bool bIsNotStringNumericZeroValue = false;
125129
bool bTotalCharIsEqualOrUnder = false;
126-
bool bMatch = string_isNotStringNumericZeroValue_and_totalCharIsEqualOrUnder(
130+
/*bool*/ bMatch = string_isNotStringNumericZeroValue_and_totalCharIsEqualOrUnder(
127131
text, 5,
128132
bIsNotStringNumericZeroValue, bTotalCharIsEqualOrUnder);
129133

134+
qDebug() << __FUNCTION__ << "bIsNotStringNumericZeroValue = " << bIsNotStringNumericZeroValue;
135+
qDebug() << __FUNCTION__ << "bTotalCharIsEqualOrUnder = " << bTotalCharIsEqualOrUnder;
136+
qDebug() << __FUNCTION__ << "bMatch = " << bMatch;
137+
130138
if (!bMatch) {
131-
if (bTotalCharIsEqualOrUnder && (!bIsNotStringNumericZeroValue)) {
139+
qDebug() << __FUNCTION__ << "if (!bMatch) {";
140+
141+
if (bTotalCharIsEqualOrUnder && (!bIsNotStringNumericZeroValue)) {
142+
qDebug() << __FUNCTION__ << "if (bTotalCharIsEqualOrUnder && (!bIsNotStringNumericZeroValue)) {";
132143
bMatch = true;
144+
145+
qDebug() << __FUNCTION__ << " => bMatch set to " << bMatch;
133146
}
134147
}
135148
}
149+
150+
qDebug() << __FUNCTION__ << "#1 bMatch = " << bMatch;
151+
136152
if (bMatch) {
153+
137154
bMatch = stringNumericValue_isComplianWithMaxBeforeDottMaxAfterDot(text, 3, 3);
155+
156+
qDebug() << __FUNCTION__ << "if (bMatch) { => #2 bMatch set to " << bMatch;
138157
}
139158

140159
bool bValidityBefore = bValid;
141160
bValid = bMatch;
142161

143162
if (bMatch) {
144-
145163
ui->lineEdit_rejectionValue_rejectIfBelow->setStyleSheet("");
146-
147164
qstr = ui->lineEdit_rejectionValue_rejectIfBelow->text();
148165
} else {
149166
ui->lineEdit_rejectionValue_rejectIfBelow->setStyleSheet("QLineEdit { color: rgb(255, 0, 0); }");
@@ -184,8 +201,9 @@ void Widget_correlScoreMapParameters::feed(bool bAvailableForEdit,
184201
//check options if set
185202
//------------------
186203
//thresholdRejection
187-
setUiEnableAndChecked_option_rejection(bUse, _corrScoreMapParameters_inEdition._thresholdRejection._bUse);
188204
setUiValueFromFloat_lineEdit_rejectionValue_rejectIfBelow(_corrScoreMapParameters_inEdition._thresholdRejection._f_rejectIfBelowValue);
205+
setUiEnableAndChecked_option_rejection(bUse, _corrScoreMapParameters_inEdition._thresholdRejection._bUse);
206+
//setUiValueFromFloat_lineEdit_rejectionValue_rejectIfBelow(_corrScoreMapParameters_inEdition._thresholdRejection._f_rejectIfBelowValue);
189207

190208
//-----------------
191209
// exponent for weighting

0 commit comments

Comments
 (0)