-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgsbrowserguimodel.h
63 lines (55 loc) · 2.4 KB
/
qgsbrowserguimodel.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/***************************************************************************
qgsbrowserguimodel.h
---------------------
begin : June 2019
copyright : (C) 2019 by Peter Petrik
email : zilolv at gmail dot com
***************************************************************************
* *
* 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 QGSBROWSERGUIMODEL_H
#define QGSBROWSERGUIMODEL_H
#include "qgis_gui.h"
#include "qgsbrowsermodel.h"
class QgsDataItemGuiContext;
class QgsMessageBar;
/**
* \ingroup gui
* \class QgsBrowserGuiModel
*
* \brief A model for showing available data sources and other items in a structured
* tree.
*
* QgsBrowserGuiModel is the foundation for the QGIS browser panel, and includes
* items for the different data providers and folders accessible to users.
*
* \since QGIS 3.10
*/
class GUI_EXPORT QgsBrowserGuiModel : public QgsBrowserModel
{
Q_OBJECT
public:
/**
* Constructor for QgsBrowserGuiModel, with the specified \a parent object.
*
* \note QgsBrowserModel models are not initially populated and use a deferred initialization
* approach. After constructing a QgsBrowserModel, a call must be made
* to initialize() in order to populate the model.
*/
explicit QgsBrowserGuiModel( QObject *parent = nullptr );
Qt::ItemFlags flags( const QModelIndex &index ) const override;
bool dropMimeData( const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent ) override;
bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole ) override;
//! Sets message bar that will be passed in QgsDataItemGuiContext to data items
void setMessageBar( QgsMessageBar *bar );
private:
QgsDataItemGuiContext createDataItemContext() const;
QgsMessageBar *mMessageBar = nullptr;
};
#endif // QGSBROWSERGUIMODEL_H