Пример #1
0
void QgsBrowserDirectoryProperties::setItem( QgsDataItem* item )
{
  QgsDirectoryItem* directoryItem = qobject_cast<QgsDirectoryItem*>( item );
  if ( !item )
    return;

  mPathLabel->setText( directoryItem->dirPath() );
  mDirectoryWidget = new QgsDirectoryParamWidget( directoryItem->dirPath(), this );
  mLayout->addWidget( mDirectoryWidget );
}
Пример #2
0
void QgsBrowserDockWidget::addFavorite()
{
  QModelIndex index = mProxyModel->mapToSource( mBrowserView->currentIndex() );
  QgsDataItem *item = mModel->dataItem( index );
  if ( !item )
    return;

  QgsDirectoryItem *dirItem = dynamic_cast<QgsDirectoryItem *>( item );
  if ( !dirItem )
    return;

  addFavoriteDirectory( dirItem->dirPath() );
}