kblackbox
kbblevelconfigurationpreview.cpp
Go to the documentation of this file.
4 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
6 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
8 You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28 KBBLevelConfigurationPreview::KBBLevelConfigurationPreview(QWidget *parent, KBBThemeManager* themeManager) : QGraphicsView(parent)
33 setScene(new QGraphicsScene(0, 0, 2*KBBScalableGraphicWidget::BORDER_SIZE, 2*KBBScalableGraphicWidget::BORDER_SIZE, this));
42 scene()->setSceneRect(0, 0, columns*KBBScalableGraphicWidget::RATIO + 2*KBBScalableGraphicWidget::BORDER_SIZE, rows*KBBScalableGraphicWidget::RATIO + 2*KBBScalableGraphicWidget::BORDER_SIZE);
59 item->setPos(KBBScalableGraphicWidget::BORDER_SIZE + KBBScalableGraphicWidget::RATIO*(boxPos % columns), KBBScalableGraphicWidget::BORDER_SIZE + KBBScalableGraphicWidget::RATIO*(boxPos / columns));
88 m_themeManager->svgRenderer()->render(painter, m_themeManager->elementId(KBBScalableGraphicWidget::background), rectBackground);
94 fitInView(0.5*KBBScalableGraphicWidget::BORDER_SIZE, 0.5*KBBScalableGraphicWidget::BORDER_SIZE, scene()->width() - 1.5*KBBScalableGraphicWidget::BORDER_SIZE, scene()->height() - 1.5*KBBScalableGraphicWidget::BORDER_SIZE, Qt::KeepAspectRatio);
void render(QPainter *painter)
void setSceneRect(const QRectF &rect)
The black box in the scalable graphic widget.
Definition: kbbgraphicsitemblackbox.h:52
void setFrameStyle(int style)
QGraphicsScene * scene() const
qreal height() const
int width() const
int count(const T &value) const
void append(const T &value)
void setPos(const QPointF &pos)
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)
void setScene(QGraphicsScene *scene)
static int const BORDER_SIZE
Distance between the black box and the widget border.
Definition: kbbscalablegraphicwidget.h:74
KBBLevelConfigurationPreview(QWidget *parent, KBBThemeManager *themeManager)
Definition: kbblevelconfigurationpreview.cpp:28
bool contains(const T &value) const
QString elementId(const KBBScalableGraphicWidget::itemType itemType)
Get the XML "id" value of the item.
Definition: kbbthememanager.cpp:81
static int const RATIO
Width and height of a single square on the black box.
Definition: kbbscalablegraphicwidget.h:81
void drawBackground(QPainter *painter, const QRectF &)
Definition: kbblevelconfigurationpreview.cpp:68
T & last()
void removeLast()
void setRect(qreal x, qreal y, qreal width, qreal height)
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)
void preview(int balls, int columns, int rows)
Definition: kbblevelconfigurationpreview.cpp:39
int height() const
qreal width() const
void setSize(const int columns, const int rows)
Define the (new) size of the black box.
Definition: kbbgraphicsitemblackbox.cpp:74
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.