Results 1 to 2 of 2

Thread: QtreeView copy/paste/cut

  1. #1
    Join Date
    Feb 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Post QtreeView copy/paste/cut

    Hi all, i used a Qt Creator to create a widget for my final year project. i want to create a Qtreeview widget to list the drive in the windows and doing some operation in the widget like copy, paste and cut files. i have done create the widget but i have a problem in creating the operation.
    can you help me?

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

    Default Re: QtreeView copy/paste/cut

    You need a way to trigger those actions, e.g. push buttons, context menu, shortcuts, menu or toolbar buttons.

    For the first see QPushButton for the others see QAction.

    You can get the selected items from the view's QItemSelectionModel.

    How you get the file names and paths depends on what model you are using for the view. Are you currently using the QFileSystemModel?

    Cheers,
    _

Similar Threads

  1. QGraphicsView Copy and Paste
    By stevel in forum Qt Programming
    Replies: 14
    Last Post: 13th January 2014, 08:57
  2. copy and paste
    By hubipet in forum Qt Tools
    Replies: 1
    Last Post: 17th July 2009, 07:19
  3. using cut(), copy(), paste()
    By systemz89 in forum Newbie
    Replies: 5
    Last Post: 18th December 2007, 15:47
  4. Replies: 8
    Last Post: 10th November 2006, 10:39
  5. Copy/Paste in TableView
    By bronte in forum Qt Programming
    Replies: 2
    Last Post: 10th September 2006, 22:36

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.