Class: QgsNewsFeedParser

Parser for published QGIS news feeds.

This class is designed to work with the specialized QGIS news feed API. See https://github.com/elpaso/qgis-feed.

Added in version 3.10.

Class Hierarchy

Inheritance diagram of qgis.core.QgsNewsFeedParser

Base classes

QObject

class qgis.core.QgsNewsFeedParser[source]

Bases: QObject

__init__(feedUrl: QUrl, authcfg: str | None = '', parent: QObject | None = None)

Constructor for QgsNewsFeedParser, parsing the specified feedUrl.

The optional authcfg argument can be used to specify an authentication configuration to use when connecting to the feed.

Parameters:
  • feedUrl (QUrl)

  • authcfg (Optional[str] = '')

  • parent (Optional[QObject] = None)

class Entry[source]

Bases: object

Represents a single entry from a news feed.

Added in version 3.10.

content: str
expiry: QDateTime
image: QPixmap
imageUrl: str
key: int
sticky: bool
title: str
authcfg(self) str[source]

Returns the authentication configuration for the parser.

Return type:

str

dismissAll(self)[source]

Dismisses all current news items.

See also

dismissEntry()

dismissEntry(self, key: int)[source]

Dismisses an entry with matching key.

This removes the entry from the local store, ensuring it will never be present again.

See also

dismissAll()

Parameters:

key (int)

entries(self) List[QgsNewsFeedParser.Entry]

Returns a list of existing entries in the feed.

Return type:

List[QgsNewsFeedParser.Entry]

signal entryAdded[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal entryDismissed[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal entryUpdated[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

fetch(self)[source]

Fetches new entries from the feed’s URL.

See also

fetched()

signal fetched[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal imageFetched[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

static keyForFeed(baseUrl: str | None) str[source]

Returns the settings key used for a feed with the given baseUrl.

Parameters:

baseUrl (Optional[str])

Return type:

str