Home > Back-end >  How to shield QFiledialog drag in QT, please
How to shield QFiledialog drag in QT, please

Time:10-01

QT programming, using Filedialog select file to open operation, due to the use of touch screen, the user can easily will be a file or folder drag and drop to other folder, consider to disable file drag and drop function, using inheritance Qfiledialog overloading drag and drop related function, debugging found that when the drag and drop is not related function, can you tell me how to disable?

CodePudding user response:

How do you disable - (/'

CodePudding user response:

Override QDropEvent function

CodePudding user response:

If it is banned QFileDialog open files being dragged in a resource manager, you can use:
 
QFileDialog fileDialog;
FileDialog. SetOptions (QFileDialog: : ReadOnly | QFileDialog: : DontUseNativeDialog);
FileDialog. The show ();

CodePudding user response:

reference not Yi reply: 3/f
if it is banned QFileDialog open files being dragged in a resource manager, you can use:
 
QFileDialog fileDialog;
FileDialog. SetOptions (QFileDialog: : ReadOnly | QFileDialog: : DontUseNativeDialog);
FileDialog. The show ();

Thank you, have to do is use the readonly,
  • Related