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. Hover Problem with QToolBar/QAction
Forum Updated to NodeBB v4.3 + New Features

Hover Problem with QToolBar/QAction

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 4.1k 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.
  • U Offline
    U Offline
    undef_sense_of_humor
    wrote on last edited by
    #1

    Hi there,

    I've got a QToolbar with some buttons on it. Clicking one of them shows a custom modal window of mine, which was derived from QDialog and shown by calling exec(). This window has two buttons - OK & Cancel. The triggers of both call accept() and reject() on the Window respectively.

    The problem is that when I click the toolbutton and then close the window - and when I then move the mouse over the toolbar, ALL the buttons show their "hovered/activate" state simultaneously and stay that way. However, showing another/different child window in the application seems to then allow the toolbutton states to clear.

    in the title bar, everything's fine.

    Any ideas any one? Cos this is driving me mental.

    Cheers

    PS - Am running QT4.7 on Windows Vista.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      Could you post a zip with the code?

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • U Offline
        U Offline
        undef_sense_of_humor
        wrote on last edited by
        #3

        Could you post a zip with the code?

        Yup. I would really appreciate help on this because it's still a problem and I don't know how go about solving it.

        button on the window. It is really weird.

        !http://www.bigangrydog.com/scratch/toolbar_bug.jpg(QToolbar/QToolbutton bug)!

        "VIDEO OF BUG":http://www.bigangrydog.com/scratch/toolbar_bug.mp4

        I was at a loss to decide what code to post, as I don't want to end up posting the entire app. But here's the cpp code to the file dialog window in the video, as I suspect that it is doing some which is preventing the toolbar from receiving an event. (Note that when a toolbutton press displays a QMessageBox window or other windows of mine, the problem does not happen - it's just with this file dialog.)

        My custom window is derived from QDialog and has it's own execute() method, which simply calls QDialog::exec(). I have overridden the showEvent() and hideEvent() methods, but have tried disabling this methods, and the problem still remains. The window calls on QFileSystemModel and QTreeView etc.

        In terms of the code to show the window, there's nothing special. There's a trigger-slot method which creates the dialog and then calls it's execute() method. The icons in the buttons are loaded at runtime rather than being in the form.

        Thanks for getting back to me. Hope someone can help. :)

        1 Reply Last reply
        0
        • U Offline
          U Offline
          undef_sense_of_humor
          wrote on last edited by
          #4

          PS - almost forgot to give the code. It's here:

          "ZIP FILE":http://www.bigangrydog.com/scratch/file_selector.zip

          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