Falkon Develop
Cross-platform Qt-based web browser
qmlhistoryitem.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2018 Anmol Gautam <tarptaeya@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#pragma once
19
20#include <QObject>
21#include "history.h"
22
26class QmlHistoryItem : public QObject
27{
28 Q_OBJECT
29
33 Q_PROPERTY(int id READ id CONSTANT)
34
35
38 Q_PROPERTY(QString url READ url CONSTANT)
39
40
43 Q_PROPERTY(QString title READ title CONSTANT)
44
45
48 Q_PROPERTY(int visitCount READ visitCount CONSTANT)
49
50
53 Q_PROPERTY(QDateTime lastVisitTime READ lastVisitTime CONSTANT)
54public:
55 explicit QmlHistoryItem(const HistoryEntry &entry, QObject *parent = nullptr);
56
57private:
58 HistoryEntry m_entry;
59
60 int id() const;
61 QString url() const;
62 QString title() const;
63 int visitCount() const;
64 QDateTime lastVisitTime() const;
65};
The class exposing HistoryEntry to QML.
QmlHistoryItem(const HistoryEntry &entry, QObject *parent=nullptr)
QDateTime lastVisitTime
last visit time of the history item
QString title
title of the history item
int visitCount
visit count of the history item
QString url
url of the history item
int id
id of the history item
Definition: history.h:39