PDA

View Full Version : QtreeView copy/paste/cut



mohd firdaus
12th February 2017, 06:42
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?

anda_skoa
12th February 2017, 08:30
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,
_