QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
QgsNewsFeedModel Class Reference

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

#include <qgsnewsfeedmodel.h>

Inheritance diagram for QgsNewsFeedModel:

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 34 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 47 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 27 of file qgsnewsfeedmodel.cpp.

Member Function Documentation

◆ columnCount()

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

Definition at line 116 of file qgsnewsfeedmodel.cpp.

◆ data()

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

Definition at line 42 of file qgsnewsfeedmodel.cpp.

◆ flags()

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

Definition at line 82 of file qgsnewsfeedmodel.cpp.

◆ index()

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

Definition at line 88 of file qgsnewsfeedmodel.cpp.

◆ parent()

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

Definition at line 101 of file qgsnewsfeedmodel.cpp.

◆ rowCount()

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

Definition at line 107 of file qgsnewsfeedmodel.cpp.


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