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 file does not show
Forum Update on Monday, May 27th 2025

FileDialog file does not show

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

    Hello, I made a program with a lot of visual element. When I clicked on my menu item "OpenImage", I add this qml using QQmlApplicationEngine load function. Depending on how much UI element I have on my view, the files of FileDialog does not show.

    import QtQuick 2.2
    import QtQuick.Dialogs 1.0
    Item {
        FileDialog {
            id: fileDialog
            title: "Please choose a file"
    
            folder: shortcuts.home
    
            nameFilters: [ "Image files (*.jpg *.png)", "All files (*)" ]
    
            modality: Qt.ApplicationModal
    
            onAccepted: {
                console.log("You chose: " + fileDialog.fileUrls)
                Qt.quit()
            }
            onRejected: {
                console.log("Canceled")
                Qt.quit()
            }
            Component.onCompleted: visible = true
        }
    }
    
    1 Reply Last reply
    0
    • YunusY Offline
      YunusY Offline
      Yunus
      wrote on last edited by
      #2

      Hi @PixyWitchy Did you call filedialog using fileDialog.open(). Why did you add Qt.quit() parts and modality?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        PixyWitchy
        wrote on last edited by PixyWitchy
        #3

        @Yunus The modality is to block everything in background (c++) during the time I choose the file. Qt.quit() it's just during the testing time of my file dialog. I didn't open it with fileDialog.open() because it is visible when the component is complete and like I said I added this qml at runtime when I click on OpenImage via the load function of QQmlApplicationEngine

        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