PDA

View Full Version : I failed to catch QMenu triggered signal, is it even possible?



saugumas
29th February 2008, 20:59
Signals are only accesible through menu bar sub-menu, I am creating little program and I can't do one-click "About" button on Menu Bar without sub-menus.

Where problem could be?

It is working:

void MainWindowImpl::on_actionCh_triggered()
{
qDebug("just for test...");
}

Non-working:

void MainWindowImpl::on_menuChh_triggered()
{
qDebug("just for test...");
}

QAction inherits QMenu, and triggered signal exists for both classes.

wysota
29th February 2008, 23:04
QMenuBar inherits QWidget and not QMenu thus it doesn't emit anything when a menu is chosen (only when an action from a menu is).