2024-12-02 15:10:51 +00:00
|
|
|
#ifndef COLUMNSLOT_H
|
|
|
|
#define COLUMNSLOT_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2024-12-03 14:05:22 +00:00
|
|
|
#include <qqmlintegration.h>
|
2024-12-02 15:10:51 +00:00
|
|
|
#include "playingcard.h"
|
|
|
|
|
|
|
|
class ColumnSlot : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2024-12-03 14:05:22 +00:00
|
|
|
QML_ELEMENT
|
|
|
|
QML_UNCREATABLE("Use C++ logic to instantiate")
|
2024-12-02 15:10:51 +00:00
|
|
|
Q_PROPERTY(PlayingCard* card READ card CONSTANT)
|
|
|
|
Q_PROPERTY(bool revealed READ isRevealed NOTIFY revealedChanged)
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ColumnSlot(PlayingCard* card, bool revealed, QObject* parent = nullptr);
|
|
|
|
|
|
|
|
PlayingCard* card() const;
|
|
|
|
|
|
|
|
bool isRevealed() const;
|
|
|
|
void reveal();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void revealedChanged();
|
|
|
|
|
|
|
|
private:
|
|
|
|
PlayingCard* m_card;
|
|
|
|
bool m_revealed;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // COLUMNSLOT_H
|