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. System QML FileDialog is broken and not fully native
QtWS25 Last Chance

System QML FileDialog is broken and not fully native

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 1.3k 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.
  • K Offline
    K Offline
    Kobid
    wrote on last edited by Kobid
    #1

    Hi. I'm analyzing demo "Qt Quick System Dialog Examples" and trying implement same file dialog in my Qt Quick Controls 2 app. Problem is that my dialog looks totally different and kind of broken. Here is correct dialog from demo:
    0_1562932843856_Screenshot_20190712_135230.png
    And here is from my app. Side bar doesn't have icons, also selection in this side bar is not visible (but works), icons looks weird, translation is in English and in console output I see "Model size of -8 is less than 0" when navigating
    0_1562932970845_Screenshot_20190712_135021.png
    I'm looking over demo sources and can't find what is responsible for that. Demo is using Fussion style but event if my app use it too, then result is the same. This my code:

    import QtQuick.Dialogs 1.1
    
        FileDialog {
            id: fileDialog
            modality: Qt.WindowModal
            title: "Select music file"
            selectMultiple: true
            selectFolder: false
            selectExisting: true
            nameFilters: [ "Music files (*.mp3 *.ogg *.flac *.mp4)", "All files (*)" ]
            selectedNameFilter: "Music files (*.mp3 *.ogg *.flac *.mp4)"
            onAccepted: {
                console.log("Accepted: " + fileUrls)
            }
            onRejected: { console.log("Rejected") }
    

    KDE Neon 5.16
    Qt 5.13

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kobid
      wrote on last edited by
      #2

      Found out what is a reason. I have to use:

      QApplication app(argc, argv);
      

      ... instead of:

      QGuiApplication app(argc, argv);
      

      But this require QT += widgets so libQt5Gui.so dependency for my app. Since I'm writting pure QML UI app, I would preffer to stay with DefaultFileDialog which is QML based but still two issues left:

      1. Why sidebar selection doesn't work
      2. Why I'm getting "Model size of -27 is less than 0" in console output
      1 Reply Last reply
      1

      • Login

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