36 if ( !index.isValid() )
37 return Qt::ItemFlags();
45 return Qt::ItemFlags();
52 if ( legacyAcceptDrop )
54 flags |= Qt::ItemIsDropEnabled;
61 if ( provider->acceptDrop( ptr, createDataItemContext() ) )
63 flags |= Qt::ItemIsDropEnabled;
81 bool legacyAcceptDrop = destItem->
acceptDrop();
85 if ( legacyAcceptDrop )
97 if ( provider->handleDrop( destItem, createDataItemContext(), data, action ) )
126 if ( provider->rename( item, value.toString(), createDataItemContext() ) )
133 return item->
rename( value.toString() );
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
static QgsDataItemGuiProviderRegistry * dataItemGuiProviderRegistry()
Returns the global data item GUI provider registry, used for tracking providers which affect the brow...
#define Q_NOWARN_DEPRECATED_PUSH
A bar for displaying non-blocking messages to the user.
virtual Q_DECL_DEPRECATED bool rename(const QString &name)
Sets a new name for the item, and returns true if the item was successfully renamed.
QList< QgsDataItemGuiProvider * > providers() const
Returns the list of available providers.
QgsBrowserGuiModel(QObject *parent=nullptr)
Constructor for QgsBrowserGuiModel, with the specified parent object.
#define QgsDebugMsgLevel(str, level)
QModelIndex parent(const QModelIndex &index) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
virtual Q_DECL_DEPRECATED bool acceptDrop()
Returns whether the item accepts drag and dropped layers - e.g.
QgsDataItem * dataItem(const QModelIndex &idx) const
Returns the data item at the specified index, or nullptr if no item exists at the index...
Abstract base class for providers which affect how QgsDataItem items behave within the application GU...
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
Base class for all items in the model.
Encapsulates the context in which a QgsDataItem is shown within the application GUI.
#define Q_NOWARN_DEPRECATED_POP
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
void setMessageBar(QgsMessageBar *bar)
Sets the associated message bar.
A model for showing available data sources and other items in a structured tree.
virtual Q_DECL_DEPRECATED bool handleDrop(const QMimeData *, Qt::DropAction)
Attempts to process the mime data dropped on this item.
Qt::ItemFlags flags(const QModelIndex &index) const override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
void setMessageBar(QgsMessageBar *bar)
Sets message bar that will be passed in QgsDataItemGuiContext to data items.
virtual Capabilities capabilities2() const
Returns the capabilities for the data item.