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. Crash using qml FileDialog
Forum Update on Monday, May 27th 2025

Crash using qml FileDialog

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.1k 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.
  • L Offline
    L Offline
    Lionel21190
    wrote on 4 Apr 2019, 09:02 last edited by
    #1

    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 1 Reply Last reply 4 Apr 2019, 09:04
    0
    • L Lionel21190
      4 Apr 2019, 09:02

      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 Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 4 Apr 2019, 09:04 last edited by
      #2

      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


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

      1 Reply Last reply
      2
      • L Offline
        L Offline
        Lionel21190
        wrote on 5 Apr 2019, 08:46 last edited by
        #3

        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
        0

        1/3

        4 Apr 2019, 09:02

        • Login

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