This should work without a cast at all, the conversion from derived to base is implicit.
A likely cause of this error would be that you only have a forward declaration of QCell
visible in that compilation unit, which would trigger this error. You need to have the complete class declaration visible for the compiler to know whether that conversion is legal or not.
Example:
#include <QWidget>
class QCell;
int main(int argc, char **argv)
{
QCell *w = 0;
QWidget *q = static_cast<QWidget*>(w);
}
main.cpp: In function ‘int main(int, char**)’:
main.cpp:8:41: error: invalid static_cast from type ‘QCell*’ to type ‘QWidget*’