Hi Forum,
I am using QT Creator 2.1.0 based on 4.7.2 (32 bit) the following code creating an error at build compile time!
ERROR READS : "field printer has incorrect type"
#ifndef IMAGEPREVIEWDIALOG_H
#define IMAGEPREVIEWDIALOG_H
#include <QDialog>
#include <QScrollArea>
#include <QLabel>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QPixmap>
#include <QPrinter>
#include <QPrintDialog>
namespace Ui {
class ImagePreviewDialog;
}
class ImagePreviewDialog
: public QDialog{
Q_OBJECT
public:
~ImagePreviewDialog();
bool isFileSupported();
public slots:
void print();
private:
Ui::ImagePreviewDialog *ui;
QPrinter printer;
// This object variable causing problem!!!!!!!!!
bool fileSupported;
};
#endif // IMAGEPREVIEWDIALOG_H
#ifndef IMAGEPREVIEWDIALOG_H
#define IMAGEPREVIEWDIALOG_H
#include <QDialog>
#include <QScrollArea>
#include <QLabel>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QPixmap>
#include <QPrinter>
#include <QPrintDialog>
namespace Ui {
class ImagePreviewDialog;
}
class ImagePreviewDialog : public QDialog
{
Q_OBJECT
public:
ImagePreviewDialog(QString file, QByteArray *imageData, QWidget *parent = 0);
~ImagePreviewDialog();
bool isFileSupported();
public slots:
void print();
private:
Ui::ImagePreviewDialog *ui;
QGraphicsScene *scene;
QPixmap pixmap;
QGraphicsPixmapItem *pixmapItem;
QPrinter printer; // This object variable causing problem!!!!!!!!!
bool fileSupported;
};
#endif // IMAGEPREVIEWDIALOG_H
To copy to clipboard, switch view to plain text mode
AS you can see the class <QPrinter> included in the header file of this source along with <QPrintDialog>, which seems to enough to get compiling. But throws an error
"field printer has incorrect type"
I wonder some one could shed a light on this ... which include file missing at above in this header file, please?
Thank you in advance.
Shy
Bookmarks