@@ -82,7 +82,15 @@ void ExpressionEditor::setExpression(QString const& expression)
8282 insertWord (term, cursor);
8383
8484 QString operation = delimiter.match (expression, delimiterIndex).captured ();
85- cursor.insertText (operation, colorFormat (KactusColors::REGULAR_TEXT ));
85+
86+ if (property (" mandatoryField" ) == true )
87+ {
88+ cursor.insertText (operation, colorFormat (Qt::black));
89+ }
90+ else
91+ {
92+ cursor.insertText (operation, colorFormat (KactusColors::REGULAR_TEXT ));
93+ }
8694
8795 delimiterIndex = wordEndIndex + operation.length ();
8896 }
@@ -199,7 +207,14 @@ void ExpressionEditor::colorCurrentWordBlack()
199207 QTextCursor cursor = textCursor ();
200208 cursor.movePosition (QTextCursor::StartOfWord, QTextCursor::MoveAnchor);
201209 cursor.movePosition (QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
202- cursor.setCharFormat (colorFormat (KactusColors::REGULAR_TEXT ));
210+ if (property (" mandatoryField" ) == true )
211+ {
212+ cursor.setCharFormat (colorFormat (Qt::black));
213+ }
214+ else
215+ {
216+ cursor.setCharFormat (colorFormat (KactusColors::REGULAR_TEXT ));
217+ }
203218}
204219
205220// -----------------------------------------------------------------------------
@@ -248,7 +263,14 @@ void ExpressionEditor::handleParentKeyPressEvent(QKeyEvent* keyEvent)
248263 if (keyEvent->text ().isEmpty () == false )
249264 {
250265 auto cursor = textCursor ();
251- cursor.setCharFormat (colorFormat (KactusColors::REGULAR_TEXT ));
266+ if (property (" mandatoryField" ) == true )
267+ {
268+ cursor.setCharFormat (colorFormat (Qt::black));
269+ }
270+ else
271+ {
272+ cursor.setCharFormat (colorFormat (KactusColors::REGULAR_TEXT ));
273+ }
252274 setTextCursor (cursor);
253275 }
254276
0 commit comments