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. Is MessageDialog broken in Qt 6.5?
Qt 6.11 is out! See what's new in the release blog

Is MessageDialog broken in Qt 6.5?

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

    I'm trying to use a MessageDialog in response to the user clicking a button e.g. User clicks Export button and a message dialog is presented telling the user that the operation has been completed.

    This works the first time you open the dialog but all subsequent open() calls don't open the dialog. What's stranger is that if the dialog is instantiated in an item that got pushed onto a StackView, popping that item off the stack and pushing it back onto the stack sort of clears it out and it works again but only once. If the dialog is instantiated in the application's main Window, it only works once and nothing will make it reappear.

    Going deeper, I never see onAccepted code getting executed. If I have a console.log output in onVisibilityChanged, I only see that executed once when the dialog opens.

    It's as though the dialog got deleted somehow. Anyone have any ideas?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      RogueWarrior
      wrote on last edited by
      #2

      Okay, after reading through the source code for qquickmessagedialog.cpp, I saw a use-case for supporting different buttons. I added the following:

              onButtonClicked: function (button, role) {
                  switch (button) {
                  case MessageDialog.Ok:
                      exportDialog.close()
                      break;
                  }
              }
      
      

      Apparently, without this and explicitly telling the dialog to close, you can't reopen the message dialog. Seems goofy to me.

      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