Qt Designer: copy and paste? Drag and Drop (with option key for "duplicate")?



  • it seems that copy and paste doesn't actually work in Designer. Say i make a group of things that i need several of, i expect i can select the group, and go copy, paste, and a copy of the group will paste next to (or inside of) the thing that is selected.

    but it's a no go?

    likewise in the heirarchical view on the right, i can't copy paste there either, nor can i drag while holding option to duplicate. in fact why can't i drag at all in the hierarchical list?

    am i missing something?


  • Lifetime Qt Champion

    Hi
    That sounds a bit odd. inside design area, i can copy & paste all i like.
    Also CTRL + drag a widget will duplicate it. (on windows/linux at least)
    However, you are right that dragging from hierarchical don't work. but does allow right click and use copy.


  • Qt Champions 2017

    @mrjj said in Qt Designer: copy and paste? Drag and Drop (with option key for "duplicate")?:

    i can copy & paste all i like.

    Copy yes, paste only if not into a layout-ed widget.



  • But all of my widgets are in the outs. Why can you not paste into a layout? That doesn’t seem to be any real good reason.


  • Qt Champions 2017

    @davecotter said in Qt Designer: copy and paste? Drag and Drop (with option key for "duplicate")?:

    Why can you not paste into a layout?

    Just the way it is. Can't decide where to paste it. Drag & drop with Ctrl held works though, as you can choose where the copied widget goes.



  • well, i suppose i'd imagine it would either:

    1: paste it last in the group that contains whatever is already selected (so you can go "copy paste" and have it appear next to the already selected item or
    2: show a little alert dialog telling you what to do to have paste work

    the reason i didn't imagine using "control" as the "duplicate" modifier is that i'm on a mac. on the mac, the option key is the "duplicate" modifier for drag and drop. i'd consider this a bug :/

    thanks


  • Qt Champions 2017

    1: paste it last in the group that contains whatever is already selected (so you can go "copy paste" and have it appear next to the already selected item or

    Couldn't work for grid layouts.

    2: show a little alert dialog telling you what to do to have paste work

    Well, I get a dialog saying that. Don't you?

    the reason i didn't imagine using "control" as the "duplicate" modifier is that i'm on a mac. on the mac, the option key is the "duplicate" modifier for drag and drop. i'd consider this a bug

    Maybe, I don't know. I don't work on mac, so I really have no clue.



  • for a grid layout, just paste next to the current item, offset down and to the right by 20 pixels. the point is, whatever happens, don't FAIL to paste. let the user manage the wrong paste location.. IMHO

    yes i do get a dialog that says this:

    Cannot paste widgets. Designer could not find a container without a layout to paste into.

    which just seems... surprising to me. there are all sorts of containers available. including the layout container i'm in. go ahead and paste into my layout container, it's exactly what i want.

    Break the layout of the container you want to paste into, select this container and then paste again

    i do not want to break the layout. that's not a helpful suggestion.

    a good suggestion would be "try control-dragging the widget, and drop it where you want it"

    (although, control-click on mac causes a "right click" or "context menu click" which is why no mac user would ever imagine control-clicking would cause a duplicate-drag)


  • Qt Champions 2017

    @davecotter said in Qt Designer: copy and paste? Drag and Drop (with option key for "duplicate")?:

    for a grid layout, just paste next to the current item

    The problem is next to it to the right, to the left, or on the next row?

    a good suggestion would be "try control-dragging the widget, and drop it where you want it"

    I agree. We could actually rectify that by a rather simple and small patch to Creator.



  • next to it to the right, to the left, or on the next row?

    Anywhere. It literally doesn't matter, as long as it scrolls into view if it goes off screen. The user can then pick it up and drag it where they meant to put it, if it's in the wrong place.

    Anything but "i'm not gonna paste this". At least, that would be my expectation.

    I'm going by the tenet of "the UI of least surprise", and i figure it's LESS surprising to paste in the wrong place, and MORE surprising to just block the ability to paste.

    :D

    -dave


  • Banned

    This post is deleted!

  • Lifetime Qt Champion

    This post is deleted!

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.