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

GroupingDesktop

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • containments
  • groupingdesktop
  • lib
  • groupexplorer
groupicon.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 by Ana CecĂ­lia Martins <anaceciliamb@gmail.com>
3  * Copyright (C) 2010 by Chani Armitage <chani@kde.org>
4  * Copyright 2010 by Giulio Camuffo <giuliocamuffo@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Library/Lesser General Public License
8  * version 2, or (at your option) any later version, as published by the
9  * Free Software Foundation
10  *
11  * This program 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
14  * GNU General Public License for more details
15  *
16  * You should have received a copy of the GNU Library/Lesser General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef GROUPICON_H
23 #define GROUPICON_H
24 
25 #include <QGraphicsWidget>
26 
27 #include <KIcon>
28 
29 namespace Plasma {
30  class FrameSvg;
31 }
32 
33 class GroupIcon : public QGraphicsWidget
34 {
35  Q_OBJECT
36 
37  public:
38  GroupIcon(const QString &name);
39  ~GroupIcon();
40 
41  void setIconSize(int height);
42  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
43 
44  static const int DEFAULT_ICON_SIZE = 16;
45 
46  Q_SIGNALS:
47  void hoverEnter(GroupIcon *icon);
48 
49  protected:
50  //listen to events and emit signals
51  void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
52  void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
53  void mousePressEvent(QGraphicsSceneMouseEvent *event);
54  void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
55  void resizeEvent(QGraphicsSceneResizeEvent *event);
56  QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
57 
58  bool isDraggable() const;
59 
60  private:
61  Plasma::FrameSvg *m_background;
62  QString m_name;
63  QString m_id;
64  KIcon m_icon;
65  int m_iconHeight;
66 };
67 
68 #endif //GROUPICON_H
QWidget
GroupIcon
Definition: groupicon.h:33
GroupIcon::hoverEnterEvent
void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Definition: groupicon.cpp:92
GroupIcon::resizeEvent
void resizeEvent(QGraphicsSceneResizeEvent *event)
Definition: groupicon.cpp:62
QGraphicsWidget::event
virtual bool event(QEvent *event)
GroupIcon::setIconSize
void setIconSize(int height)
Definition: groupicon.cpp:85
GroupIcon::sizeHint
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
Definition: groupicon.cpp:70
QObject::name
const char * name() const
GroupIcon::DEFAULT_ICON_SIZE
static const int DEFAULT_ICON_SIZE
Definition: groupicon.h:44
GroupIcon::isDraggable
bool isDraggable() const
Definition: groupicon.cpp:137
QGraphicsSceneMouseEvent
QPainter
GroupIcon::hoverEnter
void hoverEnter(GroupIcon *icon)
QGraphicsWidget
QString
GroupIcon::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Definition: groupicon.cpp:129
GroupIcon::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: groupicon.cpp:97
QGraphicsSceneResizeEvent
GroupIcon::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Definition: groupicon.cpp:121
QGraphicsSceneHoverEvent
GroupIcon::GroupIcon
GroupIcon(const QString &name)
Definition: groupicon.cpp:42
QSizeF
QStyleOptionGraphicsItem
GroupIcon::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: groupicon.cpp:143
GroupIcon::~GroupIcon
~GroupIcon()
Definition: groupicon.cpp:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GroupingDesktop

Skip menu "GroupingDesktop"
  • Main Page
  • Namespace List
  • 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