Qt Centre Forum >
Qt >
Newbie > "can't find linker symbol for virtual table for `QPixmap' value" what does it mean?
View Full Version : "can't find linker symbol for virtual table for `QPixmap' value" what does it mean?
Qt4dummie
17th February 2011, 23:47
Hi,
I got a debugging error "can't find linker symbol for virtual table for `QPixmap' value", what does it mean?
void GalleryTab::setupPuzzle()
{
....
puzzleWidget->drawPuzzleWidget(puzzleImage); // puzzleImage is a QPixmap
}
void PuzzleWidget::drawPuzzleWidget(const QPixmap aPuzzleImage){
clear();
QPoint location = QPoint(0,0);
QRect square = QRect(0,0, m_ImageSize, m_ImageSize);
pieceLocations.append(location);
piecePixmaps.append(aPuzzleImage);
pieceRects.append(square);
update(square);
}
What did I do wrong? How do I rewrite drawPuzzleWidget() to display an image "aPuzzleImage"?
Your help is much appreciated!
high_flyer
18th February 2011, 14:03
can you show your header?
Qt4dummie
21st February 2011, 18:56
Thanks for helping. Here the header files:
gallerytab.h:
#ifndef GALLERYTAB_H
#define GALLERYTAB_H
#include <QWidget>
#include <QPixmap>
#include <QRect>
class PiecesList;
class PuzzleWidget;
QT_BEGIN_NAMESPACE
class QListWidgetItem;
QT_END_NAMESPACE
class GalleryTab : public QWidget
{
Q_OBJECT
public:
explicit GalleryTab(QWidget *parent = 0);
public slots:
void openImage(const QString &path = QString());
void setupPuzzle();
private slots:
void setCompleted();
private:
void setupWidgets();
QPixmap puzzleImage;
PiecesList *piecesList;
PuzzleWidget *puzzleWidget;
};
#endif // GALLERYTAB_H
puzzlewidget.h:
#ifndef PUZZLEWIDGET_H
#define PUZZLEWIDGET_H
#include <QList>
#include <QPoint>
#include <QPixmap>
#include <QWidget>
QT_BEGIN_NAMESPACE
class QDragEnterEvent;
class QDropEvent;
class QMouseEvent;
QT_END_NAMESPACE
class PuzzleWidget : public QWidget
{
Q_OBJECT
public:
PuzzleWidget(int imageSize, QWidget *parent = 0);
void clear();
void drawPuzzleWidget(QPixmap aPuzzleImage);
int pieceSize() const;
int imageSize() const;
signals:
void puzzleCompleted();
protected:
void dragEnterEvent(QDragEnterEvent *event);
void dragLeaveEvent(QDragLeaveEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void dropEvent(QDropEvent *event);
void mousePressEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *event);
private:
int findPiece(const QRect &pieceRect) const;
const QRect targetSquare(const QPoint &position) const;
QList<QPixmap> piecePixmaps;
QList<QRect> pieceRects;
QList<QPoint> pieceLocations;
QRect highlightedRect;
int inPlace;
int m_ImageSize;
};
#endif
high_flyer
22nd February 2011, 09:53
Is this a warning or an error?
Can you please say on which line of code you get this message?
Also, please post the full code for setupPuzzle(), or the function in which you get the message.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.