QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QgsNewsFeedModel Class Reference

A model for published QGIS news feeds. More...

#include <qgsnewsfeedmodel.h>

Inheritance diagram for QgsNewsFeedModel:
Inheritance graph
[legend]

Public Types

enum class  CustomRole : int {
  Key = Qt::UserRole + 1 , Title , Content , ImageUrl ,
  Image , Link , Sticky
}
 Custom model roles. More...
 

Public Member Functions

 QgsNewsFeedModel (QgsNewsFeedParser *parser, QObject *parent=nullptr)
 Constructor for QgsNewsFeedModel, with the specified parent object.
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 

Detailed Description

A model for published QGIS news feeds.

This class is designed to work with QgsNewsFeedParser, for displaying feeds from a https://github.com/elpaso/qgis-feed server instance.

Since
QGIS 3.10

Definition at line 33 of file qgsnewsfeedmodel.h.

Member Enumeration Documentation

◆ CustomRole

enum class QgsNewsFeedModel::CustomRole : int
strong

Custom model roles.

Note
Prior to QGIS 3.36 this was available as QgsNewsFeedModel::Role
Since
QGIS 3.36
Enumerator
Key 

Entry unique key.

Title 

Entry title.

Content 

Entry content.

ImageUrl 

Optional entry image URL.

Image 

Optional entry image.

Link 

Optional entry URL link.

Sticky 

Whether entry is sticky.

Definition at line 46 of file qgsnewsfeedmodel.h.

Constructor & Destructor Documentation

◆ QgsNewsFeedModel()

QgsNewsFeedModel::QgsNewsFeedModel ( QgsNewsFeedParser parser,
QObject *  parent = nullptr 
)

Constructor for QgsNewsFeedModel, with the specified parent object.

The parser argument must specify a valid QgsNewsFeedParser object, which must exist for the lifetime of this model.

Definition at line 24 of file qgsnewsfeedmodel.cpp.

Member Function Documentation

◆ columnCount()

int QgsNewsFeedModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 113 of file qgsnewsfeedmodel.cpp.

◆ data()

QVariant QgsNewsFeedModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 39 of file qgsnewsfeedmodel.cpp.

◆ flags()

Qt::ItemFlags QgsNewsFeedModel::flags ( const QModelIndex &  index) const
override

Definition at line 79 of file qgsnewsfeedmodel.cpp.

◆ index()

QModelIndex QgsNewsFeedModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 85 of file qgsnewsfeedmodel.cpp.

◆ parent()

QModelIndex QgsNewsFeedModel::parent ( const QModelIndex &  index) const
override

Definition at line 98 of file qgsnewsfeedmodel.cpp.

◆ rowCount()

int QgsNewsFeedModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 104 of file qgsnewsfeedmodel.cpp.


The documentation for this class was generated from the following files: