KardPile Class Reference

#include <kardpile.h>

Collaboration diagram for KardPile:

Collaboration graph
[legend]

List of all members.


Detailed Description

This displays a pile of cards.

Author:
John Schneiderman

Signals

void kardSelected (Kard &kard)

Public Member Functions

void addCardToBottom (const Card &card)
const CardPilecardPile () const
void clear ()
bool isTopCardUp () const
 KardPile (CardPile pile, QWidget *parent=0)
 KardPile (QWidget *parent=0)
void removeCard ()
void selectTopCard ()
void setCardBackImage (const QString &backImage)
void setCardFrontImagePath (const QString &imagePath)
void setCardPile (const CardPile &cardPile)
void setSelected (const Card &card)
void setTopCardUp (bool topUp)
QSize sizeHint () const
 ~KardPile ()

Protected Member Functions

virtual void dragEnterEvent (QDragEnterEvent *event)
virtual void dropEvent (QDropEvent *event)
virtual void paintEvent (QPaintEvent *event)

Properties

bool m_topCardUp

Constructor & Destructor Documentation

KardPile::KardPile ( QWidget *  parent = 0  ) 

General constructor for our widget.

Parameters:
parent is parent of the KardPile widget.

KardPile::KardPile ( CardPile  pile,
QWidget *  parent = 0 
)

General constructor for our widget.

Parameters:
pile is the pile to display
parent is parent of the KardPile widget.

KardPile::~KardPile (  ) 

General destructor for our widget.


Member Function Documentation

void KardPile::addCardToBottom ( const Card card  ) 

Adds a card to the bottom of the card pile.

Parameters:
card is the card to be inserted into the bottom of the pile.

const CardPile & KardPile::cardPile (  )  const

This is an accessor for our card pile.

Returns:
our card pile.

void KardPile::clear (  ) 

This clears the kard pile.

void KardPile::dragEnterEvent ( QDragEnterEvent *  event  )  [protected, virtual]

These are the types of objects we can accept for dropping.

Parameters:
event is the generating event.

void KardPile::dropEvent ( QDropEvent *  event  )  [protected, virtual]

This handles when an object is dropped into us.

Parameters:
event is the generating event.

bool KardPile::isTopCardUp (  )  const

Tells us if our widget is displaying the top card face up.

Returns:
true if we are displaying the top card face up, false if we are not.

void KardPile::kardSelected ( Kard kard  )  [signal]

This is a signal that notifies a slot that a card has been selected.

Parameters:
kard is the kard that was selected.

void KardPile::paintEvent ( QPaintEvent *  event  )  [protected, virtual]

This draws our widget.

Parameters:
event is the event that caused our widget to be drawn.

void KardPile::removeCard (  ) 

This will remove the top card from the card pile.

void KardPile::selectTopCard (  ) 

This selects the top card.

void KardPile::setCardBackImage ( const QString &  backImage  ) 

Sets the image to use for the back of the cards.

Parameters:
backImage is the file-name for the image on the back of the kards.

void KardPile::setCardFrontImagePath ( const QString &  imagePath  ) 

Sets the path to the directory that contains the images for the front of our kards.

Parameters:
imagePath is the path to the images.

void KardPile::setCardPile ( const CardPile cardPile  ) 

This will set our displaying card pile.

Parameters:
cardPile is the pile of cards to set our widget to.

void KardPile::setSelected ( const Card card  ) 

This will select a specific card in our kard pile.

Parameters:
card is the card we want to select.
Exceptions:
KardsGTError if card is not the top card in the pile.

void KardPile::setTopCardUp ( bool  topUp  ) 

Sets our widget to display the top card face up or not.

Parameters:
topUp true if we want to have our top card face up, false elsewise.

QSize KardPile::sizeHint (  )  const

Provides the size hint for our widget.

Returns:
the preferred size of our widget.


Property Documentation

bool KardPile::m_topCardUp [read, write]

Parameters:
m_topCardUp is true if we are displaying the front of the top card and false if ware displaying the back of the card.


The documentation for this class was generated from the following files:

Generated on Tue Aug 12 23:24:01 2008 for KardsGT by  doxygen 1.5.5