Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Use a QFileDialog as Widget
Forum Updated to NodeBB v4.3 + New Features

Use a QFileDialog as Widget

Scheduled Pinned Locked Moved Language Bindings
3 Posts 2 Posters 1.6k Views 1 Watching
  • 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 Offline
    H Offline
    hizoka
    wrote on last edited by
    #1

    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
    0
    • H Offline
      H Offline
      hizoka
      wrote on last edited by
      #2

      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
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved