Iam new in Qt and I have problem how to pass QAction as parameter like this code:
connect(fileToolBarAct, SIGNAL(toggled(bool)), this, SLOT(ToggleBar(fileToolBarAct));
And this my slots function:
void MainWindow::ToggleBar(QAction& what)
{
what.isCheckable();
}
QObject::connectdoesn't work like this. You can not pass objects toSIGNALandSLOTmacros.SIGNALandSLOTmacros should take function signatures. In additionthe signature of a signal must match the signature of the receiving slotas described in theQtdocumentation.I see that you lack in understanding the signals and slots mechanism and I recommend you read the Qt Signals and Slots documentation for more info. Reading the
Qt Signals and Slotsdocumentation will clear everything for you.