1 Star 0 Fork 88

momo/Landlords

forked from ibc-dabing/Landlords 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cardpanel.h 885 Bytes
一键复制 编辑 原始数据 按行查看 历史
kevin 提交于 2021-12-16 00:16 . 代码优化, 提高程序的健壮性
#ifndef CARDPANEL_H
#define CARDPANEL_H
#include <QWidget>
#include "card.h"
#include "player.h"
class CardPanel : public QWidget
{
Q_OBJECT
public:
explicit CardPanel(QWidget *parent = nullptr);
void setImage(const QPixmap &front, const QPixmap &back);
QPixmap getImage();
void setFrontSide(bool flag);
bool isFrontSide();
void setSeclected(bool flag);
bool isSelected();
void setCard(const Card& card);
Card getCard();
void setOwner(Player* player);
Player* getOwner();
void clicked();
protected:
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent* event);
signals:
void cardSelected(Qt::MouseButton button);
private:
QPixmap m_front;
QPixmap m_back;
bool m_isfront = true;
bool m_isSelect = false;
Card m_card;
Player* m_owner = nullptr;
};
#endif // CARDPANEL_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dataoffical/landlords.git
git@gitee.com:dataoffical/landlords.git
dataoffical
landlords
Landlords
master

搜索帮助