Skip to content
Permalink
Browse files

Allow custom QgsDataItem types a chance to create a info widget

This allows plugin provided browser items a chance to create their
own information panel widgets
  • Loading branch information
nyalldawson committed Apr 27, 2020
1 parent 742e0c3 commit 18547ec25863504f0ebca0bc79bef7ff01e54e13
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/gui/qgsbrowserdockwidget_p.cpp
@@ -85,6 +85,7 @@ QgsBrowserPropertiesWidget::QgsBrowserPropertiesWidget( QWidget *parent )
void QgsBrowserPropertiesWidget::setWidget( QWidget *paramWidget )
{
QVBoxLayout *layout = new QVBoxLayout( this );
layout->setContentsMargins( 0, 0, 0, 0 );
paramWidget->setParent( this );
layout->addWidget( paramWidget );
}
@@ -99,7 +100,7 @@ QgsBrowserPropertiesWidget *QgsBrowserPropertiesWidget::createWidget( QgsDataIte
propertiesWidget = new QgsBrowserDirectoryProperties( parent );
propertiesWidget->setItem( item );
}
else if ( item->type() == QgsDataItem::Layer )
else if ( item->type() == QgsDataItem::Layer || item->type() == QgsDataItem::Custom )
{
// try new infrastructure of creation of layer widgets
QWidget *paramWidget = nullptr;
@@ -124,7 +125,7 @@ QgsBrowserPropertiesWidget *QgsBrowserPropertiesWidget::createWidget( QgsDataIte
propertiesWidget = new QgsBrowserPropertiesWidget( parent );
propertiesWidget->setWidget( paramWidget );
}
else
else if ( item->type() == QgsDataItem::Layer )
{
propertiesWidget = new QgsBrowserLayerProperties( parent );
propertiesWidget->setItem( item );

0 comments on commit 18547ec

Please sign in to comment.
You can’t perform that action at this time.