• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
  • widgets
itembackground.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright 2009 by Alessandro Diaferia <alediaferia@gmail.com> *
3 * Copyright 2009 by Marco Martin <notmart@gmail.com> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Library General Public License as *
7 * published by the Free Software Foundation; either version 2, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
19 ***************************************************************************/
20
21#ifndef ITEMBACKGROUND_H
22#define ITEMBACKGROUND_H
23
24#include <QtGui/QGraphicsWidget>
25
26#include <plasma/plasma_export.h>
27
35namespace Plasma {
36
37class FrameSvg;
38class ItemBackgroundPrivate;
39
40class PLASMA_EXPORT ItemBackground : public QGraphicsWidget
41{
42 Q_OBJECT
43 Q_PROPERTY(QRectF target READ target WRITE setTarget)
44 Q_PROPERTY(QGraphicsItem* targetItem READ targetItem WRITE setTargetItem)
45
46 Q_PROPERTY(qreal animationUpdate READ animationUpdate WRITE setAnimationUpdate)
47
48public:
49 ItemBackground(QGraphicsWidget *parent = 0);
50 ~ItemBackground();
51
57 void setTarget(const QRectF &newGeometry);
58
62 QRectF target() const;
63
67 void setTargetItem(QGraphicsItem *target);
68
72 QGraphicsItem *targetItem() const;
73
77 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
78
79Q_SIGNALS:
84 void appearanceChanged();
85
89 void animationStep(qreal progress);
90
95 void targetReached(QRectF);
96
101 void targetItemReached(QGraphicsItem *);
102
103protected:
107 QVariant itemChange(GraphicsItemChange change, const QVariant &value);
108
112 bool eventFilter(QObject *watched, QEvent *event);
113
117 bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
118
122 void resizeEvent(QGraphicsSceneResizeEvent *);
123
124private:
125 void setAnimationUpdate(qreal progress);
126 qreal animationUpdate() const;
127
128private:
129 Q_PRIVATE_SLOT(d, void targetDestroyed(QObject*))
130 Q_PRIVATE_SLOT(d, void frameSvgChanged())
131 Q_PRIVATE_SLOT(d, void refreshCurrentTarget())
132
133 friend class ItemBackgroundPrivate;
134 ItemBackgroundPrivate * const d;
135};
136}
137
138#endif
Plasma::FrameSvg
Provides an SVG with borders.
Definition: framesvg.h:77
Plasma::ItemBackground
Definition: itembackground.h:41
Plasma::ItemBackground::animationStep
void animationStep(qreal progress)
Emitted at each animation frame.
Plasma::ItemBackground::appearanceChanged
void appearanceChanged()
Emitted when the visual layout and appearance changes.
Plasma::ItemBackground::targetReached
void targetReached(QRectF)
Emitted when the target has been reached.
Plasma::ItemBackground::targetItemReached
void targetItemReached(QGraphicsItem *)
Emitted when the target has been reached.
QGraphicsWidget
QObject
QStyleOptionGraphicsItem
QWidget
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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