Hi everyone,

I have a problem connecting a signal to a slot.
I'm making a chessgame using QGraphicsView and an array of DnDPixmaps:


Qt Code:
  1. #ifndef DNDPIXMAP_H
  2. #define DNDPIXMAP_H
  3.  
  4. #include <QPixmap>
  5. #include <QObject>
  6. #include <QGraphicsPixmapItem>
  7. #include <QGraphicsSceneDragDropEvent>
  8. class uitzicht;
  9. class DnDPixmap:public QObject, public QGraphicsPixmapItem
  10. {
  11. Q_OBJECT
  12. // No Q_OBJECT macro, as QGraphicsPixmapItem is not derived from QObject!
  13.  
  14.  
  15. public:
  16. // Constructor gets a QPixmap which it will display.
  17. DnDPixmap(const QPixmap &pixmap, uitzicht* a);
  18. int oudeX;
  19. int oudeY;
  20. protected:
  21. // Overloaded methods to enable dragging.
  22. virtual void mousePressEvent(QGraphicsSceneMouseEvent* event);
  23. virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
  24. // Overloaded methods for dropping.
  25. virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
  26. virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
  27.  
  28. signals:
  29. void moveMade( int x, int y, int oudeX, int oudeY);
  30.  
  31. private:
  32. // This member holds the copied QPixmap resulting from a drop.
  33. QPixmap pix;
  34. };
  35.  
  36. #endif // DNDPIXMAP_H
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #include "dndpixmap.h"
  2. #include <QMimeData>
  3. #include <QList>
  4. #include <QUrl>
  5. #include <QMessageBox>
  6.  
  7. #include <QDrag>
  8. #include <QApplication>
  9. #include "uitzicht.h"
  10.  
  11. DnDPixmap::DnDPixmap(const QPixmap &pixmap, uitzicht* a)
  12. {
  13.  
  14. // Make sure we allow drops.
  15. setAcceptDrops(true);
  16. connect(this, SIGNAL(moveMade( int, int, int, int)), a, SLOT(myslot( int, int, int, int)));
  17.  
  18. }
  19.  
  20. //more stuffs
To copy to clipboard, switch view to plain text mode 

my view:
Qt Code:
  1. #include "uitzicht.h"
  2. #include "Spelbord.h"
  3. #include <QGraphicsView>
  4. #include <QGraphicsScene>
  5. #include "dndpixmap.h"
  6.  
  7.  
  8. void uitzicht::myslot(const int x, const int y, const int oudeX, const int oudeY){
  9. //see if the move is possible
  10. //Schaakstuk* a = bord->geefSchaakStuk(oudeX, oudeY);
  11.  
  12.  
  13. //if yes update the model by changing the table
  14. bord->verplaatsSchaakStuk(oudeX, oudeY, x, y);
  15.  
  16. //update the view, if needed
  17. this->print();
  18. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #ifndef UITZICHT_H
  2. #define UITZICHT_H
  3. #include <QGraphicsView>
  4. #include <QGraphicsScene>
  5. #include <QPixmap>
  6. #include <QGraphicsItem>
  7. #include <QPen>
  8. #include <QBrush>
  9. #include <QGraphicsScene>
  10. #include "Spelbord.h"
  11. #include "dndpixmap.h"
  12.  
  13. class uitzicht
  14. {
  15. public:
  16. uitzicht(Spelbord* model, QGraphicsScene* scene);
  17. void print();
  18.  
  19. public slots:
  20. void myslot( int x, int y, int oudeX, int oudeY);
  21. private:
  22. DnDPixmap*bordview [Spelbord::MAX][Spelbord::MAX];
  23. Spelbord* bord;
  24. bool witAanZet;
  25. };
  26.  
  27. #endif // UITZICHT_H
To copy to clipboard, switch view to plain text mode 

In the constructor of DnDPixmap, I want to connect the signal 'moveMade' to the slot of the view 'mySlot', but I get this error:
dndpixmap.cpp:17: error: no matching function for call to 'DnDPixmap::connect(DnDPixmap* const, const char*, uitzicht*&, const char*)'

I already derived DnDPixmap from QObject as I learned from another thread outhere, though it's still not working

Can someone help me with this please?
Thanks in advance!
Bennieboj