mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 03:28:49 -07:00
new zone view code
This commit is contained in:
parent
ad3f4ba9e8
commit
26a77d9e40
27 changed files with 474 additions and 397 deletions
|
|
@ -2,7 +2,6 @@
|
|||
#define ZONEVIEWERZONE_H
|
||||
|
||||
#include "cardzone.h"
|
||||
#include <QGraphicsWidget>
|
||||
#include <QGraphicsLayoutItem>
|
||||
|
||||
class ZoneViewWidget;
|
||||
|
|
@ -11,12 +10,14 @@ class ProtocolResponse;
|
|||
class ZoneViewZone : public CardZone, public QGraphicsLayoutItem {
|
||||
Q_OBJECT
|
||||
private:
|
||||
int height;
|
||||
int numberCards;
|
||||
QRectF bRect, optimumRect;
|
||||
int minRows, numberCards;
|
||||
void handleDropEvent(int cardId, CardZone *startZone, const QPoint &dropPoint, bool faceDown);
|
||||
CardZone *origZone;
|
||||
bool sortingEnabled;
|
||||
bool sortByName, sortByType;
|
||||
public:
|
||||
enum { Type = typeZoneView };
|
||||
int type() const { return Type; }
|
||||
ZoneViewZone(Player *_p, CardZone *_origZone, int _numberCards = -1, QGraphicsItem *parent = 0);
|
||||
~ZoneViewZone();
|
||||
QRectF boundingRect() const;
|
||||
|
|
@ -24,14 +25,17 @@ public:
|
|||
void reorganizeCards();
|
||||
void initializeCards();
|
||||
void removeCard(int position);
|
||||
void setGeometry(const QRectF &rect);
|
||||
int getNumberCards() const { return numberCards; }
|
||||
void setGeometry(const QRectF &rect);
|
||||
QRectF getOptimumRect() const { return optimumRect; }
|
||||
public slots:
|
||||
void setSortingEnabled(int _sortingEnabled);
|
||||
void setSortByName(int _sortByName);
|
||||
void setSortByType(int _sortByType);
|
||||
private slots:
|
||||
void zoneDumpReceived(ProtocolResponse *r);
|
||||
signals:
|
||||
void beingDeleted();
|
||||
void optimumRectChanged();
|
||||
protected:
|
||||
void addCardImpl(CardItem *card, int x, int y);
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue