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. Can't close a QMenu opened through dbus by double clicking in another app
Forum Updated to NodeBB v4.3 + New Features

Can't close a QMenu opened through dbus by double clicking in another app

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

    I have 2 applications, 1 has a QMenu that can be opened through DBus ("menu" app) and the other can open that menu by double clicking ("clicking" app).

    When I open the menu by double clicking in the "clicking" app the menu doesn't close when I click outside of the menu.

    The menu closes when:

    • opened through qdbus in the terminal
    • opened through single click in "clicking" app
    • pressing Esc key

    If the menu belongs to the same app then it closes.

    Here are the 2 applications

    https://gitlab.com/fbg/qmenu-dbus-test

    Expected Result:

    1. open both apps
    2. double click "clicking" app
    3. menu from "menu" app opens
    4. click outside menu
    5. menu closes

    Actual Result:

    1-4 same as above

    1. menu doesn't close, unless I click in "menu" app's window or press the Esc key

    question on stackoverflow

    fbg13F 1 Reply Last reply
    0
    • fbg13F fbg13

      I have 2 applications, 1 has a QMenu that can be opened through DBus ("menu" app) and the other can open that menu by double clicking ("clicking" app).

      When I open the menu by double clicking in the "clicking" app the menu doesn't close when I click outside of the menu.

      The menu closes when:

      • opened through qdbus in the terminal
      • opened through single click in "clicking" app
      • pressing Esc key

      If the menu belongs to the same app then it closes.

      Here are the 2 applications

      https://gitlab.com/fbg/qmenu-dbus-test

      Expected Result:

      1. open both apps
      2. double click "clicking" app
      3. menu from "menu" app opens
      4. click outside menu
      5. menu closes

      Actual Result:

      1-4 same as above

      1. menu doesn't close, unless I click in "menu" app's window or press the Esc key

      question on stackoverflow

      fbg13F Offline
      fbg13F Offline
      fbg13
      wrote on last edited by
      #2

      This happens in Solus 4.0 Plasma

      • KDE Plasma Version: 5.15.3
      • KDE Frameworks Version: 5.56.0
      • Qt Version: 5.12.2

      In lubuntu (lxqt) the menu shows for a split second and then closes.

      A simpler way to test this is to use qdbusviewer.

      1. build and run testqmenudbus2
      2. open qdbusviewer
      3. find the service org.TestQMenu
      4. find the method showMenu in TestQMenu.local.MainWindow
      5. double click method
      1 Reply Last reply
      0
      • fbg13F Offline
        fbg13F Offline
        fbg13
        wrote on last edited by
        #3

        Solved it by adding

        QThread::msleep(150);
        

        to the dbus method before showing the menu.

        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