• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. Kirigami
  • KDE Home
  • Contact Us

Quick Links

Skip menu "Kirigami"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Related Pages

Class Picker

About

QtQuick plugins to build user interfaces based on the KDE UX guidelines

Maintainer
Marco Martin
Supported platforms
Android, Linux
Community
IRC: #plasma on Freenode
Mailing list: plasma-devel
Use with CMake
find_package(KF5Kirigami)
target_link_libraries(yourapp KF5::Kirigami)
Clone
git clone git://anongit.kde.org/kirigami1.git
Browse source
Kirigami on cgit.kde.org

Kirigami

  • src
desktopicon.h
1 /***************************************************************************
2  * Copyright 2011 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 General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, 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 General Public License *
15  * 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 #ifndef QICONITEM_H
20 #define QICONITEM_H
21 
22 #include <QIcon>
23 #include <QQuickItem>
24 #include <QVariant>
25 
26 class DesktopIcon : public QQuickItem
27 {
28  Q_OBJECT
29 
30  Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged)
31  Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
32  Q_PROPERTY(int implicitWidth READ implicitWidth CONSTANT)
33  Q_PROPERTY(int implicitHeight READ implicitHeight CONSTANT)
34  Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
35  Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
36  Q_PROPERTY(bool valid READ valid NOTIFY validChanged)
37  Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged)
38 
39 public:
40  DesktopIcon(QQuickItem *parent=0);
41  ~DesktopIcon();
42 
43  void setSource(const QVariant &source);
44  QIcon source() const;
45 
46  int implicitWidth() const;
47  int implicitHeight() const;
48 
49  void setSmooth(const bool smooth);
50  bool smooth() const;
51 
52  void setEnabled(bool enabled = true);
53 
54  void setActive(bool active = true);
55  bool active() const;
56 
57  bool valid() const;
58 
59  void setSelected(bool selected = true);
60  bool selected() const;
61 
62  QSGNode* updatePaintNode(QSGNode* node, UpdatePaintNodeData* data) Q_DECL_OVERRIDE;
63 
64 Q_SIGNALS:
65  void sourceChanged();
66  void smoothChanged();
67  void enabledChanged();
68  void activeChanged();
69  void validChanged();
70  void selectedChanged();
71 
72 protected:
73  void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE;
74 
75 private:
76  QIcon m_icon;
77  bool m_smooth;
78  bool m_changed;
79  bool m_active;
80  bool m_selected;
81 };
82 
83 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2017 The KDE developers.
Generated on Fri Feb 17 2017 11:09:23 by doxygen 1.8.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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