94 bar->pushMessage( title, message, level, duration );
103 QMessageBox::information( parent, title, message );
108 QMessageBox::warning( parent, title, message );
113 QMessageBox::critical( parent, title, message );
119 QMessageBox::information( parent, title, message );
MessageLevel
Level for messages This will be used both for message log and message bar in application.
@ Warning
Warning message.
@ Critical
Critical/error message.
@ Info
Information message.
@ Success
Used for reporting a successful operation.
The QgsBrowserTreeView class extends QTreeView with save/restore tree state functionality.
Encapsulates the context in which a QgsDataItem is shown within the application GUI.
void setView(QgsBrowserTreeView *view)
Sets the associated view.
QgsMessageBar * messageBar() const
Returns the associated message bar.
QgsBrowserTreeView * view() const
Returns the associated view.
void setMessageBar(QgsMessageBar *bar)
Sets the associated message bar.
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...
virtual bool handleDrop(QgsDataItem *item, QgsDataItemGuiContext context, const QMimeData *data, Qt::DropAction action)
Called when a user drops on an item.
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...
virtual int precedenceWhenPopulatingMenus() const
Returns the provider's precedence to use when populating context menus via calls to populateContextMe...
virtual bool acceptDrop(QgsDataItem *item, QgsDataItemGuiContext context)
Providers should return true if the drops are allowed (handleDrop() should be implemented in that cas...
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.
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 deleteLayer(QgsLayerItem *item, QgsDataItemGuiContext context)
Tries to permanently delete map layer representing the given item.
Base class for all items in the model.
Item that represents a layer that can be opened with one of the providers.
A bar for displaying non-blocking messages to the user.