Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]How to set the default button of a MessageDialog in QML?
Qt 6.12 LTS is out! See what's new in the release blog

[SOLVED]How to set the default button of a MessageDialog in QML?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k Views 2 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    The default button is "Yes", but I want to set the button "No" as the default button.

    How to do it?

    p3c0P 1 Reply Last reply
    0
    • ? A Former User

      The default button is "Yes", but I want to set the button "No" as the default button.

      How to do it?

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @CoderJeff,
      I guess currently there's no way to do so in QML. You can create your own Dialog, add Buttons to it and set focus to the required one.

      157

      ? 1 Reply Last reply
      0
      • p3c0P p3c0

        Hi @CoderJeff,
        I guess currently there's no way to do so in QML. You can create your own Dialog, add Buttons to it and set focus to the required one.

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Hi @p3c0,

        Thank you stop me looking for the solution in time. I have spent so much time on this problem.

        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
        • Unsolved