Unused parameters in slots
I have declared a slot as follows,
Code:
class Shell {
Q_OBJECT
public slots:
}
Now, I don't have a use for the index parameter. Gcc gives a warning in this case, saying index is unused. (I try to keep my code free of warnings :rolleyes: )
Now, if I don't want that warning I can say,
Code:
class Shell {
Q_OBJECT
public slots:
void treeExpanded
(__attribute__
((unused
)) const QModelIndex &index
);
}
The warning goes off but the moc generated bad code. I get a compile error for the moc_Shell.cpp
Quote:
moc_Shell.cpp: In member function `virtual int
Shell::qt_metacall(QMetaObject::Call, int, void**)':
moc_Shell.cpp:78: error: parse error before `*' token
Is there any solution to this? Thanks...
Re: Unused parameters in slots
Yes ;)
Code:
//// *.h
//// *.cpp
{
}
Re: Unused parameters in slots
Re: Unused parameters in slots
Thanks, zlatko; it worked.
I ain't familiar with the quirks of C++.