Hello,
I am trying to override CloseEvent but i am getting the following error
invalid use of incomplete type 'struct QCloseEvent'
forward declaration of 'struct QCloseEvent'
Here is my code:
fullscreendial.h
#ifndef FULLSCREENDIAL_H
#define FULLSCREENDIAL_H
#include <QDialog>
namespace Ui {
class fullScreenDial;
}
class fullScreenDial
: public QDialog{
Q_OBJECT
public:
explicit fullScreenDial
(QWidget *parent
= 0);
~fullScreenDial();
private:
Ui::fullScreenDial *ui;
protected:
void reject();
};
#endif // FULLSCREENDIAL_H
#ifndef FULLSCREENDIAL_H
#define FULLSCREENDIAL_H
#include <QDialog>
namespace Ui {
class fullScreenDial;
}
class fullScreenDial : public QDialog
{
Q_OBJECT
public:
explicit fullScreenDial(QWidget *parent = 0);
~fullScreenDial();
private:
Ui::fullScreenDial *ui;
protected:
void closeEvent(QCloseEvent *);
void reject();
};
#endif // FULLSCREENDIAL_H
To copy to clipboard, switch view to plain text mode
fullscreendial.cpp
#include "fullscreendial.h"
#include "ui_fullscreendial.h"
fullScreenDial
::fullScreenDial(QWidget *parent
) : ui(new Ui::fullScreenDial)
{
ui->setupUi(this);
// int x=1;
}
fullScreenDial::~fullScreenDial()
{
delete ui;
}
void fullScreenDial
::closeEvent( QCloseEvent * event
) {
event->ignore();
}
void fullScreenDial::reject()
{
}
#include "fullscreendial.h"
#include "ui_fullscreendial.h"
fullScreenDial::fullScreenDial(QWidget *parent) :
QDialog(parent),
ui(new Ui::fullScreenDial)
{
ui->setupUi(this);
// int x=1;
}
fullScreenDial::~fullScreenDial()
{
delete ui;
}
void fullScreenDial::closeEvent( QCloseEvent * event) {
event->ignore();
}
void fullScreenDial::reject()
{
}
To copy to clipboard, switch view to plain text mode
Can you please let me know what I am doing wrong ?
Many thanks
Bookmarks