• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

PlasmaCore

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • core
svgitem.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Marco Martin <mart@kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program 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
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef SVGITEM_P
21 #define SVGITEM_P
22 
23 #include <QDeclarativeItem>
24 
25 namespace Plasma {
26 
27  class Svg;
28 
29 class SvgItem : public QDeclarativeItem
30 {
31  Q_OBJECT
32 
36  Q_PROPERTY(QString elementId READ elementId WRITE setElementId NOTIFY elementIdChanged)
37 
38 
48  Q_PROPERTY(Plasma::Svg * svg READ svg WRITE setSvg NOTIFY svgChanged)
49 
53  Q_PROPERTY(QSizeF naturalSize READ naturalSize NOTIFY naturalSizeChanged)
54 
58  Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
59 
63  Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged)
64 
68  Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged)
69 
70 public:
71  SvgItem(QDeclarativeItem *parent=0);
72  ~SvgItem();
73 
74  void setElementId(const QString &elementID);
75  QString elementId() const;
76 
77  void setSvg(Plasma::Svg *svg);
78  Plasma::Svg *svg() const;
79 
80  void setSmooth(const bool smooth);
81  bool smooth() const;
82 
83  QSizeF naturalSize() const;
84 
85  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
86 
87  void setImplicitWidth(qreal width);
88  qreal implicitWidth() const;
89 
90  void setImplicitHeight(qreal height);
91  qreal implicitHeight() const;
92 
93 Q_SIGNALS:
94  void elementIdChanged();
95  void svgChanged();
96  void naturalSizeChanged();
97  void smoothChanged();
98  void implicitWidthChanged();
99  void implicitHeightChanged();
100 
101 protected Q_SLOTS:
102  void updateNeeded();
103 
104 private:
105  QWeakPointer<Plasma::Svg> m_svg;
106  QString m_elementID;
107  bool m_smooth;
108 };
109 }
110 
111 #endif
QWidget
Plasma::SvgItem::setSvg
void setSvg(Plasma::Svg *svg)
Definition: svgitem.cpp:78
Plasma::SvgItem::implicitHeightChanged
void implicitHeightChanged()
Plasma::SvgItem::svgChanged
void svgChanged()
Plasma::SvgItem::svg
Plasma::Svg * svg() const
Plasma::SvgItem::naturalSize
QSizeF naturalSize() const
Plasma::SvgItem::smooth
bool smooth() const
Plasma::SvgItem::implicitHeight
qreal implicitHeight() const
Plasma::SvgItem::setImplicitWidth
void setImplicitWidth(qreal width)
Definition: svgitem.cpp:153
Plasma::SvgItem::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: svgitem.cpp:121
QPainter
Plasma::SvgItem::setSmooth
void setSmooth(const bool smooth)
Definition: svgitem.cpp:106
Plasma::SvgItem
Definition: svgitem.h:29
Plasma::SvgItem::setImplicitHeight
void setImplicitHeight(qreal height)
Definition: svgitem.cpp:169
QString
Plasma::SvgItem::elementIdChanged
void elementIdChanged()
Plasma::SvgItem::implicitWidthChanged
void implicitWidthChanged()
Plasma::SvgItem::setElementId
void setElementId(const QString &elementID)
Definition: svgitem.cpp:42
Plasma::SvgItem::implicitWidth
qreal implicitWidth() const
QSizeF
Plasma::SvgItem::updateNeeded
void updateNeeded()
Definition: svgitem.cpp:142
QWeakPointer
QStyleOptionGraphicsItem
QDeclarativeItem
Plasma::SvgItem::elementId
QString elementId() const
QObject::parent
QObject * parent() const
Plasma::SvgItem::naturalSizeChanged
void naturalSizeChanged()
Plasma::SvgItem::smoothChanged
void smoothChanged()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PlasmaCore

Skip menu "PlasmaCore"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal