QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgsdetaileditemwidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdetailedlistwidget.cpp - A rich QItemWidget 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 
18 #include "qgsdetaileditemwidget.h"
20  : QWidget( parent )
21 
22 {
23  setupUi( this );
24 }
25 
27 {
28  lblTitle->setText( data.title() );
29  lblDetail->setText( data.detail() );
30  lblCategory->setText( data.category() );
31  cbx->setVisible( data.isCheckable() );
32  cbx->setChecked( data.isChecked() );
33  lblIcon->setPixmap( data.icon() );
34 }
35 
37 {
38  cbx->setChecked( flag );
39 }
This class is the data only representation of a QgsDetailedItemWidget, designed to be used in custom ...
bool isChecked() const
Returns true if the item is checked.
QgsDetailedItemWidget(QWidget *parent=nullptr)
Constructor for QgsDetailedItemWidget.
QString category() const
Returns the item's category.
QPixmap icon() const
Returns the item's icon.
void setData(const QgsDetailedItemData &data)
QString title() const
Returns the item's title.
bool isCheckable() const
Returns true if the item is checkable.
QString detail() const
Returns the detailed description for the item.