PDA

View Full Version : QToolBar double click



sdfisher
27th September 2007, 20:43
I'd like to detect a double click in a QToolBar. Basically, I'm using a QToolBar/QActionGroup/QAction combination to create graphical tabs in my application. I'd like to perform an action when one of these "tabs" is double clicked.

Any ideas?

marcel
5th October 2007, 12:43
Why not use tool buttons instead of actions?
That way you can easily detect when they are double clicked.

But if you really want to use QActions then you can intercept double clicks on the toolbar and see if a QAction is at that position, by connecting to its triggered signal.

jpn
6th October 2007, 10:38
Toolbar actions are tool buttons. To me it sounds weird to have double clickable buttons. Isn't it a bit unintuitive?

marcel
6th October 2007, 10:46
I suggested a tool button because, being a QAbstractButton, he could easily reimplement mouse events for it and detect double clicks.



To me it sounds weird to have double clickable buttons. Isn't it a bit unintuitive?

Who knows...?
Maybe he paints them differently so they don't have a "pushed" state and give the impression of a tab.

Maybe plain, old widgets are better.

sdfisher
8th October 2007, 06:19
I suggested a tool button because, being a QAbstractButton, he could easily reimplement mouse events for it and detect double clicks.


Who knows...?
Maybe he paints them differently so they don't have a "pushed" state and give the impression of a tab.

Maybe plain, old widgets are better.

I don't actually paint them differently. There's a particular combination (I forget exactly what it is) that looks almost like Firefox's icon tabs (well, a few versions ago, I've lost track of what it looks like on every platform now).