KReport

KReportScriptCheck.cpp
1/* This file is part of the KDE project
2 * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "KReportScriptCheck.h"
19#include <KProperty>
20
21#include <QSizeF>
22#include <QPointF>
23
24namespace Scripting
25{
26
27CheckBox::CheckBox(KReportItemCheckBox *c)
28{
29 m_check = c;
30}
31
32
33CheckBox::~CheckBox()
34{
35}
36
37bool CheckBox::value() const
38{
39 return m_check->value();
40}
41
43{
44 m_check->setValue(v);
45}
46
48{
49 return m_check->m_checkStyle->value().toString();
50}
51
53{
54 m_check->m_checkStyle->setValue(style);
55}
56
58{
59 return m_check->m_foregroundColor->value().value<QColor>();
60}
62{
63 m_check->m_foregroundColor->setValue(c);
64}
65
67{
68 return m_check->m_lineColor->value().value<QColor>();
69}
71{
72 m_check->m_lineColor->setValue(c);
73}
74
76{
77 return m_check->m_lineWeight->value().toInt();
78}
80{
81 m_check->m_lineWeight->setValue(w);
82}
83
85{
86 return m_check->m_lineStyle->value().toInt();
87}
89{
90 if (s < 0 || s > 5) {
91 s = 1;
92 }
93 m_check->m_lineStyle->setValue(s);
94}
95
100
105
107{
108 return KReportItemBase::sceneSize(m_check->size());
109}
110
112{
114}
115}
QVariant value() const
bool setValue(const QVariant &value, ValueOptions options=ValueOptions())
static QPointF scenePosition(const QPointF &ptPos)
Helper function mapping to screen units (pixels), ptPos is in points.
void setSize(const QSizeF &ptSize)
Sets size for the element.
QPointF position() const
Return the position in points.
static QSizeF sceneSize(const QSizeF &ptSize)
Helper function mapping to screen units (pixels), ptSize is in points.
void setPosition(const QPointF &ptPos)
Sets position for the element.
QSizeF size() const
Return the size in points.
static QPointF positionFromScene(const QPointF &pos)
Helper function mapping from screen units to points, pos is in pixels.
static QSizeF sizeFromScene(const QSizeF &size)
Helper function mapping from screen units to points, size is in pixels.
QColor foregroundColor() const
void setLineColor(const QColor &)
Sets the border line color of the text-item to the given color.
void setLineWeight(int)
Sets the border line weight (thickness) of the text-item.
void setForegroundColor(const QColor &)
Sets the foreground (text) color of the text-item to the given color.
void setSize(const QSizeF &)
Sets the size of the text-item to the given size in points.
void setLineStyle(int)
Sets the border line style of the text-item to the given style in the range 0-5.
void setCheckStyle(const QString &)
Sets the style of the checkbox, valid values are Cross, Tick or Dot.
void setValue(bool val=true)
Set the value of the checkbox, defaults to checked if no value is given.
void setPosition(const QPointF &)
Sets the position of the text-item to the given point coordinates.
Field item script interface.
int toInt(bool *ok) const const
QString toString() const const
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:21:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.