QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsdataitemguiprovider.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsdataitemguiprovider.cpp
3  --------------------------------------
4  Date : October 2018
5  Copyright : (C) 2018 by Nyall Dawson
6  Email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgsdataitemguiprovider.h"
17 
18 //
19 // QgsDataItemGuiContext
20 //
21 
23 {
24  return mMessageBar;
25 }
26 
28 {
29  mMessageBar = messageBar;
30 }
31 
32 //
33 // QgsDataItemGuiProvider
34 //
35 
36 void QgsDataItemGuiProvider::populateContextMenu( QgsDataItem *, QMenu *, const QList<QgsDataItem *> &, QgsDataItemGuiContext )
37 {
38 }
39 
41 {
42  return false;
43 }
44 
46 {
47  return false;
48 }
49 
51 {
52  return false;
53 }
54 
56 {
57  return false;
58 }
59 
60 bool QgsDataItemGuiProvider::handleDrop( QgsDataItem *, QgsDataItemGuiContext, const QMimeData *, Qt::DropAction )
61 {
62  return false;
63 }
64 
66 {
67  return nullptr;
68 }
QgsDataItemGuiContext::messageBar
QgsMessageBar * messageBar() const
Returns the associated message bar.
Definition: qgsdataitemguiprovider.cpp:22
qgsdataitemguiprovider.h
QgsDataItemGuiProvider::rename
virtual bool rename(QgsDataItem *item, const QString &name, QgsDataItemGuiContext context)
Sets a new name for the item, and returns true if the item was successfully renamed.
Definition: qgsdataitemguiprovider.cpp:40
QgsDataItemGuiProvider::handleDrop
virtual bool handleDrop(QgsDataItem *item, QgsDataItemGuiContext context, const QMimeData *data, Qt::DropAction action)
Called when a user drops on an item.
Definition: qgsdataitemguiprovider.cpp:60
QgsDataItemGuiProvider::handleDoubleClick
virtual bool handleDoubleClick(QgsDataItem *item, QgsDataItemGuiContext context)
Called when a user double clicks on an item.
Definition: qgsdataitemguiprovider.cpp:50
QgsDataItemGuiProvider::createParamWidget
virtual QWidget * createParamWidget(QgsDataItem *item, QgsDataItemGuiContext context)
Creates source widget from data item for QgsBrowserPropertiesWidget By default it returns nullptr.
Definition: qgsdataitemguiprovider.cpp:65
QgsMessageBar
Definition: qgsmessagebar.h:60
QgsDataItemGuiContext
Definition: qgsdataitemguiprovider.h:39
QgsDataItemGuiContext::setMessageBar
void setMessageBar(QgsMessageBar *bar)
Sets the associated message bar.
Definition: qgsdataitemguiprovider.cpp:27
QgsDataItemGuiProvider::acceptDrop
virtual bool acceptDrop(QgsDataItem *item, QgsDataItemGuiContext context)
Providers should return true if the drops are allowed (handleDrop() should be implemented in that cas...
Definition: qgsdataitemguiprovider.cpp:55
QgsLayerItem
Definition: qgsdataitem.h:499
QgsDataItemGuiProvider::populateContextMenu
virtual void populateContextMenu(QgsDataItem *item, QMenu *menu, const QList< QgsDataItem * > &selectedItems, QgsDataItemGuiContext context)
Called when the given context menu is being populated for the given item, allowing the provider to ad...
Definition: qgsdataitemguiprovider.cpp:36
QgsDataItem
Definition: qgsdataitem.h:49
QgsDataItemGuiProvider::deleteLayer
virtual bool deleteLayer(QgsLayerItem *item, QgsDataItemGuiContext context)
Tries to permanently delete map layer representing the given item.
Definition: qgsdataitemguiprovider.cpp:45