Version: 1.2.0 (using KDE 4.4.2) OS: Linux In many editor functions (such as free rotation, or Brightness/Contrast/Gamma), focus on number input fields (such as amount of contrast change, or free rotation angle) is lost automatically after a very short time, causing input to be interpreted out of context. This has potentially disastrous results, as a hesitation is often followed by a correction (using backspace), causing loss of photo. Reproducible: Always Steps to Reproduce: 1. Edit picture 2. Enter Brightness/Contrast/Gamma 3. Click on contrast, and start inputting number 4. Hesitate while typing a digit Actual Results: Focus is lost. Expected Results: Focus should not be lost due to hesitation. OS: Linux (x86_64) release 2.6.32-23-generic Compiler: cc
"is lost automatically after a very short time ???" Gilles Caulier
Yes, the number input field loses focus after a short while. From then on, most keystrokes are ignored, and backspace is being misinterpreted as "delete current photo". This is not only annoying, but also very dangerous.
Marcel, I can reproduce well the problem there. After investigations, i can said that all EditorToolThreaded tools are affected by this problem, but NOT all EditorTool tools. To test, BCG tool is multithreaded and settings widget lost focus, ColorEffect tool is not yet multithreaded and do not lost focus. To add toolSettings()->setFocus() call at en of EditorToolThreaded::slotAbort() do not solve the problem. Running digiKam through valgrind which slowdown execution, i can see that settings widget do not lost focus when rendering is done, but something take the focus just after that. I can't find which widget exactly. Any suggestions ? Gilles Caulier
void BCGTool::prepareEffect() { kapp->setOverrideCursor(Qt::WaitCursor); toolSettings()->setEnabled(false); // HERE toolView()->setEnabled(false); I think the problem reported is a side effect of a general bad habit of this plugin: All the widgets are disabled while rendering. This is acceptable when the user clicked OK, but not if the user was typing in a widget and the preview is generated only because a timer expired. Is there a technical necessity for calling setEnabled(false)?
Marcel, As the preview is rendered in a separate thread, the goal is to prevent that user change settings during rendering process. Also, why QWidget::setEnabled(false) remove focus to widget. When QWidget::setEnabled(true) is called, Qt4 must set back the focus on the widget. Gilles
Marcel, I commented these lines: void BCGTool::prepareEffect() { ... toolSettings()->setEnabled(false); toolView()->setEnabled(false); ... } and these lines : void BCGTool::renderingFinished() { ... toolSettings()->setEnabled(true); toolView()->setEnabled(true); ... } This is not solve the problem. The focus is not lost by setEnabled() calls Note : After to rendre on time the preview, when i press enter, the tool apply the effect. So the keyboard focus are reaffected to buttons on the bottom of tool settings view. Gilles
It works fine for me. Did you reinstall the plugin? You can put a kDebug() << QApplication::focusWidget(); before and after the setEnabled(false) and see that it changes from the spin box to 0x0. I dont think there is a problem with keeping the boxes enabled. Our filters should be cancellable.
Marcel, You has right. It work now at home... I don't know why today, in my office, this patch failed. I will fix editor tools in this way... Gilles Caulier
SVN commit 1175974 by cgilles: Do not disable settings view from EditorToolthreaded filters during computation, else, keyboard focus is lost into settings view BUGS: 248943 M +0 -15 imageplugins/color/adjustcurvestool.cpp M +1 -2 imageplugins/color/adjustcurvestool.h M +0 -15 imageplugins/color/adjustlevelstool.cpp M +2 -3 imageplugins/color/adjustlevelstool.h M +0 -18 imageplugins/color/autocorrectiontool.cpp M +0 -1 imageplugins/color/autocorrectiontool.h M +0 -14 imageplugins/color/bcgtool.cpp M +0 -1 imageplugins/color/bcgtool.h M +0 -14 imageplugins/color/bwsepiatool.cpp M +0 -1 imageplugins/color/bwsepiatool.h M +0 -15 imageplugins/color/cbtool.cpp M +0 -1 imageplugins/color/cbtool.h M +0 -15 imageplugins/color/channelmixertool.cpp M +0 -1 imageplugins/color/channelmixertool.h M +0 -15 imageplugins/color/hsltool.cpp M +0 -1 imageplugins/color/hsltool.h M +0 -12 imageplugins/color/profileconversiontool.cpp M +1 -1 imageplugins/color/profileconversiontool.h M +0 -15 imageplugins/color/whitebalancetool.cpp M +2 -3 imageplugins/color/whitebalancetool.h M +0 -12 imageplugins/decorate/bordertool.cpp M +0 -1 imageplugins/decorate/bordertool.h M +0 -12 imageplugins/decorate/texturetool.cpp M +0 -1 imageplugins/decorate/texturetool.h M +0 -11 imageplugins/enhance/antivignettingtool.cpp M +0 -1 imageplugins/enhance/antivignettingtool.h M +0 -14 imageplugins/enhance/blurtool.cpp M +0 -1 imageplugins/enhance/blurtool.h M +0 -15 imageplugins/enhance/hotpixels/hotpixelstool.cpp M +0 -1 imageplugins/enhance/hotpixels/hotpixelstool.h M +0 -7 imageplugins/enhance/inpaintingtool.cpp M +0 -1 imageplugins/enhance/inpaintingtool.h M +0 -13 imageplugins/enhance/lensautofixtool.cpp M +0 -1 imageplugins/enhance/lensautofixtool.h M +0 -18 imageplugins/enhance/lensdistortiontool.cpp M +1 -1 imageplugins/enhance/lensdistortiontool.h M +0 -12 imageplugins/enhance/localcontrasttool.cpp M +0 -1 imageplugins/enhance/localcontrasttool.h M +0 -14 imageplugins/enhance/noisereductiontool.cpp M +0 -1 imageplugins/enhance/noisereductiontool.h M +11 -11 imageplugins/enhance/redeyetool.cpp M +3 -3 imageplugins/enhance/redeyetool.h M +0 -12 imageplugins/enhance/restorationtool.cpp M +0 -1 imageplugins/enhance/restorationtool.h M +0 -7 imageplugins/enhance/sharpentool.cpp M +0 -3 imageplugins/filters/blurfxtool.cpp M +0 -12 imageplugins/filters/charcoaltool.cpp M +0 -1 imageplugins/filters/charcoaltool.h U imageplugins/filters/distortionfxtool.cpp M +0 -12 imageplugins/filters/embosstool.cpp M +0 -1 imageplugins/filters/embosstool.h M +0 -8 imageplugins/filters/filmgraintool.cpp M +0 -12 imageplugins/filters/oilpainttool.cpp M +0 -1 imageplugins/filters/oilpainttool.h M +0 -15 imageplugins/filters/raindroptool.cpp M +1 -1 imageplugins/filters/raindroptool.h M +1 -13 imageplugins/transform/freerotationtool.cpp M +0 -1 imageplugins/transform/freerotationtool.h M +0 -21 imageplugins/transform/resizetool.cpp M +0 -23 imageplugins/transform/sheartool.cpp M +0 -1 imageplugins/transform/sheartool.h M +6 -1 utilities/imageeditor/editor/editortool.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1175974