blob: 43052181945f43a95ca10b47ee4b304ab30817bf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#ifndef TABBROWSINGHISTORY_HPP
#define TABBROWSINGHISTORY_HPP
#include <QAbstractListModel>
#include <QVector>
#include <QUrl>
class TabBrowsingHistory :
public QAbstractListModel
{
Q_OBJECT
public:
TabBrowsingHistory();
bool canGoBack() const;
bool canGoForward() const;
QModelIndex pushUrl(QModelIndex const & position, QUrl const & url);
QUrl get(QModelIndex const & index) const;
QModelIndex oneForward(QModelIndex index) const;
QModelIndex oneBackward(QModelIndex index) const;
public:
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
private:
QVector<QUrl> history;
};
#endif // TABBROWSINGHISTORY_HPP
|