summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebenginehistory_p.h
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@theqtcompany.com>2015-02-12 20:17:40 +0100
committerPierre Rossi <pierre.rossi@theqtcompany.com>2015-02-18 13:17:45 +0000
commit6717d58192a9e4fb87b4721a34f3715766863851 (patch)
tree9014acec9ccde3cd2c36a89725ed8bbb215f0d82 /src/webengine/api/qquickwebenginehistory_p.h
parent4bac2cb5084c68354e43fb456e4d20d4f70b223a (diff)
Move navigationHistory out of experimental
Add an offset role to the models. Implement goBackAndForward that uses this offset. Also add a complete model, items, that includes current navigation entry (at offset 0) to allow for the Firefox-style single menu, and add that one to the nano browser example. The models are now instantiated lazily as it's unlikely the three models will be used by the same app. Change-Id: Ib551738611497c7eb9c501f045cda315968a2ada Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/webengine/api/qquickwebenginehistory_p.h')
-rw-r--r--src/webengine/api/qquickwebenginehistory_p.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/webengine/api/qquickwebenginehistory_p.h b/src/webengine/api/qquickwebenginehistory_p.h
index 5a68fdd96..02f29b35b 100644
--- a/src/webengine/api/qquickwebenginehistory_p.h
+++ b/src/webengine/api/qquickwebenginehistory_p.h
@@ -37,7 +37,7 @@
#ifndef QQUICKWEBENGINEHISTORY_P_H
#define QQUICKWEBENGINEHISTORY_P_H
-#include <qtwebengineglobal_p.h>
+#include <qtwebengineglobal.h>
#include <QAbstractListModel>
#include <QtCore/qshareddata.h>
#include <QQuickItem>
@@ -54,7 +54,7 @@ class QQuickWebEngineHistoryListModelPrivate;
class QQuickWebEngineLoadRequest;
class QQuickWebEngineViewPrivate;
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineHistoryListModel : public QAbstractListModel {
+class Q_WEBENGINE_EXPORT QQuickWebEngineHistoryListModel : public QAbstractListModel {
Q_OBJECT
public:
@@ -75,8 +75,9 @@ private:
friend class QQuickWebEngineHistory;
};
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineHistory : public QQuickItem {
+class Q_WEBENGINE_EXPORT QQuickWebEngineHistory : public QQuickItem {
Q_OBJECT
+ Q_PROPERTY(QQuickWebEngineHistoryListModel *items READ items CONSTANT FINAL)
Q_PROPERTY(QQuickWebEngineHistoryListModel *backItems READ backItems CONSTANT FINAL)
Q_PROPERTY(QQuickWebEngineHistoryListModel *forwardItems READ forwardItems CONSTANT FINAL)
@@ -86,9 +87,11 @@ public:
enum NavigationHistoryRoles {
UrlRole = Qt::UserRole + 1,
- TitleRole = Qt::UserRole + 2
+ TitleRole = Qt::UserRole + 2,
+ OffsetRole = Qt::UserRole + 3,
};
+ QQuickWebEngineHistoryListModel *items() const;
QQuickWebEngineHistoryListModel *backItems() const;
QQuickWebEngineHistoryListModel *forwardItems() const;