Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Use a QFileDialog as Widget

    Language Bindings
    2
    3
    1393
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hizoka last edited by

      Hi,

      I would like use a QFileDialog as Widget in my software.

      So I do :
      @SelectFile = QFileDialog(self, Qt.Widget)
      self.ui.output_widget.addWidget(SelectFile)@

      That work but that create a widow too :
      !http://hizo.fr/img/qt/QFileDialog.png!

      How to hide the other window ?

      Thank you and sorry for my english.

      Kubuntu 14.10 64bits – Python 3.4.2 – Qt 4.8.6

      1 Reply Last reply Reply Quote 0
      • H
        hizoka last edited by

        I find with help :
        @ self.SelectFile = QFileDialog(self.ui.widget, Qt.Widget)
        self.SelectFile.setObjectName("SelectFile")
        self.SelectFile.setOption(QFileDialog.DontUseNativeDialog)
        self.SelectFile.installEventFilter(self)
        self.SelectFile.done = self.doneNo
        self.SelectFile.currentChanged.connect(self.doneNo)
        self.ui.output_widget.addWidget(self.SelectFile)

        def doneNo(self, Value):
            if isinstance(Value, str):
                print(Value)@
        

        So, I understand, it's not the normal use but how to do like QFileDialog ?
        I want files list and folder system move.

        it would lack in Qt?

        1 Reply Last reply Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          No it doesn't lack, you have all the building blocks to do it yourself. Have a look at QTreeView, QFileSystemModel etc.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply Reply Quote 0
          • First post
            Last post