Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Menu QAction double triggered after modal dialog closed

Menu QAction double triggered after modal dialog closed

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 320 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.
  • divergerD Offline
    divergerD Offline
    diverger
    wrote on last edited by
    #1

    Hi,

    I tried newest Qt6.8 with MSVC2022 64-bit. Use a menu QAction trigger to open a modal dialog, when the dialog is closed, it will open again, then I need to close it again to actually close it. I traced the code, the QAction slot is invoked twice. Why?

    Thanks.

    Christian EhrlicherC 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      @diverger said in Menu QAction double triggered after modal dialog closed:

      the QAction slot is invoked twice. Why?

      How should we know? Maybe you did something wrong, maybe it's a Qt bug (which I doubt).
      Please provide a minimal, compilable example or at least the relevant parts of your code.

      divergerD Offline
      divergerD Offline
      diverger
      wrote on last edited by
      #4

      @Christian-Ehrlicher I omited that Qt may "automatically" connect the signal/slot with slot names. So, besides the one Qt registered for me automatically, I registered another one explicitly. :)

      1 Reply Last reply
      0
      • divergerD diverger

        Hi,

        I tried newest Qt6.8 with MSVC2022 64-bit. Use a menu QAction trigger to open a modal dialog, when the dialog is closed, it will open again, then I need to close it again to actually close it. I traced the code, the QAction slot is invoked twice. Why?

        Thanks.

        Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @diverger said in Menu QAction double triggered after modal dialog closed:

        the QAction slot is invoked twice. Why?

        How should we know? Maybe you did something wrong, maybe it's a Qt bug (which I doubt).
        Please provide a minimal, compilable example or at least the relevant parts of your code.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        divergerD 1 Reply Last reply
        0
        • H Offline
          H Offline
          Helmut.Jakoby
          wrote on last edited by
          #3

          The first thing I would try to do is find out where the slot that opens the dialog is being called from. So set a breakpoint and see where the slot is being called from.

          https://www.globalobjects.de/

          1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @diverger said in Menu QAction double triggered after modal dialog closed:

            the QAction slot is invoked twice. Why?

            How should we know? Maybe you did something wrong, maybe it's a Qt bug (which I doubt).
            Please provide a minimal, compilable example or at least the relevant parts of your code.

            divergerD Offline
            divergerD Offline
            diverger
            wrote on last edited by
            #4

            @Christian-Ehrlicher I omited that Qt may "automatically" connect the signal/slot with slot names. So, besides the one Qt registered for me automatically, I registered another one explicitly. :)

            1 Reply Last reply
            0
            • divergerD diverger has marked this topic as solved on
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #5

              Simply rename the slots to something meaningful to disable this stupid auto connection feature.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              1

              • Login

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