ePharaoh
22nd March 2006, 07:53
I have declared a slot as follows,
class Shell {
Q_OBJECT
public slots:
void treeExpanded (const QModelIndex &index);
}
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,
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
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...
class Shell {
Q_OBJECT
public slots:
void treeExpanded (const QModelIndex &index);
}
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,
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
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...