QGIS API Documentation  2.99.0-Master (f867b65)
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 
30 class GUI_EXPORT QgsDetailedItemData
31 {
32  public:
34  void setTitle( const QString &title );
35  void setDetail( const QString &detail );
36  void setCategory( const QString &category );
37  void setIcon( const QPixmap &icon );
38  void setCheckable( const bool flag );
39  void setChecked( const bool flag );
40  void setEnabled( bool flag );
41 
48  void setRenderAsWidget( bool flag );
49 
50  QString title() const;
51  QString detail() const;
52  QString category() const;
53  QPixmap icon() const;
54  bool isCheckable() const;
55  bool isChecked() const;
56  bool isEnabled() const;
57  bool isRenderedAsWidget() const;
58 
59  private:
60  QString mTitle;
61  QString mDetail;
62  QString mCategory;
63  QString mLibraryName;
64  QPixmap mPixmap;
65  bool mCheckableFlag;
66  bool mCheckedFlag;
67  bool mEnabledFlag;
68  bool mRenderAsWidgetFlag;
69 };
70 
71 // Make QVariant aware of this data type (see qtdocs star
72 // rating delegate example for more details)
74 #endif //QGSDETAILEDITEMDATA_H
This class is the data only representation of a QgsDetailedItemWidget, designed to be used in custom ...
Q_DECLARE_METATYPE(QModelIndex)