QGIS API Documentation  3.0.2-Girona (307d082)
qgsdetaileditemdata.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdetaileditemdata.h - A data represenation for a rich QItemData subclass
3  -------------------
4  begin : Sat May 17 2008
5  copyright : (C) 2008 Tim Sutton
6  email : [email protected]
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 #ifndef QGSDETAILEDITEMDATA_H
18 #define QGSDETAILEDITEMDATA_H
19 
20 
21 #include <QMetaType>
22 #include <QString>
23 #include <QPixmap>
24 #include "qgis_gui.h"
25 
31 class GUI_EXPORT QgsDetailedItemData
32 {
33  public:
34 
38  QgsDetailedItemData() = default;
39 
40  void setTitle( const QString &title );
41  void setDetail( const QString &detail );
42  void setCategory( const QString &category );
43  void setIcon( const QPixmap &icon );
44  void setCheckable( const bool flag );
45  void setChecked( const bool flag );
46  void setEnabled( bool flag );
47 
55  void setRenderAsWidget( bool flag );
56 
57  QString title() const;
58  QString detail() const;
59  QString category() const;
60  QPixmap icon() const;
61  bool isCheckable() const;
62  bool isChecked() const;
63  bool isEnabled() const;
64  bool isRenderedAsWidget() const;
65 
66  private:
67  QString mTitle;
68  QString mDetail;
69  QString mCategory;
70  QString mLibraryName;
71  QPixmap mPixmap;
72  bool mCheckableFlag = false;
73  bool mCheckedFlag = false;
74  bool mEnabledFlag = true;
75  bool mRenderAsWidgetFlag = false;
76 };
77 
78 // Make QVariant aware of this data type (see qtdocs star
79 // rating delegate example for more details)
81 #endif //QGSDETAILEDITEMDATA_H
This class is the data only representation of a QgsDetailedItemWidget, designed to be used in custom ...
Q_DECLARE_METATYPE(QModelIndex)