I am using QFileSystemModel to populate my tree view. User can right click on a tree node (a folder) and perform an operation (exports all certain data files under this folder).
I have this export under the on_tree_clicked() but I feel like this operation belongs to model.
Will it be better if I derive my own QFileSystemModelWithExport
from QFileSystemModel
and added the export function? From on_tree_clicked(), I then just call it?
Is there another way to do this nicely? I want my on_tree_clicked()
to be shorter and cleaner.
Also I am quite new to Qt, how do we derive from Qt core class like QFileSystemModel
? When I am adding class, it lets me derive from QObject, QWidget etc but not from any model class.