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. QtQuick Application cursh ,When open the MacOS system virtual keyboard.
Forum Updated to NodeBB v4.3 + New Features

QtQuick Application cursh ,When open the MacOS system virtual keyboard.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qt5.15.2qml dynamicmacosqtquick
3 Posts 2 Posters 367 Views 1 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
    cb__
    wrote on 24 May 2024, 03:28 last edited by
    #1

    Hi,
    When I testing my QtQuick Application on MacOS, I found a weird crash issue.

    I open the MacOS system virtual keyboard and my qml Window was try to creat a modal Dialog dynamically, when I close and call destroy() the modal Dialog Window, my application was crashed. My Qt version is 5.15.2

    e57f0240-4b08-4989-82e8-8fe09ecdda0b-image.png

    691149b5-2e3e-4db8-91bf-b76a91ce2c9e-企业微信截图_17161925381095.png
    here is my code example:

    main.qml
    Window{
        id: mainWindow
        flags: Qt.FramelessWindowHint | Qt.Window
        Button{
            onClicked:{
                var component = Qt.createComponent("DialogWindow.qml");
                var win = component.createObject(mainWindow);
                win.show();
            }
        }
    }
    
    DialogWindow.qml
    Window{
        id: dialogWindow
        modality: Qt.ApplicationModal
        flags: Qt.FramelessWindowHint | Qt.Dialog
        Button{
            onClicked:{
                dialogWindow.close();
                dialogWindow.destroy();
            }
        }
    }
    
    1 Reply Last reply
    0
    • A Offline
      A Offline
      Axel Spoerl
      Moderators
      wrote on 26 May 2024, 09:35 last edited by
      #2

      I am just guessing.
      On the one hand, the stack trace doesn’t show a crash in a Qt library. On the other hand, the button destroys its parent in a slot. That’s brave. I’d try to move the destruction elsewhere, or omit it just to see if that’s the issue.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cb__
        wrote on 28 May 2024, 01:59 last edited by
        #3

        Thanks for your reply.
        One thing to note is that if I hadn't turned on the virtual keyboard on MacOS, this Dialog destruction wouldn't have caused the program to crash.

        1 Reply Last reply
        0

        2/3

        26 May 2024, 09:35

        • Login

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