Krita Source Code Documentation
Loading...
Searching...
No Matches
KisNewsWidget.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 boud <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KISNEWSWIDGET_H
7#define KISNEWSWIDGET_H
8
9#include <QWidget>
10#include <QListView>
11#include <QSet>
12#include <QStyledItemDelegate>
13#include <KisKineticScroller.h>
14
15#include <ui_KisNewsPage.h>
16
18
19class KisNewsDelegate : public QStyledItemDelegate
20{
21 Q_OBJECT
22public:
23 KisNewsDelegate(QObject *parent = 0);
24 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
25 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
26};
27
31class KisNewsWidget : public QWidget, public Ui::KisNewsPage
32{
33 Q_OBJECT
34public:
35 explicit KisNewsWidget(QWidget *parent = nullptr);
36
37 void setAnalyticsTracking(QString text);
38 void toggleNewsLanguage(QString langCode, bool enabled);
39
40Q_SIGNALS:
42
43protected:
44 bool eventFilter(QObject *watched, QEvent *event) override;
45
46private Q_SLOTS:
47 void toggleNews(bool toggle);
48 void itemSelected(const QModelIndex &idx);
49 void rssDataChanged();
50 void slotScrollerStateChanged(QScroller::State state){ KisKineticScroller::updateCursor(this, state); }
51
52private:
53 bool m_getNews {false};
56 QSet<QString> m_enabledFeeds;
57};
58
59#endif // KISNEWSWIDGET_H
KisNewsDelegate(QObject *parent=0)
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
The KisNewsWidget class shows the latest news from Krita.org.
KisNewsWidget(QWidget *parent=nullptr)
bool eventFilter(QObject *watched, QEvent *event) override
void itemSelected(const QModelIndex &idx)
void slotScrollerStateChanged(QScroller::State state)
void setAnalyticsTracking(QString text)
MultiFeedRssModel * m_rssModel
void newsDataChanged()
QString m_analyticsTrackingParameters
QSet< QString > m_enabledFeeds
void toggleNews(bool toggle)
void toggleNewsLanguage(QString langCode, bool enabled)
KRITAWIDGETUTILS_EXPORT void updateCursor(QWidget *source, QScroller::State state)