2015-08-18 00:31:12 +02:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
----------------------------------------------------
|
|
|
|
date : 17.8.2015
|
|
|
|
copyright : (C) 2015 by Matthias Kuhn
|
|
|
|
email : matthias (at) opengis.ch
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QGSWELCOMEPAGEITEMSMODEL_H
|
|
|
|
#define QGSWELCOMEPAGEITEMSMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
class QgsWelcomePageItemsModel : public QAbstractListModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-08-18 23:25:20 +02:00
|
|
|
struct RecentProjectData
|
|
|
|
{
|
|
|
|
bool operator==( const RecentProjectData& other ) { return other.path == this->path; }
|
|
|
|
QString path;
|
|
|
|
QString title;
|
|
|
|
QString previewImagePath;
|
2015-08-18 00:31:12 +02:00
|
|
|
};
|
|
|
|
|
2015-08-18 20:45:02 +02:00
|
|
|
QgsWelcomePageItemsModel( QObject* parent = 0 );
|
2015-08-18 00:31:12 +02:00
|
|
|
|
2015-08-18 23:25:20 +02:00
|
|
|
void setRecentProjects( const QList<RecentProjectData>& recentProjects );
|
2015-08-18 00:31:12 +02:00
|
|
|
|
|
|
|
int rowCount( const QModelIndex& parent ) const;
|
|
|
|
QVariant data( const QModelIndex& index, int role ) const;
|
2015-08-18 23:16:18 +02:00
|
|
|
Qt::ItemFlags flags( const QModelIndex& index ) const;
|
2015-08-18 00:31:12 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QList<RecentProjectData> mRecentProjects;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QGSWELCOMEPAGEITEMSMODEL_H
|