Results 1 to 7 of 7

Thread: Drag and drop per key press?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,318
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Drag and drop per key press?

    Drag-and-drop from some program to some other program, may it be part of Windows explorer, without asking if the user is really sure, seems like a common thing to me.
    What your OP proposed is not drag and drop. It is selecting something through key presses and then doing something with that selection outside of the normal drag and drop protocols. In the normal drag and drop interaction, both the drag source and potential drop targets determine what can happen and provide feedback to the user that tells them what is or is not possible. And in many cases, if the drop will be destructive, there will be a confirmation warning first. This is present in Windows Explorer and is an option that can be toggled off.

    I appreciate the design of QDrag for almost-always similar use, I'm quite happy with Qt so far as most common things are easy to do. But sometimes common use is not what is wanted, so I just find it unfortunate when something seemingly straightforward to implement like providing a setter for a different key doesn't exist. But maybe I'm wrong and this is hard to implement. Then again there are notes about possible deprecation of internal QDrag related classes, so maybe some extensions are planned already.
    No, not likely. What you propose is something that goes against accepted conventions for user interface interaction. Drag and drop means exactly what its name implies - you click on something, drag it to where you want it, and drop it if the destination allows.

    My issue with this is again use-speed
    Sorry, but I think most UI designers would tell you that you should focus on usability first, then on performance. If you implement a UI that does things in a way that is completely foreign to what users know and understand from using other, more conventional apps, then most people will not want to use your app because it requires them to remember strange patterns of interaction, or if they don't remember, could cause them to accidentally lose their files or their work because what they did caused something unexpected to happen.

    It really isn't clever or innovative to force users to adapt to your style or think outside the box every time they want to use your app. People won't use your app if they have to do that, or if your app has scared them into not using it because it behaves in strange and unexpected ways. It might be boring to write code that does the usual things, but if users reject your app because it doesn't, then you really haven't succeeded.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Aug 2020
    Posts
    19
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Drag and drop per key press?

    What your OP proposed is not drag and drop. It is selecting something through key presses and then doing something with that selection outside of the normal drag and drop protocols
    Maybe I should have quoted "drag and drop" but I was not trying to refer to some standard or conventional protocol, but rather to the conceptional, abstract, action of drag & drop. That is, something like
    • Retrieve some object/data calculated from a screen-position
    • Hold on to that object while some condition is true
    • Retrieve some other object/data calculated from some other screen position while that condition is true or it is changed to false
    • Use the first and last selected objects to calculate something once the condition is false


    In my use case: The first selected object is the file displayed by the app. The "condition" is simply always false. The last selected object is the OS window under the mouse cursor. The "calculate something" is moving the file to the directory of the OS window, if it is a Windows explorer window.

    The underlined part is what I found only QDrag be able to do, yet locked away behind the restrictions of QDrag, and seemingly not accessible by other means. Maybe my OP question should have been "How to retrieve path of Windows explorer window under mouse cursor? QDrag can do it, how can I do it without QDrag?"

    No, not likely. What you propose is something that goes against accepted conventions for user interface interaction. Drag and drop means exactly what its name implies - you click on something, drag it to where you want it, and drop it if the destination allows.
    I do not see why the physical process has to have anything to do with the abstract concept. In the points I wrote above, for some reason, the reference positions must be the mouse cursor location. For some reason, the process must be started and ended by pressing and releasing the left mouse button. For some reason, the "condition" is "while left button is down". These are good defaults by convention, but I do not see any reason to intentionally not allow to change these. QDrag implements exactly the drag & drag concept I need, but for some reason does not allow me to change these arbitrary defaults.

    Sorry, but I think most UI designers would tell you that you should focus on usability first, then on performance.
    I am not and do not intend to be a UI designer. I need a specific solution for a specific problem. My apps whole purpose is to be efficient to use: If it can be done by a single button, it should be able to be done by a single button. If I cared about ease-of-use over efficiency-of-use, I would keep using the 3rd party program I have been using for years (minus some missing functionality). But it follows UI conventions, and over the years I am getting increasingly frustrated about unnecessary UI sugar that serves no purpose other than to be easy to use. This is great when starting out, but too cumbersome and slow in the long run. I may make my app available via some means, but this will be a side effect if anything. If someone wants to use it, great, if not, that's fine.


    But as far as I take from the answers, my OP question is not possible with Qt-only. Though I still see it as "open-to-be-implemented" and not "intentionally not implemented".

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,318
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Drag and drop per key press?

    I do not see why the physical process has to have anything to do with the abstract concept.
    The physical process is the embodiment of the abstract concept. The abstract concept is not "select something and cause it to be moved somewhere else". There are any number of ways to do that that do not involve the abstract concept of dragging and dropping. The only way you could adequately implement the concept of drag and drop using the keyboard would be to simulate, maybe via arrow keys, picking the selected item(s) up from where they are, providing feedback as you move them to a new location, and feedback that the item is droppable at the new location and has been dropped.

    I need a specific solution for a specific problem.
    So if you are simply dong this for your own use, then have at it. I mistakenly assumed you were developing an app others would use.

    "intentionally not implemented"
    The likely case. The whole UI concept of drag and drop is based on the visual interaction of using the mouse (or your finger, or the claw in an arcade game simulation), picking something up, moving it somewhere else, and dropping it, all the while providing visual feedback about what is happening. QDrag and the logic around it have been designed to implement that concept, and it is a standard part of UI interaction on every graphical UI platform I've come across.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 0
    Last Post: 28th June 2019, 12:36
  2. Replies: 2
    Last Post: 30th January 2014, 06:46
  3. Replies: 0
    Last Post: 7th January 2012, 15:20
  4. Replies: 2
    Last Post: 13th October 2010, 21:51
  5. Replies: 0
    Last Post: 4th May 2010, 10:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.