QGIS API Documentation  3.11.0-Master (68611307d7)
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  Role {
  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. More...
 
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

◆ Role

Custom model roles.

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 41 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 23 of file qgsnewsfeedmodel.cpp.

Member Function Documentation

◆ columnCount()

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

Definition at line 111 of file qgsnewsfeedmodel.cpp.

◆ data()

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

Definition at line 37 of file qgsnewsfeedmodel.cpp.

◆ flags()

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

Definition at line 77 of file qgsnewsfeedmodel.cpp.

◆ index()

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

Definition at line 83 of file qgsnewsfeedmodel.cpp.

◆ parent()

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

Definition at line 96 of file qgsnewsfeedmodel.cpp.

◆ rowCount()

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

Definition at line 102 of file qgsnewsfeedmodel.cpp.


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