From 197aa0c85c30d2a9f8c949a43e65f8f4964634a4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 22 Apr 2015 14:01:27 +0200 Subject: [PATCH] + fix bug in read-only InputField, minor Utf-8 issue in meshing dialog --- src/Gui/InputField.cpp | 10 ++++++++++ src/Mod/MeshPart/Gui/Tessellation.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index 504753fbf..3793f3c8e 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -497,6 +497,11 @@ void InputField::focusInEvent(QFocusEvent * event) void InputField::keyPressEvent(QKeyEvent *event) { + if (isReadOnly()) { + QLineEdit::keyPressEvent(event); + return; + } + switch (event->key()) { case Qt::Key_Up: { @@ -520,6 +525,11 @@ void InputField::keyPressEvent(QKeyEvent *event) void InputField::wheelEvent (QWheelEvent * event) { + if (isReadOnly()) { + QLineEdit::wheelEvent(event); + return; + } + double step = event->delta() > 0 ? StepSize : -StepSize; double val = actUnitValue + step; if (val > Maximum) diff --git a/src/Mod/MeshPart/Gui/Tessellation.cpp b/src/Mod/MeshPart/Gui/Tessellation.cpp index 97a452b8b..e8061644f 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.cpp +++ b/src/Mod/MeshPart/Gui/Tessellation.cpp @@ -318,7 +318,7 @@ bool Tessellation::accept() .arg(label); } } - Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toAscii()); + Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toUtf8()); } activeDoc->commitTransaction(); }