in my .h:
class ImagePixmapItem: public QGraphicsPixmapItem
{
public:
void setSize(qreal size);
private:
qreal size;
};
In my class file I now have two functions:
#include "imagepixmapitem.h"
#include <QGraphicsSceneWheelEvent>
ImagePixmapItem::ImagePixmapItem(const QPixmap &pixmap, QGraphicsItem *parentItem)
: QGraphicsPixmapItem(pixmap,parentItem)
{
setCacheMode(NoCache);
}
ImagePixmapItem::~ImagePixmapItem()
{
}
void ImagePixmapItem::setSize(qreal size)
{
this->size = size;
}
void wheelEvent ( QGraphicsSceneWheelEvent * event ){
qreal size = 1.2;
if (event->delta() < 0)
size = 1.0 / size;
setSize(size);
}
yet I am getting an error on setSize:
../IMViewer/imagepixmapitem.cpp:42: error: ‘setSize’ was not declared in this scope
What am I doing wrong here?
should say
and also add this to the .h