Qt Application quits after slot of QAction gets triggered
I've created an action for my QMenu and connected it to a slo开发者_运维百科t "action1" like this
connect(action, SIGNAL(triggered()), this, SLOT(action1()));
but when i execute this code, my application quits.
How to solve this?
Could be a multitude of things, but for starters:
- Is the "triggered" signal also connected to another slot? e.g. the "quit" slot of the application?
- Does "action1" close the window? I seem to remember that Qt by default quits the application when the last window is closed.
精彩评论