[Qt-interest] Linking toolbar/menu QAction to widget QAction

Mildred Ki'Lya ml.mildred593 at gmail.com
Fri May 15 04:09:47 CEST 2009


Hi,

Is there a way to link QActions together?

Let me explain.

We have a toolbar with various actions, and the main window contains 
many different widgets (derived from QTableView) organized in tabs. I 
would like the toolbar actions to redirect to the similar action on the 
focused widget.

For now, each toolbar action triggers a slot in the main window that 
lookup the focused widget and call the appropriate method. But when the 
action becomes unavailable for the focused widget, or when there are no 
focused widgets, I would like to disable the toolbar actions as well.

I think the best approach would be to link the toolbar actions to the 
actions of the current focused widget. So, if there is no focused widget 
or if the widget's action is disabled, the toolbar action becomes 
unavailable.

Do you know a way to achieve that?

Thanks.

Mildred


-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk:<mildred at jabber.fr>
│ Website:<http://ki.lya.online.fr>            GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B




More information about the Qt-interest-old mailing list