QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsprojectitem.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojectitem.h
3 -------------------
4 begin : 2011-04-01
5 copyright : (C) 2011 Radim Blazek
6 email : radim dot blazek at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSPROJECTITEM_H
18#define QGSPROJECTITEM_H
19
20#include "qgis_core.h"
21#include "qgis_sip.h"
22#include "qgsdataitem.h"
23
24#include <QString>
25
26using namespace Qt::StringLiterals;
27
32class CORE_EXPORT QgsProjectItem : public QgsDataItem
33{
34 Q_OBJECT
35 public:
43 QgsProjectItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &providerKey = QString() );
44
45#ifdef SIP_RUN
46 // clang-format off
47 SIP_PYOBJECT __repr__();
48 % MethodCode
49 QString str = u"<QgsProjectItem: \"%1\" %2>"_s.arg( sipCpp->name(), sipCpp->path() );
50 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
51 % End
52// clang-format on
53#endif
54
55 bool hasDragEnabled() const override
56 {
57 return true;
58 }
59
60 QgsMimeDataUtils::UriList mimeUris() const override;
61};
62
63#endif // QGSPROJECTITEM_H
QgsDataItem(Qgis::BrowserItemType type, QgsDataItem *parent, const QString &name, const QString &path, const QString &providerKey=QString())
Constructor for QgsDataItem, with the specified parent item.
QString name() const
Returns the name of the item (the displayed text for the item).
QString path() const
QgsDataItem * parent() const
Gets item parent.
virtual QgsMimeDataUtils::UriList mimeUris() const
Returns mime URIs for the data item, most data providers will only return a single URI but some data ...
QString providerKey() const
Returns the provider key that created this item (e.g.
QList< QgsMimeDataUtils::Uri > UriList
QgsProjectItem(QgsDataItem *parent, const QString &name, const QString &path, const QString &providerKey=QString())
A data item holding a reference to a QGIS project file.
bool hasDragEnabled() const override
Returns true if the item may be dragged.