-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature #9094: Del-key performs 'delete selected features' #1010
Conversation
I have tried to bring together all the comments and I have updated the pull request:
|
@ahuarte47 I tested the PR here locally, seems to work fine! two comments:
Does it sound logical to add these two points also? |
|
@ahuarte47 you are right. 1) is working here too. Sorry for the noice ad 2) No, what I mean is that it would work like when you create a new polygon. There if you create 5 nodes, you hit DEL the last one is deleted. When you then hit DEL again, the node before that one (current last one) is deleted etc. So hitting 5 times DEL removes the whole polygon. |
Don't worry Richard, you're bringing me great ideas. About (2), I had already understood this, I can implement auto-select previous node, (When you rearch first, I can go to last node and so on). But the problem is what node select, previous or next. I propose select previous, but if you agree, I can catch other keys, by example, '+' to select next node to the current node, or '-' to select previous node. Then, the user can easily select the desired node, .... What you think ? |
I would think no more keys. Just take the previous node. More ideas :-) well:
(but maybe I should make this a new feature request :-) ) |
I am sorry, I think with '+' and '-' node selection can be very agile. These keys only would be active when the 'node tool' is active. About 'remove selection' I can add a new button if you want. About 'move features', I have tested it, (I am new in QGIS :-)) and I humbly think that it can be improved. In other app desktops, the user select the target features, then move they drawing a line (it indicates the displacement) and optionally using the "snap_to_vertex" configuration. Best regards |
Hi Richard, The user can deselect the current active node of a feature clicking in any map area where there is not other vertex. The 'remove selection' button may not be necessary. |
Hi Richard, I have updated the PR with two last commits: ahuarte47@1f1bbce ahuarte47@d548e1f Regards |
@ahuarte47 The +/- behaviour sounds great to me - I'd love to see it included in this pull. |
tested, working and I think looking good :-) two small things:
and I had a strange thing ones, when I selected several nodes with the node tool (using the ctrl button) and deleted those 3 nodes via the delete button. Then the middle one was not deleted and kept selected. But I can not reproduce this anymore... |
mmm, talking to some colleagues here. for the plus and minus keys here on my keyboard I actually have to click the 'minus' and/or the 'shift-equalssign'. While for example in inkscape you use: tab and shitftab to move to to next and previous node. Another idea (again). IF I have a node selected (in Node tool) should it not be handy if I can move this one node with the arrow-keys (say: 2 pixels for only arrow, and 5 pixels for shift-arrow). Maybe only when you have 1 node, otherwise it becomes too complex I think. |
Hi Richard, about 'Settings/Configure shortcuts': I think that this dialog only shows shortcuts for generic actions or for start tools, some of them are configured by default in related *.ui files in QGIS source code. PR 1012 that you has merged recently is an example. The new shorcuts of node tool, and other existing keys in several tools (QgsMapToolCapture, QgsGrassMapcalc, QgsMapToolNodeTool, QgsMapToolAnnotation...) are hardcoded as private shorcuts of each tool. I don't know if documented. |
About plus and minus keys, on my keyboard in windows I only need click these single keys. But if you prefer other more coherent keys, (tab and shitftab), I agree with it. If other opinions are not contrary, I gladly change. |
About move the node or feature with arrow keys: I can implements this, but I don't know if it is very useful move a geometry in pixel coordinates (I say this with all due respect :-)). In my experience, the user needs to move a geometry in map coordinates using a precise offset, from keyboard or a drawing a line-displacement using optionally existing nodes as base. If you want, we can create a new feature request for modify the current "move tool" behavior: An initial proposal: 'move tool' works with the current selected features collection, the user move these features, not those clicked in first mousedown. It would allow that the user can draw a precise offset using existing nodes as base (snapping), and/or also create a new dialog where the user can input the specific offset. But first I must study if other plugins contain this "move tool" (http://plugins.qgis.org/plugins/DigitizingTools, http://plugins.qgis.org/plugins/cadtools, http://plugins.qgis.org/plugins/numericalVertexEdit...) and keep everything as is. Best regards |
let's not touch the move tool now... otherwise this PR will never be pulled.... one 'strange' behaviour I notice: if I select features via the 'Select features using an expression', then they 'look selected' == yellow, but I cannot delete them with delete/backspace. is it possible to make the delete/backspace button also work on features selected via an expression? |
I personally don't think tab/shift tab are a good choice, since they have very specific use in UIs (navigating through GUI controls). How about something like [ and ]? They require no key combination, won't clash with anything else, and it's nice and clear which one is forward and which is back... |
Hi Nyall, thank for your advice. Summarizing, we can use: Waiting opinions of experts in usability ;-) |
Hi Richard, about: "one 'strange' behaviour I notice: if I select features via the 'Select features using an expression', then they 'look selected' == yellow, but I cannot delete them with delete/backspace"... I see the problem, the features are selected, but the 'delete-backspace' keys only are executed when a selection tool is active (By point, rectangle, ....). If you has other active tool (pan, zoom, node tool...) then these keys are executed in the context of this tool and can be executed other code. For example, when 'node tool' is active 'del' key try delete selected nodes and not selected features. I managed to explain?, My English is bad :-( You are right, the user fails to understand why they are not deleted. We can provide one solution: Activate a selection tool after the "selection by expression" dialog is closed (It is easy in QgsExpressionSelectionDialog.cpp). But it can be not acepted by QGIS community. Regards |
@nyalldawson though I agree that tab is used for navigating through gui/dialogs, it is in most software also used to walk through elements. Inkscape (I think that is an example of mature editing software) also uses tab and shift tab to go through the nodes of given element. @ahuarte47 About the selection by expression problem. I think we should not selection silently active. |
Ok, Richard, I can do your advice about 'selection by expression' problem. But I think there is a problem, if we use the 'delete' key always to delete selected features, may be that there is other active tool catching 'delete' key for other purposes ('node' tool for example) and conflict occurs. |
No strong opinion from my side, only proposals to heavy-users of digitizing There are different concepts: Mapping the
|
+1 first option, also there are maptools using del-backspace key. |
+1 for the first option too, I think. To be more precise: use the del key to delete features from current active layer (if in edit mode), or show message (like now) that the layer is not in edit mode... and another feature request: after ctrl-D in the TOC, can it be that 'OK' is the default choice. This makes it a little more friendly for users to hit 'enter' .... |
Ok, I will fix it! |
Hi, last commit contains:
About last section, it works, but I would love some guru validate the implementation I've done. |
hi @ahuarte47 |
Hi RIchard, I can send a message as I did above to request opinions. Alvaro |
yes, sure. No problem. Please do |
Thank you very much Richard for your support! |
Hi @rduivenvoorde, about using the backspace key in python window, I have verified that python console (plugins -> python console) already uses backspace and delete keys. What window do you say ? |
Hi Tim, I added 'Backspace' key in other tools to normalize these two keys as 'delete' action. |
Automatically selects the adjacent vertex to last removed selected node
'+' and '-' select next and previous to current active node respectively. This commit is for demo proposes.
KeyPressed event of MapCanvas can be overrided in current MapTool. It enables to use 'Delete/Backspace' key as default shortcut to delete selected features, but it can be overrided in current maptool.
@@ -24,7 +24,7 @@ | |||
* If you want to synchronize the attribute table selection with the map canvas selection, you | |||
* should use { @link QgsVectorLayerSelectionManager } instead. | |||
*/ | |||
class GUI_EXPORT QgsGenericFeatureSelectionManager : public QgsIFeatureSelectionManager | |||
class CORE_EXPORT QgsGenericFeatureSelectionManager : public QgsIFeatureSelectionManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it should not be here! I had to change it temporarily for some time to compile.
Can you remove it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jef-n, I have fixed the incorrect changes
Thank you very much
I have merged these changes thanks! One other comment: the |
Thanks @timlinux. |
Hi Sent from my mobile phone
Yes because (on my keyboard anyway) they do not require pressing shift. You Regards Tim
|
Hi @timlinux, done! |
Thanks! Will / did you make a separate PR for that? |
@ahuarte47 hi Alvaro, do you think http://hub.qgis.org/issues/9308 is related to this? |
Hi @rduivenvoorde, you are right, it is a bug generated by me in this PR Thank you very much! |
No description provided.