KReport

KReportElement.cpp
1/* This file is part of the KDE project
2 * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
3 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
4 * Copyright (C) 2010-2015 Jarosław Staniek <staniek@kde.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "KReportElement.h"
21
22#include <QDebug>
23#include <QHash>
24
25KReportElement::~KReportElement()
26{
27}
28
29void KReportElement::setBackgroundOpacity(qreal backgroundOpacity)
30{
31 d->backgroundOpacity = qMax(qMin(backgroundOpacity, 1.0), 0.0);
32}
33
34KREPORT_EXPORT QDebug operator<<(QDebug dbg, const KReportElement& element)
35{
36 dbg.nospace() << qPrintable(
37 QString::fromLatin1("KReportElement: name=\"%1\" rect=%2 z=%3 foregroundColor=%4 "
38 "backgroundColor=%5 backgroundOpacity=%6")
39 .arg(element.name()).arg(QVariant(element.rect()).toString())
40 .arg(element.z()).arg(QVariant(element.foregroundColor()).toString())
42 .arg(element.backgroundOpacity()));
43 return dbg.space();
44}
45
46KREPORT_EXPORT uint qHash(const KReportElement &element, uint seed) Q_DECL_NOTHROW
47{
48 return qHash(element.name(), seed)
49 ^ qHash(element.z(), seed)
50 ^ qHash(element.rect().x(), seed)
51 ^ qHash(element.foregroundColor().name(), seed)
52 ^ qHash(element.backgroundColor().name(), seed)
53 ^ qHash(qRound64(element.backgroundOpacity() * 1000.0), seed);
54}
The KReportElement class represents a functional visual element of a report design.
KCALENDARCORE_EXPORT size_t qHash(const KCalendarCore::Period &key, size_t seed=0)
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
QString name(NameFormat format) const const
QDebug & nospace()
QDebug & space()
qreal x() const const
QString arg(Args &&... args) const const
QString fromLatin1(QByteArrayView str)
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.