PDA

View Full Version : [QT] MenuBar



iVo1d
18th August 2010, 13:31
[Qt] MenuBar

Hey guys! I coded in Qt now a pretty long time.. But i never learned how the menu bar works.. i searched on google but didn't understand that much..

How can i make so "When the user presses on the menu and choose for example "New file" and it will send signal(slot) to a function.. I tryed with signal editor but i cant get it working =/

http://data.fuskbugg.se/skogsturken/------------------------------------------------------------------Untitled.png


Can anyone help me get this working? Thanks :blackhat:

Zlatomir
18th August 2010, 13:40
Qt simplifies the programming of menus and toolbars through its action concept. An action is an item that can be added to any number of menus and toolbars.
Creating menus and toolbars in Qt involves these steps:
1) Create and set up the actions. (you connect the action triggered() signal with the slot that you want to run)
2) Create menus and populate them with the actions.

Documentation (http://doc.qt.nokia.com/4.6/qmenubar.html)

iVo1d
18th August 2010, 14:14
Thanks i got it working now! :)