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::connect
doesn't work like this. You can not pass objects toSIGNAL
andSLOT
macros.SIGNAL
andSLOT
macros should take function signatures. In additionthe signature of a signal must match the signature of the receiving slot
as described in theQt
documentation.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 Slots
documentation will clear everything for you.