QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsdetaileditemdata.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdetaileditemdata.h - A data representation for a rich QItemData subclass
3 -------------------
4 begin : Sat May 17 2008
5 copyright : (C) 2008 Tim Sutton
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 "qgis_gui.h"
22
23#include <QMetaType>
24#include <QPixmap>
25#include <QString>
26
32class GUI_EXPORT QgsDetailedItemData
33{
34 public:
36
41 void setTitle( const QString &title );
42
47 void setDetail( const QString &detail );
48
53 void setCategory( const QString &category );
54
59 void setIcon( const QPixmap &icon );
60
65 void setCheckable( bool flag );
66
71 void setChecked( bool flag );
72
77 void setEnabled( bool flag );
78
87 void setRenderAsWidget( bool flag );
88
93 QString title() const;
94
99 QString detail() const;
100
105 QString category() const;
106
111 QPixmap icon() const;
112
117 bool isCheckable() const;
118
123 bool isChecked() const;
124
129 bool isEnabled() const;
130
135 bool isRenderedAsWidget() const;
136
137 private:
138 QString mTitle;
139 QString mDetail;
140 QString mCategory;
141 QString mLibraryName;
142 QPixmap mPixmap;
143 bool mCheckableFlag = false;
144 bool mCheckedFlag = false;
145 bool mEnabledFlag = true;
146 bool mRenderAsWidgetFlag = false;
147};
148
149// Make QVariant aware of this data type (see qtdocs star
150// rating delegate example for more details)
152#endif //QGSDETAILEDITEMDATA_H
The data only representation of a QgsDetailedItemWidget, designed to be used in custom views.
QgsDetailedItemData()=default
QString category() const
Returns the item's category.
void setCheckable(bool flag)
Sets whether the item is checkable.
void setDetail(const QString &detail)
Sets the detailed description for the item.
void setEnabled(bool flag)
Sets whether the item is enabled.
void setTitle(const QString &title)
Sets the title for the item.
void setChecked(bool flag)
Sets whether the item is checked.
bool isCheckable() const
Returns true if the item is checkable.
bool isEnabled() const
Returns true if the item is enabled.
QString title() const
Returns the item's title.
bool isRenderedAsWidget() const
Returns true if the item will be rendered using a widget.
QPixmap icon() const
Returns the item's icon.
QString detail() const
Returns the detailed description for the item.
void setIcon(const QPixmap &icon)
Sets the item's icon.
void setCategory(const QString &category)
Sets the item's category.
void setRenderAsWidget(bool flag)
This is a hint to the delegate to render using a widget rather than manually painting every part of t...
bool isChecked() const
Returns true if the item is checked.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)