Issue
As far as I understand widget window size could be defined by calling 'setGeometry' function.
import_dialog = QtGui.QFileDialog()
import_dialog.setWindowTitle('Import File')
import_dialog.setDirectory(FILE_DIR)
import_dialog.setGeometry(100, 100, 200, 200)
import_file, _ = import_dialog.getOpenFileNames()
print(import_file)
But when I'm executing this part of my gui code, I'm facing pop up window that covers entire screen. I tried to make it smaller by calling 'setGeometry' function but with no results.
How can I make it to appear smaller?
Thanks
Solution
getOpenFileNames
is a convenience static method of the QFileDialog
class. It should handle creating the dialog, setting the right size as appropriate for your OS, and retrieving the result. Try calling it like this:
filenames, _ = QFileDialog.getOpenFileNames(parent, "Select file", FILE_DIR)
If that does not help, you can create the dialog yourself (as you did) and call show()
, change the size, and bind the fileSelected
signal to a slot.
Answered By - Fenikso
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.