ksquares
gameboardscene.h
Go to the documentation of this file.
98 int indexFromPointPair(const QList<QGraphicsEllipseItem*> &pointPair) const; //given a pointPair, returns the index of the line between them. If not a valid line, returns -1
104 QLineF lineFromIndex(int index) const; //all external calls will need to be passed through this to convert to local coords
void acknowledgeMove(int x1, int y1, int x2, int y2)
Definition: gameboardscene.cpp:247
void lineDrawn(int)
Emits the index of the closet (undrawn) line when a click is detected.
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: gameboardscene.cpp:254
QGraphicsLineItem * indicatorLine
Moves to show where the next line will be drawn.
Definition: gameboardscene.h:107
const QSize minimumSizeHint() const
The smallest the view can be when 'auto-zoom' is off.
Definition: gameboardscene.cpp:215
void drawLine(int index, const QColor &colour)
Add the line to the scene so it shows up in the view.
Definition: gameboardscene.cpp:82
int indexFromPointPair(const QList< QGraphicsEllipseItem * > &pointPair) const
Takes a pair of QGraphicsEllipseItems and finds the index that relates to the line that's between the...
Definition: gameboardscene.cpp:107
void addLineToIndex(const QList< QGraphicsEllipseItem * > &pointPair)
Adds the line to the index for a specified pair of points.
Definition: gameboardscene.cpp:185
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: gameboardscene.cpp:226
GameBoardScene(int newWidth, int newHeight, QObject *parent=0)
Create a new gameboard scene with the appropriate size.
Definition: gameboardscene.cpp:21
QList< QGraphicsEllipseItem * > getTwoNearestPoints(const QPointF &pos) const
Given a single location in the scene, gives the two nearest QGraphicsEllipseItem. ...
Definition: gameboardscene.cpp:194
QLineF lineFromIndex(int index) const
Takes a line-index and returns a QLineF located at that position.
Definition: gameboardscene.cpp:147
bool isLineAlready(const QList< QGraphicsEllipseItem * > &pointPair) const
Given a pair of points, returns whether there is already a line there.
Definition: gameboardscene.cpp:176
void drawSquare(int index, const QColor &colour)
Fill a box to show it is owned be a particular player.
Definition: gameboardscene.cpp:100
QObject * parent() const
bool acceptEvents
This property holds whether mouse events are enabled for this widget.
Definition: gameboardscene.h:121
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.