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¶
Base classes¶
Methods
Returns the authentication configuration for the parser. |
|
Dismisses all current news items. |
|
Dismisses an entry with matching key. |
|
Returns a list of existing entries in the feed. |
|
Fetches new entries from the feed's URL. |
Static Methods
Returns the settings key used for a feed with the given baseUrl. |
Signals
Emitted whenever a new entry is available from the feed (as a result of a call to |
|
Emitted whenever an entry is dismissed (as a result of a call to |
|
Emitted whenever an existing entry is available from the feed (as a result of a call to |
|
Emitted when entries have been fetched from the feed. |
|
Emitted when the image attached to the entry with the specified key has been fetched and is now available. |
- 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¶
HTML content of news entry
- expiry: QDateTime¶
Optional auto-expiry time for entry
- image: QPixmap¶
Optional image data
- imageUrl: str¶
Optional URL for image associated with entry
- key: int¶
Unique entry identifier
- link: QUrl¶
Optional URL link for entry
- sticky: bool¶
True
if entry is “sticky” and should always be shown at the top
- title: str¶
Entry title
- authcfg(self) str [source]¶
Returns the authentication configuration for the parser.
- Return type:
str
- 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
- Parameters:
key (int)
- entries(self) List[QgsNewsFeedParser.Entry] ¶
Returns a list of existing entries in the feed.
- Return type:
List[QgsNewsFeedParser.Entry]
- signal entryAdded(entry: QgsNewsFeedParser.Entry)[source]¶
Emitted whenever a new
entry
is available from the feed (as a result of a call tofetch()
).See also
- Parameters:
entry (QgsNewsFeedParser.Entry)
- signal entryDismissed(entry: QgsNewsFeedParser.Entry)[source]¶
Emitted whenever an
entry
is dismissed (as a result of a call todismissEntry()
).See also
- Parameters:
entry (QgsNewsFeedParser.Entry)
- signal entryUpdated(entry: QgsNewsFeedParser.Entry)[source]¶
Emitted whenever an existing
entry
is available from the feed (as a result of a call tofetch()
).See also
Added in version 3.36.
- Parameters:
entry (QgsNewsFeedParser.Entry)
- signal fetched(entries: List[QgsNewsFeedParser.Entry])[source]¶
Emitted when
entries
have been fetched from the feed.See also
- Parameters:
entries (List[QgsNewsFeedParser.Entry])