31#include "moc_qgsbrowserdockwidget.cpp"
33using namespace Qt::StringLiterals;
38 QVBoxLayout *layout =
new QVBoxLayout();
39 layout->setContentsMargins( 0, 0, 0, 0 );
40 layout->setSpacing( 0 );
41 QWidget *container =
new QWidget();
42 container->setLayout( layout );
43 setWidget( container );
45 setWindowTitle( name );
48 layout->addWidget( mWidget );
64 mWidget->showContextMenu( pt );
69 const QModelIndex index = mWidget->mProxyModel->mapToSource( mWidget->mBrowserView->currentIndex() );
70 QgsDataItem *item = mWidget->mModel->dataItem( index );
85 const QString directory = QFileDialog::getExistingDirectory(
this, tr(
"Add directory to favorites" ) );
86 if ( !directory.isEmpty() )
96 mWidget->mModel->addFavoriteDirectory( favDir, name );
101 mWidget->setMessageBar( bar );
106 return mWidget->messageBar();
111 mWidget->setMapCanvas( canvas );
116 return mWidget->mapCanvas();
121 mWidget->setDisabledDataItemsKeys( filter );
126 mWidget->mModel->removeFavorite( mWidget->mProxyModel->mapToSource( mWidget->mBrowserView->currentIndex() ) );
131 mWidget->refreshModel( QModelIndex() );
136 QgsDebugMsgLevel( u
"rowCount() = %1"_s.arg( mWidget->mModel->rowCount( mWidget->mProxyModel->mapToSource( index ) ) ), 2 );
137 QgsDataItem *item = mWidget->mModel->dataItem( mWidget->mProxyModel->mapToSource( index ) );
141 QgsProjectItem *projectItem = qobject_cast<QgsProjectItem *>( item );
144 QApplication::setOverrideCursor( Qt::WaitCursor );
146 QApplication::restoreOverrideCursor();
152 QgsLayerItem *layerItem = qobject_cast<QgsLayerItem *>( item );
155 QApplication::setOverrideCursor( Qt::WaitCursor );
156 mWidget->addLayer( layerItem );
157 QApplication::restoreOverrideCursor();
166 mWidget->addSelectedLayers();
176 mWidget->showProperties();
181 const QModelIndex index = mWidget->mProxyModel->mapToSource( mWidget->mBrowserView->currentIndex() );
182 QgsDataItem *item = mWidget->mModel->dataItem( index );
189 const int idx = fastScanDirs.indexOf( item->
path() );
192 fastScanDirs.removeAt( idx );
196 fastScanDirs << item->
path();
204 mWidget->showFilterWidget( visible );
209 mWidget->setFilter();
214 mWidget->updateProjectHome();
219 mWidget->setFilterSyntax( action );
224 mWidget->setCaseSensitive( caseSensitive );
229 mWidget->selectionChanged( selected, deselected );
234 mWidget->enablePropertiesWidget( enable );
239 mWidget->setActiveIndex( index );
@ Layer
Represents a map layer.
@ Project
Represents a QGIS project.
@ Directory
Represents a file directory.
A model for showing available data sources and other items in a structured tree.
Base class for all items in the model.
Qgis::BrowserItemType type() const
A browser item for directories: contains subdirectories and layers.
QString dirPath() const
Returns the full path to the directory the item represents.
A browser item that represents a layer that can be opened with one of the providers.
Map canvas is a class for displaying all GIS data types on a canvas.
A bar for displaying non-blocking messages to the user.
Data item that can be used to represent QGIS projects.
static const QgsSettingsEntryStringList * settingsScanItemsFastScanUris
Settings entry for fast scan URIs in browser.
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH
#define QgsDebugMsgLevel(str, level)