Gui: Rename forumula to expression + add hotkey to expression tooltip
Fixes #10601
This commit is contained in:
committed by
Yorik van Havre
parent
49dfaaefa0
commit
c8fbe03eb1
@@ -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">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user