kblackbox
kbbballsgraphicwidget.cpp
Go to the documentation of this file.
87 m_scene->setSceneRect(0, 0, KBBScalableGraphicWidget::RATIO, m_ballsToPlace*KBBScalableGraphicWidget::RATIO);
98 while (((ballsLeftToPlace>=0) && (m_wrongPlayerBalls.count()>0)) || ((ballsLeftToPlace<0) && (m_wrongPlayerBalls.count()>-ballsLeftToPlace))) {
104 while (((ballsLeftToPlace>=0) && (ballsLeftToPlace<m_playerBalls.count())) || ((ballsLeftToPlace<0) && (m_playerBalls.count()>0))) {
111 m_playerBalls.append(new KBBGraphicsItem(KBBScalableGraphicWidget::playerBall, m_scene, m_themeManager));
112 m_playerBalls.last()->setPos(0, (m_ballsToPlace-m_playerBalls.count())*KBBScalableGraphicWidget::RATIO);
117 m_wrongPlayerBalls.append(new KBBGraphicsItem(KBBScalableGraphicWidget::wrongPlayerBall, m_scene, m_themeManager));
118 m_wrongPlayerBalls.last()->setPos(0, (m_ballsToPlace-m_wrongPlayerBalls.count())*KBBScalableGraphicWidget::RATIO);
KBBBallsGraphicWidget(KBBThemeManager *themeManager)
Constructor.
Definition: kbbballsgraphicwidget.cpp:44
sceneRect
int count(const T &value) const
void resizeEvent(QResizeEvent *)
Event: widget has been resized This happens for instance when the main window has been resized...
Definition: kbbballsgraphicwidget.cpp:70
void append(const T &value)
void setScene(QGraphicsScene *scene)
void setBallsToPlace(const int ballsToPlace)
Define the number of balls to place on the black box.
Definition: kbbballsgraphicwidget.cpp:76
static int const RATIO
Width and height of a single square on the black box.
Definition: kbbscalablegraphicwidget.h:81
T & last()
void update(qreal x, qreal y, qreal w, qreal h)
void removeLast()
void setPlacedBalls(const int placedBalls)
Define the number of balls the player already placed on the board.
Definition: kbbballsgraphicwidget.cpp:93
~KBBBallsGraphicWidget()
Destructor Remove all items displayed on the scene.
Definition: kbbballsgraphicwidget.cpp:58
void setAlignment(QFlags< Qt::AlignmentFlag > alignment)
void fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRatioMode)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:20 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:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.