From 379018cde472e70de44bedab64fc29f86ace685c Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 9 Jan 2020 23:36:28 +0100 Subject: [PATCH] [skip ci] fix superfluous workarounds --- src/Gui/QuantitySpinBox.cpp | 10 ---------- src/Gui/QuantitySpinBox.h | 4 ---- src/Mod/Part/Gui/TaskAttacher.cpp | 16 ++++++---------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index b2c5d1475e..3bfd2a2db6 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -290,16 +290,6 @@ void Gui::QuantitySpinBox::setExpression(boost::shared_ptr expr) } } -void Gui::QuantitySpinBox::setEditorToolTip(const QString &name) -{ - lineEdit()->setToolTip(name); -} - -void Gui::QuantitySpinBox::setIconToolTip(const QString &name) -{ - iconLabel->setToolTip(name); -} - QString QuantitySpinBox::boundToName() const { if (isBound()) { diff --git a/src/Gui/QuantitySpinBox.h b/src/Gui/QuantitySpinBox.h index 1c851ea4be..cc9c9ddaea 100644 --- a/src/Gui/QuantitySpinBox.h +++ b/src/Gui/QuantitySpinBox.h @@ -129,10 +129,6 @@ public: bool event(QEvent *event); void setExpression(boost::shared_ptr expr); - /// Sets a tooltip for the LineEdit - void setEditorToolTip(const QString &name); - /// Sets a tooltip for the IconLabel - void setIconToolTip(const QString &name); void bind(const App::ObjectIdentifier &_path); bool apply(const std::string &propName); diff --git a/src/Mod/Part/Gui/TaskAttacher.cpp b/src/Mod/Part/Gui/TaskAttacher.cpp index d5333d1f36..4668f3036f 100644 --- a/src/Mod/Part/Gui/TaskAttacher.cpp +++ b/src/Mod/Part/Gui/TaskAttacher.cpp @@ -215,12 +215,6 @@ TaskAttacher::TaskAttacher(Gui::ViewProviderDocumentObject *ViewProvider,QWidget Gui::Document* document = Gui::Application::Instance->getDocument(ViewProvider->getObject()->getDocument()); connectDelObject = document->signalDeletedObject.connect(bnd1); connectDelDocument = document->signalDeleteDocument.connect(bnd2); - - // set tooltips because the ones in the .ui file are not taken for QuantitySpinBoxes (see bug https://freecadweb.org/tracker/view.php?id=4059) - // FIXME: remove this once the bug is fixed - ui->attachmentOffsetRoll->setEditorToolTip(QString::fromUtf8("Rotation around the x-axis\nNote: The placement is expressed in local coordinate system\nof object being attached.")); - ui->attachmentOffsetPitch->setEditorToolTip(QString::fromUtf8("Rotation around the y-axis\nNote: The placement is expressed in local coordinate system\nof object being attached.")); - ui->attachmentOffsetYaw->setEditorToolTip(QString::fromUtf8("Rotation around the z-axis\nNote: The placement is expressed in local coordinate system\nof object being attached.")); } TaskAttacher::~TaskAttacher() @@ -745,10 +739,12 @@ void TaskAttacher::updateAttachmentOffsetUI() ui->attachmentOffsetPitch->setEnabled(!bRotationBound); ui->attachmentOffsetRoll->setEnabled(!bRotationBound); - QString tooltip = bRotationBound ? tr("Not editable because rotation of AttachmentOffset is bound by expressions.") : QString(); - ui->attachmentOffsetYaw->setToolTip(tooltip); - ui->attachmentOffsetPitch->setToolTip(tooltip); - ui->attachmentOffsetRoll->setToolTip(tooltip); + if (bRotationBound) { + QString tooltip = tr("Not editable because rotation of AttachmentOffset is bound by expressions."); + ui->attachmentOffsetYaw->setToolTip(tooltip); + ui->attachmentOffsetPitch->setToolTip(tooltip); + ui->attachmentOffsetRoll->setToolTip(tooltip); + } bBlock = false; ui->attachmentOffsetX->blockSignals(bBlock);