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. [Solved] Losing Menubar Shortcuts after executing QDialog corresponding to loss of ActiveWindow [by updating from 5.0.1 to 5.2.1]
QtWS25 Last Chance

[Solved] Losing Menubar Shortcuts after executing QDialog corresponding to loss of ActiveWindow [by updating from 5.0.1 to 5.2.1]

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.6k 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.
  • S Offline
    S Offline
    StridaHD
    wrote on last edited by
    #1

    Dear all,

    Since changing from Qt4 to Qt5 the shortcuts of my MainWindow menubar did only work on some kind of a random basis. Looking into the problem revealed, that they stop working after calling a(ny) QDialog with exec(). The shortcuts resumed work after (mouse)clicking on the menubar.

    I can see that keystrokes of the shortcuts are passed through the keyEventPressed of my MainWindow at any time, but they only work when QApplication::activeWindow() returns a valid pointer (to the MainWindow).

    So my quick and dirty fix was to put "QApplication::setActiveWindow( this );" into MainWindow::keyPressEvent. This kind of resurrects the shortcuts, when they are pressed once or twice, but this is rather ugly.

    Therefore I would like to know, how to fix this issue properly?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Can you also post which OS you are running on and the exact Qt version ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        StridaHD
        wrote on last edited by
        #3

        Qt 5.0.1 as provided with Ubuntu 13.10.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You should consider using the latest version, currently 5.2.1, there's been a lot of bug fixes done since 5.0.1

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            StridaHD
            wrote on last edited by
            #5

            Installing and compiling with 5.2.1 did solve the problem of loosing focus – thanks for the advice! I really did not expect 5.0.1 to be so buggy.

            However, the look of the menubar has changed. Before it behaved like any other menu and was moved to the top bar of the Unity desktop - identical to many other applications. After the upgrade the menubar stays below the top bar of the application's windows like in traditional window managers. Therefore I am curious how to change this behavior?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              That would be more a question for the Ubuntu's developers. IIRC they have patched Qt to make it work with Unity. These might be available through their servers

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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