Bug report #15177

User input dock misbehaving

Added by Martin Dobias over 7 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
Assignee:Denis Rouzaud
Category:GUI
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:23116

Description

Some floating widgets used with map tools have the ability to be docked (e.g. for rotate feature tool, offset curve tool, add circular string by radius) - see QgsUserInputDockWidget.

There are however multiple issues related to the current approach:

  • when the widget is floating (default), it is not possible to detect that "X" (close) button was pressed (to cancel pending operation)
  • when docked, the widget moves other dock widgets and it may also resize canvas, causing unpleasant flicker
  • widgets need special handling for focus, e.g. widget for rotate tool (QgsAngleMagnetWidget) has custom event filter to handle end of editing. Widget for offset curve does not have custom event filter and has issues (1. closing of widget behaves as if enter was pressed, 2. docking it makes it disappear immediately)
In my opinion a better solution would be to have a common area embedded in map canvas area where map tools could ask for numeric user input whenever needed (just like we have message bar embedded in canvas). This should solve all problems:
  • cancelling pending operation (the widget would have a close button)
  • predictable position for user input (e.g. lower-left corner of map canvas), no need to move floating widget
  • dock widgets "jumping" around if docked user input widget is shown/hidden
  • no need for custom event filters or other hacks to sort out focus issues

Associated revisions

Revision 20722f4e
Added by Denis Rouzaud about 6 years ago

[user input widget] use a floating widget rather than a dock

fix #15177

History

#1 Updated by Matthias Kuhn over 7 years ago

As a quick fix we could also use the Qt::Tool window flag which makes it only floating but not dockable.

66c47d7

#2 Updated by Martin Dobias over 7 years ago

I think this is a different problem - the implementation used here with tools actually embeds widgets into an existing special dock widget of QGIS, they are not standalone tool windows like in the case mentioned above...

#3 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#4 Updated by Denis Rouzaud about 6 years ago

  • Description updated (diff)
  • Assignee set to Denis Rouzaud

#5 Updated by Denis Rouzaud about 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

#6 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF