Results 1 to 4 of 4

Thread: "can't find linker symbol for virtual table for `QPixmap' value" what does it mean?

  1. #1
    Join Date
    Feb 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default "can't find linker symbol for virtual table for `QPixmap' value" what does it mean?

    Hi,

    I got a debugging error "can't find linker symbol for virtual table for `QPixmap' value", what does it mean?

    Qt Code:
    1. void GalleryTab::setupPuzzle()
    2. {
    3. ....
    4. puzzleWidget->drawPuzzleWidget(puzzleImage); // puzzleImage is a QPixmap
    5. }
    6.  
    7. void PuzzleWidget::drawPuzzleWidget(const QPixmap aPuzzleImage){
    8.  
    9. clear();
    10. QPoint location = QPoint(0,0);
    11. QRect square = QRect(0,0, m_ImageSize, m_ImageSize);
    12.  
    13. pieceLocations.append(location);
    14. piecePixmaps.append(aPuzzleImage);
    15. pieceRects.append(square);
    16.  
    17. update(square);
    18. }
    To copy to clipboard, switch view to plain text mode 

    What did I do wrong? How do I rewrite drawPuzzleWidget() to display an image "aPuzzleImage"?

    Your help is much appreciated!
    Last edited by high_flyer; 18th February 2011 at 14:01.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: "can't find linker symbol for virtual table for `QPixmap' value" what does it mea

    can you show your header?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: "can't find linker symbol for virtual table for `QPixmap' value" what does it mea

    Thanks for helping. Here the header files:

    gallerytab.h:

    Qt Code:
    1. #ifndef GALLERYTAB_H
    2. #define GALLERYTAB_H
    3.  
    4. #include <QWidget>
    5. #include <QPixmap>
    6. #include <QRect>
    7.  
    8. class PiecesList;
    9. class PuzzleWidget;
    10. QT_BEGIN_NAMESPACE
    11. QT_END_NAMESPACE
    12.  
    13. class GalleryTab : public QWidget
    14. {
    15. Q_OBJECT
    16.  
    17. public:
    18. explicit GalleryTab(QWidget *parent = 0);
    19.  
    20. public slots:
    21. void openImage(const QString &path = QString());
    22. void setupPuzzle();
    23.  
    24. private slots:
    25. void setCompleted();
    26.  
    27. private:
    28. void setupWidgets();
    29.  
    30. QPixmap puzzleImage;
    31. PiecesList *piecesList;
    32. PuzzleWidget *puzzleWidget;
    33. };
    34.  
    35. #endif // GALLERYTAB_H
    36.  
    37. puzzlewidget.h:
    38.  
    39. #ifndef PUZZLEWIDGET_H
    40. #define PUZZLEWIDGET_H
    41.  
    42. #include <QList>
    43. #include <QPoint>
    44. #include <QPixmap>
    45. #include <QWidget>
    46.  
    47. QT_BEGIN_NAMESPACE
    48. class QDropEvent;
    49. QT_END_NAMESPACE
    50.  
    51. class PuzzleWidget : public QWidget
    52. {
    53. Q_OBJECT
    54.  
    55. public:
    56. PuzzleWidget(int imageSize, QWidget *parent = 0);
    57. void clear();
    58. void drawPuzzleWidget(QPixmap aPuzzleImage);
    59.  
    60. int pieceSize() const;
    61. int imageSize() const;
    62.  
    63. signals:
    64. void puzzleCompleted();
    65.  
    66. protected:
    67. void dragEnterEvent(QDragEnterEvent *event);
    68. void dragLeaveEvent(QDragLeaveEvent *event);
    69. void dragMoveEvent(QDragMoveEvent *event);
    70. void dropEvent(QDropEvent *event);
    71. void mousePressEvent(QMouseEvent *event);
    72. void paintEvent(QPaintEvent *event);
    73.  
    74.  
    75.  
    76. private:
    77. int findPiece(const QRect &pieceRect) const;
    78. const QRect targetSquare(const QPoint &position) const;
    79.  
    80. QList<QPixmap> piecePixmaps;
    81. QList<QRect> pieceRects;
    82. QList<QPoint> pieceLocations;
    83. QRect highlightedRect;
    84. int inPlace;
    85. int m_ImageSize;
    86. };
    87.  
    88. #endif
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 22nd February 2011 at 09:50. Reason: code tags

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: "can't find linker symbol for virtual table for `QPixmap' value" what does it mea

    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.
    Last edited by high_flyer; 22nd February 2011 at 10:06.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 4
    Last Post: 5th January 2011, 16:51
  2. Unresolved external symbol "staticMetaObject"
    By sr71 in forum Qt Programming
    Replies: 5
    Last Post: 30th June 2010, 00:26
  3. "Follow symbol under cursor" does not work...?
    By liormessinger in forum Qt Tools
    Replies: 0
    Last Post: 16th September 2009, 18:22
  4. Replies: 3
    Last Post: 17th November 2008, 09:48
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.