hi,
idk if somebody has tried this before, but I had first time opportunity to use Qworkspace API in my program and the compiler is throwing out this puzzling error each time::
error:invalid use of undefined type 'struct QWorkspace'
I've included the required QWorkspace header file properly in my header file, but still I'm getting this error, code snippets are as follows:
Header file snippet is::
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
{
Q_OBJECT
public:
MainWindow();
private:
};
#endif
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
class QWorkspace;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
private:
QWorkspace *workspace;
};
#endif
To copy to clipboard, switch view to plain text mode
CPP file snippet is ::
#include <QtGui>
#include "test.h"
MainWindow::MainWindow()
{
setCentralWidget(workspace);
/*some stupid code of application*/
}
#include <QtGui>
#include "test.h"
MainWindow::MainWindow()
{
workspace = new QWorkspace;
setCentralWidget(workspace);
/*some stupid code of application*/
}
To copy to clipboard, switch view to plain text mode
is there anything I'm missing out in that?
Thanks
Bookmarks