Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. FileDialog not working anymore
Forum Updated to NodeBB v4.3 + New Features

FileDialog not working anymore

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 294 Views 2 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.
  • C Offline
    C Offline
    Creaperdown
    wrote on last edited by
    #1

    Hey, I am using FolderDialog and FileDialog from Qt.labs.platform, but calling .open() on them, does not open them anymore. It used to work in Qt5, but doesn't with Qt6.

    This is how I declare them:

    FileDialog {
            id: importFilesDialog
            acceptLabel: "Import"
            fileMode: FileDialog.FileMode.OpenFiles
            folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
    }
    

    Does someone have an idea why this doesn't work.
    (I am on a KDE distro if this plays a role.)

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Creaperdown
      wrote on last edited by
      #3

      I have fixed it by linking against the widgets module and changing my QGuiApplication to QApplication

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gustavo Serra
        wrote on last edited by Gustavo Serra
        #2

        @Creaperdown
        Your code worked for me, I am using Mint Xfce.
        However, I had to change FileDialog.FileMode.OpenFiles to FileDialog.OpenFiles, because I got a warning.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Creaperdown
          wrote on last edited by
          #3

          I have fixed it by linking against the widgets module and changing my QGuiApplication to QApplication

          1 Reply Last reply
          0
          • C Creaperdown has marked this topic as solved on

          • Login

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