[Qt-interest] QShortcut help

Soumen Banerjee soumen08 at gmail.com
Sun Dec 19 05:45:00 CET 2010


Hi,
Im my app, Im using the following QShortcut-
in mainwindow.h
QShortcut *shortcut_new;
in mainwindow.cpp

shortcut_new = new QShortcut(this);
shortcut_new->setKey(QKeySequence("Ctrl + N"));
connect(shortcut_new,SIGNAL(activated()),this,SLOT(new_instance()));

where new_instance at this point should just print "new".
The app builds fine, but when I press Ctrl+N, nothing is printed. What
could be the problem?
Regards,
Soumen



More information about the Qt-interest-old mailing list