QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
22 #include <QMessageBox>
85 bar->pushMessage( title, message, level, duration );
91 case Qgis::MessageLevel::Info:
92 case Qgis::MessageLevel::NoLevel:
94 QMessageBox::information( parent, title, message );
97 case Qgis::MessageLevel::Warning:
99 QMessageBox::warning( parent, title, message );
102 case Qgis::MessageLevel::Critical:
104 QMessageBox::critical( parent, title, message );
107 case Qgis::MessageLevel::Success:
110 QMessageBox::information( parent, title, message );
QgsMessageBar * messageBar() const
Returns the associated message bar.
virtual int precedenceWhenPopulatingMenus() const
Returns the provider's precedence to use when populating context menus via calls to populateContextMe...
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.
virtual bool handleDrop(QgsDataItem *item, QgsDataItemGuiContext context, const QMimeData *data, Qt::DropAction action)
Called when a user drops on an item.
virtual bool handleDoubleClick(QgsDataItem *item, QgsDataItemGuiContext context)
Called when a user double clicks on an item.
virtual QWidget * createParamWidget(QgsDataItem *item, QgsDataItemGuiContext context)
Creates source widget from data item for QgsBrowserPropertiesWidget By default it returns nullptr.
static void notify(const QString &title, const QString &message, QgsDataItemGuiContext context, Qgis::MessageLevel level=Qgis::MessageLevel::Info, int duration=-1, QWidget *parent=nullptr)
Notify the user showing a message with title and level If the context has a message bar the message w...
A bar for displaying non-blocking messages to the user.
Encapsulates the context in which a QgsDataItem is shown within the application GUI.
void setMessageBar(QgsMessageBar *bar)
Sets the associated message bar.
MessageLevel
Level for messages This will be used both for message log and message bar in application.
virtual bool acceptDrop(QgsDataItem *item, QgsDataItemGuiContext context)
Providers should return true if the drops are allowed (handleDrop() should be implemented in that cas...
Item that represents a layer that can be opened with one of the providers.
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...
Base class for all items in the model.
virtual bool deleteLayer(QgsLayerItem *item, QgsDataItemGuiContext context)
Tries to permanently delete map layer representing the given item.