"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gui/vectortile/qgsvectortilebasiclabelingwidget.cpp" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

qgsvectortilebasiclabelingwidget.cpp  (QGIS-final-3_14_15):qgsvectortilebasiclabelingwidget.cpp  (QGIS-final-3_14_16)
skipping to change at line 348 skipping to change at line 348
viewStyles->selectionModel()->setCurrentIndex( mModel->index( rows, 0 ), QItem SelectionModel::ClearAndSelect ); viewStyles->selectionModel()->setCurrentIndex( mModel->index( rows, 0 ), QItem SelectionModel::ClearAndSelect );
} }
void QgsVectorTileBasicLabelingWidget::editStyle() void QgsVectorTileBasicLabelingWidget::editStyle()
{ {
editStyleAtIndex( viewStyles->selectionModel()->currentIndex() ); editStyleAtIndex( viewStyles->selectionModel()->currentIndex() );
} }
void QgsVectorTileBasicLabelingWidget::editStyleAtIndex( const QModelIndex &inde x ) void QgsVectorTileBasicLabelingWidget::editStyleAtIndex( const QModelIndex &inde x )
{ {
if ( index.row() < 0 || index.row() >= mLabeling->styles().count() )
return;
QgsVectorTileBasicLabelingStyle style = mLabeling->style( index.row() ); QgsVectorTileBasicLabelingStyle style = mLabeling->style( index.row() );
QgsPalLayerSettings labelSettings = style.labelSettings(); QgsPalLayerSettings labelSettings = style.labelSettings();
if ( labelSettings.layerType == QgsWkbTypes::UnknownGeometry ) if ( labelSettings.layerType == QgsWkbTypes::UnknownGeometry )
labelSettings.layerType = style.geometryType(); labelSettings.layerType = style.geometryType();
QgsSymbolWidgetContext context; QgsSymbolWidgetContext context;
context.setMapCanvas( mMapCanvas ); context.setMapCanvas( mMapCanvas );
context.setMessageBar( mMessageBar ); context.setMessageBar( mMessageBar );
skipping to change at line 371 skipping to change at line 374
if ( panel && panel->dockMode() ) if ( panel && panel->dockMode() )
{ {
QgsLabelingPanelWidget *widget = new QgsLabelingPanelWidget( labelSettings, vectorLayer, mMapCanvas, panel ); QgsLabelingPanelWidget *widget = new QgsLabelingPanelWidget( labelSettings, vectorLayer, mMapCanvas, panel );
widget->setContext( context ); widget->setContext( context );
widget->setPanelTitle( style.styleName() ); widget->setPanelTitle( style.styleName() );
connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsVectorTileBasicLa belingWidget::updateLabelingFromWidget ); connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsVectorTileBasicLa belingWidget::updateLabelingFromWidget );
openPanel( widget ); openPanel( widget );
} }
else else
{ {
// TODO: implement when adding support for vector tile layer properties dial QgsLabelSettingsDialog dlg( labelSettings, vectorLayer, mMapCanvas, this, la
og belSettings.layerType );
if ( dlg.exec() )
{
QgsVectorTileBasicLabelingStyle style = mLabeling->style( index.row() );
style.setLabelSettings( dlg.settings() );
mLabeling->setStyle( index.row(), style );
emit widgetChanged();
}
} }
} }
void QgsVectorTileBasicLabelingWidget::updateLabelingFromWidget() void QgsVectorTileBasicLabelingWidget::updateLabelingFromWidget()
{ {
int index = viewStyles->selectionModel()->currentIndex().row(); int index = viewStyles->selectionModel()->currentIndex().row();
if ( index < 0 )
return;
QgsVectorTileBasicLabelingStyle style = mLabeling->style( index ); QgsVectorTileBasicLabelingStyle style = mLabeling->style( index );
QgsLabelingPanelWidget *widget = qobject_cast<QgsLabelingPanelWidget *>( sende r() ); QgsLabelingPanelWidget *widget = qobject_cast<QgsLabelingPanelWidget *>( sende r() );
style.setLabelSettings( widget->labelSettings() ); style.setLabelSettings( widget->labelSettings() );
mLabeling->setStyle( index, style ); mLabeling->setStyle( index, style );
emit widgetChanged(); emit widgetChanged();
} }
void QgsVectorTileBasicLabelingWidget::removeStyle() void QgsVectorTileBasicLabelingWidget::removeStyle()
 End of changes. 3 change blocks. 
2 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)