Qt Forum

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

    Solved Crash using qml FileDialog

    QML and Qt Quick
    2
    3
    717
    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.
    • L
      Lionel21190 last edited by

      Hi everyone,

      I am facing a weird issue.

      Under ubuntu 18.04 and Qt 5.12.2, when i open FileDialog, my application crash.

      Here is a simple example :

      import QtQuick 2.7
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.1
      import QtQuick.Controls.Material 2.1
      import QtQuick.Dialogs 1.2
      
      Item {
          id:item1
      
      
          FileDialog {
              id: fD
              title: "Test Dialog"
      
              folder: shortcuts.home
              onAccepted: {
                  console.log("You chose: " + fileDialog.fileUrls)
              }
              onRejected: {
                  console.log("Canceled")
              }
          }
      
          Component.onCompleted:
          {
              fD.open();
          }
      
      }
      

      It's a simple example, normally i use a button to trigger the opening.

      Here is the stack trace i got , when running under an IDE:

      __Gl_raise
      __Gl_abort
      __libc_message
      malloc_printerr
      munmap_chunk
      _Gl__libc_free
      png_free
      png_read_destroy
      png_destroy_read_struct
      

      From a terminal i only got :

      munmap_chunk(): invalid pointer
      Abandon (core dumped)
      

      Thank you in advance, if you have any idea.

      J.Hilk 1 Reply Last reply Reply Quote 0
      • J.Hilk
        J.Hilk Moderators @Lionel21190 last edited by

        HI @Lionel21190 and welcome

        I'm not sure but shouldn't this

        fileDialog.fileUrls

        be

        fD.fileUrls

        ?

        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct

        Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply Reply Quote 2
        • L
          Lionel21190 last edited by

          Hi thank you !

          Well you are right, this is a mistake.

          I found why te crash appear, it's not because of Qt.

          It's a conflict, with a static version libpng which i use and Qt's libpng (dynamic).

          I use a third party library which need libpng, now i use the same as Qt and it work fine.

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