PDA

View Full Version : ShowMaximized() by a hot-key



araglin
29th January 2009, 14:04
Hello!
Please help!
here is code, compiled ok but don't work...

I insert it in constructor of mainWindow:


QAction *a = new QAction(this);
a->setShortcut(QKeySequence(Qt::Key_F11));
a->setShortcutContext(Qt::ApplicationShortcut);
connect(a, SIGNAL(triggered() ), this, SLOT(showMaximized() ) );


Thanks!

jpn
29th January 2009, 14:06
Did you add the action somewhere? If you're not going to add it to a menu for example, you might want to switch to QShortcut instead.

araglin
29th January 2009, 14:27
No, I wanted to made hidden undocumented command. So, I'll try QShortcut, thanks!

araglin
29th January 2009, 14:31
Wow, it works now :))
Thank you very much!