PDA

View Full Version : QCloseEvent



scrasun
5th July 2009, 10:20
I am trying to use 'QCloseEvent', but get this error:

board.cpp:180: error: invalid use of incomplete type ‘struct QCloseEvent’
/usr/include/qt4/QtGui/qwidget.h:83: error: forward declaration of ‘struct QCloseEvent’

This is the code I am using ( in board.cpp):

void Board::closeEvent(QCloseEvent *event){
//some code
event->accept();
//some more code
}

in board.h I have:

protected:
void closeEvent(QCloseEvent *event);

Does anyone know what I have done wrong?

Any help is appreciated.

Lykurg
5th July 2009, 10:37
use
#include <QCloseEvent>in your code.

scrasun
5th July 2009, 10:44
Thanks, that works fine.