PyQt4 File select widget

后端 未结 3 451
Happy的楠姐
Happy的楠姐 2021-02-07 02:18

I want to make a QT4 (using QT designer) dialog, that contains a part where a file has to be selected.

Now, I know QFileDialog exists, and I can program something that d

3条回答
  •  你的背包
    2021-02-07 02:48

    QFileDialog exists in QtGui. At least in my version 4.4 and probably much earlier too. I think the reason it is not in Designer is because it opens its own window instead of being a widget to place on another window.

    The documentation from QTDesigner could be better and at least hint of its existence.

    Instantiate it and run the show command. It comes right up and defaults to /.

    import QtGui
    self.fileDialog = QtGui.QFileDialog(self)
    self.fileDialog.show()
    

提交回复
热议问题