I have declared a slot as follows,
Qt Code:
  1. class Shell {
  2. Q_OBJECT
  3. public slots:
  4. void treeExpanded (const QModelIndex &index);
  5. }
To copy to clipboard, switch view to plain text mode 

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 )

Now, if I don't want that warning I can say,
Qt Code:
  1. class Shell {
  2. Q_OBJECT
  3. public slots:
  4. void treeExpanded (__attribute__((unused)) const QModelIndex &index);
  5. }
To copy to clipboard, switch view to plain text mode 

The warning goes off but the moc generated bad code. I get a compile error for the moc_Shell.cpp
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...