Gui: Rename forumula to expression + add hotkey to expression tooltip

Fixes #10601
This commit is contained in:
atlast-50
2023-09-26 18:52:20 -04:00
committed by Yorik van Havre
parent d83ba67b82
commit 5f19a9db7b
3 changed files with 7 additions and 7 deletions

View File

@@ -23,7 +23,7 @@
</size>
</property>
<property name="windowTitle">
<string>Formula editor</string>
<string>Expression editor</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">

View File

@@ -34,9 +34,9 @@ public:
void setExpressionText(const QString& text) {
if (text.isEmpty())
this->setToolTip(genericFormulaEditorTooltip);
this->setToolTip(genericExpressionEditorTooltip);
else
this->setToolTip(formulaEditorTooltipPrefix + text);
this->setToolTip(expressionEditorTooltipPrefix + text);
}
protected:
@@ -50,8 +50,8 @@ Q_SIGNALS:
private:
const QString genericFormulaEditorTooltip = tr("Enter an expression...");
const QString formulaEditorTooltipPrefix = tr("Expression: ");
const QString genericExpressionEditorTooltip = tr("Enter an expression... (=)");
const QString expressionEditorTooltipPrefix = tr("Expression: ");
};
#endif // QUANTITYSPINBOX_P_H

View File

@@ -142,11 +142,11 @@ class QuantitySpinBox(QtCore.QObject):
def onWidgetValueChanged(self):
"""onWidgetValueChanged()... Slot method for determining if a change
in widget value is a result of an expression edit, or a simple spinbox change.
If the former, emit a manual `editingFinished` signal because the Formula Editor
If the former, emit a manual `editingFinished` signal because the Expression editor
window returned a value to the base widget, leaving it in read-only mode,
and finishing the editing of the value. Otherwise, due nothing if the value
has not changed, or there is no active expression for the property.
If the user closes the Formula Editor to cancel the edit, the value will not
If the user closes the Expression editor to cancel the edit, the value will not
be changed, and this manual signal will not be emitted."""
if self._hasExpression() and self.widget.text() != self.lastWidgetText:
self.widget.editingFinished.emit()