QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
QgsBrowserWidget Class Reference

A widget showing a browser tree view along with toolbar and toggleable properties pane. More...

#include <qgsbrowserwidget.h>

Inheritance diagram for QgsBrowserWidget:
Inheritance graph
[legend]

Public Slots

void refresh ()
 Refreshes the browser model and view.
 
void setActiveIndex (const QModelIndex &index)
 Sets the selection to index and expands it.
 
void updateProjectHome ()
 Update project home directory.
 
- Public Slots inherited from QgsPanelWidget
void acceptPanel ()
 Accept the panel.
 
void openPanel (QgsPanelWidget *panel)
 Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the showPanel signal for connected slots to handle the open event.
 

Signals

void connectionsChanged ()
 Connections changed in the browser.
 
void handleDropUriList (const QgsMimeDataUtils::UriList &)
 Emitted when drop uri list needs to be handled.
 
void openFile (const QString &fileName, const QString &fileTypeHint=QString())
 Emitted when a file needs to be opened.
 
- Signals inherited from QgsPanelWidget
void panelAccepted (QgsPanelWidget *panel)
 Emitted when the panel is accepted by the user.
 
void showPanel (QgsPanelWidget *panel)
 Emit when you require a panel to be show in the interface.
 
void widgetChanged ()
 Emitted when the widget state changes.
 

Public Member Functions

 QgsBrowserWidget (QgsBrowserGuiModel *browserModel, QWidget *parent=nullptr)
 Constructor for QgsBrowserWidget.
 
 ~QgsBrowserWidget () override
 
QgsMessageBarmessageBar ()
 Returns the message bar associated with the widget.
 
void setDisabledDataItemsKeys (const QStringList &filter)
 Sets the customization for data items based on item's data provider key.
 
void setMessageBar (QgsMessageBar *bar)
 Sets a message bar to use alongside the widget.
 
- Public Member Functions inherited from QgsPanelWidget
 QgsPanelWidget (QWidget *parent=nullptr)
 Base class for any widget that can be shown as a inline panel.
 
virtual bool applySizeConstraintsToStack () const
 Returns true if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.
 
bool autoDelete ()
 The the auto delete property on the widget.
 
void connectChildPanel (QgsPanelWidget *panel)
 Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
 
void connectChildPanels (const QList< QgsPanelWidget * > &panels)
 Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.
 
bool dockMode ()
 Returns the dock mode state.
 
virtual QMenu * menuButtonMenu ()
 Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required.
 
virtual QString menuButtonTooltip () const
 Returns the (translated) tooltip text to use for the menu button for this panel.
 
QString panelTitle ()
 The title of the panel.
 
void setAutoDelete (bool autoDelete)
 The the auto delete property on the widget.
 
virtual void setDockMode (bool dockMode)
 Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
 
void setPanelTitle (const QString &panelTitle)
 Set the title of the panel when shown in the interface.
 

Protected Member Functions

void showEvent (QShowEvent *event) override
 
- Protected Member Functions inherited from QgsPanelWidget
void keyPressEvent (QKeyEvent *event) override
 Overridden key press event to handle the esc event on the widget.
 

Friends

class QgsBrowserDockWidget
 

Additional Inherited Members

- Static Public Member Functions inherited from QgsPanelWidget
static QgsPanelWidgetfindParentPanel (QWidget *widget)
 Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.
 

Detailed Description

A widget showing a browser tree view along with toolbar and toggleable properties pane.

Since
QGIS 3.22

Definition at line 39 of file qgsbrowserwidget.h.

Constructor & Destructor Documentation

◆ QgsBrowserWidget()

QgsBrowserWidget::QgsBrowserWidget ( QgsBrowserGuiModel browserModel,
QWidget *  parent = nullptr 
)
explicit

Constructor for QgsBrowserWidget.

Parameters
browserModelinstance of the (shared) browser model
parentparent widget

Definition at line 54 of file qgsbrowserwidget.cpp.

◆ ~QgsBrowserWidget()

QgsBrowserWidget::~QgsBrowserWidget ( )
overridedefault

Member Function Documentation

◆ connectionsChanged

void QgsBrowserWidget::connectionsChanged ( )
signal

Connections changed in the browser.

◆ handleDropUriList

void QgsBrowserWidget::handleDropUriList ( const QgsMimeDataUtils::UriList )
signal

Emitted when drop uri list needs to be handled.

◆ messageBar()

QgsMessageBar * QgsBrowserWidget::messageBar ( )

Returns the message bar associated with the widget.

See also
setMessageBar()

Definition at line 269 of file qgsbrowserwidget.cpp.

◆ openFile

void QgsBrowserWidget::openFile ( const QString &  fileName,
const QString &  fileTypeHint = QString() 
)
signal

Emitted when a file needs to be opened.

◆ refresh

void QgsBrowserWidget::refresh ( )
slot

Refreshes the browser model and view.

Definition at line 284 of file qgsbrowserwidget.cpp.

◆ setActiveIndex

void QgsBrowserWidget::setActiveIndex ( const QModelIndex &  index)
slot

Sets the selection to index and expands it.

Note
Not available in Python bindings.

Definition at line 530 of file qgsbrowserwidget.cpp.

◆ setDisabledDataItemsKeys()

void QgsBrowserWidget::setDisabledDataItemsKeys ( const QStringList &  filter)

Sets the customization for data items based on item's data provider key.

By default browser model shows all items from all available data items provider and few special items (e.g. Favorites). To customize the behavior, set the filter to not load certain data items. The items that are not based on data item providers (e.g. Favorites, Home) have prefix "special:"

Used in the proxy browser model to hide items

Definition at line 274 of file qgsbrowserwidget.cpp.

◆ setMessageBar()

void QgsBrowserWidget::setMessageBar ( QgsMessageBar bar)

Sets a message bar to use alongside the widget.

Setting this allows items to utilize the message bar to provide non-blocking feedback to users, e.g. success or failure of actions.

See also
messageBar()

Definition at line 263 of file qgsbrowserwidget.cpp.

◆ showEvent()

void QgsBrowserWidget::showEvent ( QShowEvent *  event)
overrideprotected

Definition at line 117 of file qgsbrowserwidget.cpp.

◆ updateProjectHome

void QgsBrowserWidget::updateProjectHome ( )
slot

Update project home directory.

Note
Not available in Python bindings.

Definition at line 428 of file qgsbrowserwidget.cpp.

Friends And Related Symbol Documentation

◆ QgsBrowserDockWidget

friend class QgsBrowserDockWidget
friend

Definition at line 172 of file qgsbrowserwidget.h.


The documentation for this class was generated from the following files: