Hover Problem with QToolBar/QAction



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

    The strange thing is that it only does this if I close my dialog window using one of the OK/Cancel buttons, but if I click the [X] 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.



  • Could you post a zip with the code?



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

    I have some code, but first here's an image of a toolbar with all buttons in their active state. Below that I have a video showing the problem. You can see that the toolbuttons remain locked until I click the [X] 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. :)



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

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.