I've got a basic PyQt QFileDialog file browser goin in Python, Kubuntu.
My issue is I would like the "tab key" in the file input to act as tab-complete does in a shell.
Is there any way to accomplish this?
I've got a basic PyQt QFileDialog file browser goin in Python, Kubuntu.
My issue is I would like the "tab key" in the file input to act as tab-complete does in a shell.
Is there any way to accomplish this?
You will have to subclass the QFileDialog, and change the behavior. It will probably not be easy.
From a UI/UX standpoint are you sure that's what you want? In forms and dialogs tab has traditionally meant go to next field. You might be confusing the user. Or you might start a revolution in User Experience for forms :-)
Just curious if that's what you really want?
I haven't made use of PyQt yet, but I think the QCompleter class might be most of the way to what you want:
http://doc.trolltech.com/4.5/tools-completer.html
I don't know if it tab completes or if that's something you'd have to add yourself.
I am not sure you can actually, i don't see any access to the input field in the documentation of QFileDialog. Qt is fairly aggressive at hiding implementation detail from it's users. You might be able to do this by taking the implementation of QFileDialog (C++) and modify it for your purpose.