saman_artorious
11th July 2012, 10:47
why do I receive error when I do not #include for example QToolButton , but rather go for its forward class declaration?
#ifndef PLAYVIDEO_H
#define PLAYVIDEO_H
#include <QWidget>
class QToolButton;
class QGridLayout;
class QHBoxLayout;
class QVBoxLayout;
class PlayVideo : public QWidget
{
Q_OBJECT
public:
PlayVideo(QWidget *parent = 0);
private:
void createButtons();
void createControls();
QToolButton *playButton;
QToolButton *pauseButton;
QToolButton *stopButton;
QGridLayout *controlsLayout;
QHBoxLayout *buttonsLayout;
QVBoxLayout *mainLayout;
};
#endif // PLAYVIDEO_H
error: forward declaration of ‘struct QToolButton’
#ifndef PLAYVIDEO_H
#define PLAYVIDEO_H
#include <QWidget>
class QToolButton;
class QGridLayout;
class QHBoxLayout;
class QVBoxLayout;
class PlayVideo : public QWidget
{
Q_OBJECT
public:
PlayVideo(QWidget *parent = 0);
private:
void createButtons();
void createControls();
QToolButton *playButton;
QToolButton *pauseButton;
QToolButton *stopButton;
QGridLayout *controlsLayout;
QHBoxLayout *buttonsLayout;
QVBoxLayout *mainLayout;
};
#endif // PLAYVIDEO_H
error: forward declaration of ‘struct QToolButton’