PDA

View Full Version : How to get to Action Editor?



FrankS
16th March 2016, 06:08
Hello,

I'm returning to C++ programming and have chosen Qt.
For the very beginning I try to write a simple Window application with a menu.
Designer works fine.
The tuto says to chose Action from the Tools menu to open the action editor.

There is no Action entry in the Tools menu. How to get the Action editor to get opened?
Now I have a window with a menu and stuck ...

Qt Creator 3.6.0 on Linux x86_64 (Ubuntu 14.4)

Thanks a lot

anda_skoa
16th March 2016, 08:35
You can just click into the menu to create a new action.

Also the action editor should be visible at the bottom by default.

Cheers,
_

FrankS
16th March 2016, 21:31
OKI, found it :)
try'n error in the IDE did it. :D

Now I have an action ... and have to find out how the action make to act.

I swear - I'll never try to read a documentation any more.
it's fun to get from an totally outdated documentation to the reality :D

... but the examples are overwhelming (unusable for a IDE newbie - but overwhelming)

I'll come back - not in the newbie section then.

Bye for now
Cheers
Frank

Added after 17 minutes:

Yepp. I've seen this (see the reply to myself ;) )
Click into MY menu does nothing - with double click I can change the text of the menu entry.

F4 (how I found by accident on Google) makes silly things I still don't know what this is)

I'll figure this out.

... the getting started ... Multi platform examples (WOW!). Andoroid skins (WOW!!) 3D actions (WOW!!!!!)
:/ but making a plain window with one menu action which acts (has some code connected to this will require a lot of try'n error :D )

Don't get me wrong
I like the look if the IDE and I think it is in fact worth of giving it a try.

Cheers
Frank

anda_skoa
16th March 2016, 22:33
Now I have an action ... and have to find out how the action make to act.

QAction has a triggered() signal that gets emitted when the action is activated (independent of whether it is activated by menu click, short cut, etc).

Cheers,
_

wysota
16th March 2016, 22:40
Now I have an action ... and have to find out how the action make to act.
Connect a slot to the action's triggered() signal and put the code you want executed in that slot.


I swear - I'll never try to read a documentation any more.
That's probably not the best idea. Don't confuse some 3rd party tutorial with official docs.


Click into MY menu does nothing - with double click I can change the text of the menu entry.
The menu entry is just one incarnation of the action you created. You need to connect the action's triggered() signal to a physical piece of code. Either a predefined slot (e.g. using signal-slot connection editor in Designer) or in the C++ code implementing the widget that uses the Designer form.


F4 (how I found by accident on Google) makes silly things I still don't know what this is)
No, "F4" is not what you want. "F2" would be closer but blindly trying things will not get you far.


:/ but making a plain window with one menu action which acts (has some code connected to this will require a lot of try'n error :D )
http://doc.qt.io/qtcreator/creator-writing-program.html
Application Example