最近刚学qt,想请问下面的class connect的部分可能哪边写错了,谢谢大家。
#ifndef CARD_H
#define CARD_H
#include <QGraphicsPixmapItem>
class Card:public QObject,public QGraphicsPixmapItem {
Q_OBJECT
public:
Card();
private slots:
void set();
};
#include "Card.h"
#include <QKeyEvent>
#include <QGraphicsPixmapItem>
void Card::set()
{
this->setPos(500, 380);
}
Card::Card():QObject(), QGraphicsPixmapItem()
{
connect(this, SIGNAL(clicked()), this, SLOT(set()));