QGIS API Documentation  3.24.2-Tisler (13c1a02865)
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. More...
 
void setActiveIndex (const QModelIndex &index)
 Sets the selection to index and expands it. More...
 
void updateProjectHome ()
 Update project home directory. More...
 
- Public Slots inherited from QgsPanelWidget
void acceptPanel ()
 Accept the panel. More...
 
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. More...
 

Signals

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

Public Member Functions

 QgsBrowserWidget (QgsBrowserGuiModel *browserModel, QWidget *parent=nullptr)
 Constructor for QgsBrowserWidget. More...
 
 ~QgsBrowserWidget () override
 
QgsMessageBarmessageBar ()
 Returns the message bar associated with the widget. More...
 
void setDisabledDataItemsKeys (const QStringList &filter)
 Sets the customization for data items based on item's data provider key. More...
 
void setMessageBar (QgsMessageBar *bar)
 Sets a message bar to use alongside the widget. More...
 
- Public Member Functions inherited from QgsPanelWidget
 QgsPanelWidget (QWidget *parent=nullptr)
 Base class for any widget that can be shown as a inline panel. More...
 
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. More...
 
bool autoDelete ()
 The the auto delete property on the widget. More...
 
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. More...
 
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. More...
 
bool dockMode ()
 Returns the dock mode state. More...
 
virtual QMenu * menuButtonMenu ()
 Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required. More...
 
virtual QString menuButtonTooltip () const
 Returns the (translated) tooltip text to use for the menu button for this panel. More...
 
QString panelTitle ()
 The title of the panel. More...
 
void setAutoDelete (bool autoDelete)
 The the auto delete property on the widget. More...
 
virtual void setDockMode (bool dockMode)
 Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs. More...
 
void setPanelTitle (const QString &panelTitle)
 Set the title of the panel when shown in the interface. More...
 

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. More...
 

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. More...
 

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 53 of file qgsbrowserwidget.cpp.

◆ ~QgsBrowserWidget()

QgsBrowserWidget::~QgsBrowserWidget ( )
override

Definition at line 114 of file qgsbrowserwidget.cpp.

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 286 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 301 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 538 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 291 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 280 of file qgsbrowserwidget.cpp.

◆ showEvent()

void QgsBrowserWidget::showEvent ( QShowEvent *  event)
overrideprotected

Definition at line 122 of file qgsbrowserwidget.cpp.

◆ updateProjectHome

void QgsBrowserWidget::updateProjectHome ( )
slot

Update project home directory.

Note
Not available in Python bindings.

Definition at line 445 of file qgsbrowserwidget.cpp.

Friends And Related Function Documentation

◆ QgsBrowserDockWidget

friend class QgsBrowserDockWidget
friend

Definition at line 173 of file qgsbrowserwidget.h.


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