Results 1 to 3 of 3

Thread: main menu cut-copy-paste interaction with widgets etc.

  1. #1
    Join Date
    Jan 2013
    Location
    Grahamstown, South Africa
    Posts
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Question main menu cut-copy-paste interaction with widgets etc.

    I've been searching this and other forums for how to do this so I hope I haven't missed something obvious. If you create an edit menu in the main window (which displays in the menubar in Mac OS X), it takes over events from keyboard commands for copy, paste etc. that are already defined in widgets, line edits etc. and doesn't pass them on.

    I found a number of partial solutions but nothing that looks like a nice clean design. But what surprises me is that there isn't a standard recipe or implementation you can just drop in. Standard cut-copy-paste-undo-redo is expected on Mac OS, and to some extent in main window apps on other platforms too.

    If I'm missing something, please let me know.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: main menu cut-copy-paste interaction with widgets etc.

    You can just connect the triggered() signals of those menu actions to the respective slots of widgets that support those actions.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2013
    Location
    Grahamstown, South Africa
    Posts
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Default Re: main menu cut-copy-paste interaction with widgets etc.

    Thanks – does that mean I need to do that with every widget? What I was really looking for was a way to do that once (ideally globally, but once for a window would still be better than doing it for every widget).

Similar Threads

  1. QGraphicsView Copy and Paste
    By stevel in forum Qt Programming
    Replies: 14
    Last Post: 13th January 2014, 07:57
  2. Instance a collection of Widgets in Qt Designer without using copy/paste
    By davethomaspilot in forum General Programming
    Replies: 1
    Last Post: 8th December 2012, 16:19
  3. copy and paste
    By hubipet in forum Qt Tools
    Replies: 1
    Last Post: 17th July 2009, 06:19
  4. using cut(), copy(), paste()
    By systemz89 in forum Newbie
    Replies: 5
    Last Post: 18th December 2007, 14:47
  5. copy/paste actions in main window menu
    By magland in forum Qt Programming
    Replies: 3
    Last Post: 2nd October 2007, 12:33

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.