• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • workspace API Reference
  • KDE Home
  • Contact Us
 

liblancelot

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • libs
  • lancelot
  • widgets
Widget.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007, 2008, 2009, 2010 Ivan Cukic <ivan.cukic(at)kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser/Library General Public License version 2,
6  * or (at your option) any later version, as published by the Free
7  * Software Foundation
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 Lesser/Library General Public License for more details
13  *
14  * You should have received a copy of the GNU Lesser/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 LANCELOT_WIDGET_H
21 #define LANCELOT_WIDGET_H
22 
23 #include <QtGui/QGraphicsWidget>
24 
25 #include <lancelot/lancelot_export.h>
26 #include <lancelot/lancelot.h>
27 #include <lancelot/Global.h>
28 
29 namespace Lancelot
30 {
31 
37 class LANCELOT_EXPORT Widget : public QGraphicsWidget {
38  Q_OBJECT
39 
40  Q_PROPERTY(QString group READ groupName WRITE setGroupByName)
41  Q_PROPERTY(bool down READ isDown WRITE setDown)
42 
43  // @puck L_WIDGET
44  // @puck L_INCLUDE(lancelot/widgets/Widget.h QString)
45 
46 public:
51  Widget(QGraphicsItem * parent = 0);
52 
56  virtual ~Widget();
57 
62  virtual void setGroupByName(const QString & groupName);
63 
67  QString groupName() const;
68 
73  virtual void setGroup(Group * group = NULL);
74 
78  Group * group() const;
79 
83  bool isHovered() const;
84 
88  bool isDown() const;
89 
90 protected:
91  L_Override QSizeF sizeHint(Qt::SizeHint which,
92  const QSizeF & constraint = QSizeF()) const;
93 
94  void setPaintBackwardsWhenRTL(bool value);
95 
96 Q_SIGNALS:
100  void mouseHoverEnter();
101 
105  void mouseHoverLeave();
106 
113  void clicked();
114 
118  void pressed();
119 
123  void released();
124 
125 protected:
131  void paintBackground(QPainter * painter);
132 
138  void paintBackground(QPainter * painter, const QString & element);
139 
145  void setHovered(bool value);
146 
152  void setDown(bool value);
153 
154  L_Override void hoverEnterEvent(QGraphicsSceneHoverEvent * event);
155  L_Override void hoverLeaveEvent(QGraphicsSceneHoverEvent * event);
156 
157  L_Override void mousePressEvent(QGraphicsSceneMouseEvent * event);
158  L_Override void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
159  L_Override void hideEvent(QHideEvent * event);
160 
161  L_Override void paint(QPainter * painter,
162  const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
163 
164 private:
165  class Private;
166  Private * const d;
167 };
168 
169 } // namespace Lancelot
170 
171 #endif /* LANCELOT_WIDGET_H */
172 
QHideEvent
QWidget
QGraphicsItem
L_Override
#define L_Override
Definition: lancelot_export.h:41
lancelot_export.h
Lancelot::Widget
Base class for Widgets that want to use Lancelot framework.
Definition: Widget.h:37
QGraphicsSceneMouseEvent
QPainter
Lancelot::Group
Represents a group of object.
Definition: Global.h:63
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
QGraphicsWidget
Global.h
QString
QGraphicsSceneHoverEvent
QSizeF
lancelot.h
QStyleOptionGraphicsItem
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:43:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

liblancelot

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

workspace API Reference

Skip menu "workspace API Reference"
  • kdeplasma-addons
  •       GroupingDesktop
  •     liblancelot

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