mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Switch some dynamic_casts to qobject_casts
This commit is contained in:
parent
e7ddfff09d
commit
ed5e4b69c7
@ -79,7 +79,7 @@ void FieldSelectorDelegate::setEditorData( QWidget *editor, const QModelIndex &i
|
||||
|
||||
void FieldSelectorDelegate::setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const
|
||||
{
|
||||
QgsVectorLayerAndAttributeModel *m = dynamic_cast< QgsVectorLayerAndAttributeModel *>( model );
|
||||
QgsVectorLayerAndAttributeModel *m = qobject_cast< QgsVectorLayerAndAttributeModel *>( model );
|
||||
if ( !m )
|
||||
return;
|
||||
|
||||
@ -492,7 +492,7 @@ QgsDxfExportDialog::~QgsDxfExportDialog()
|
||||
void QgsDxfExportDialog::on_mVisibilityPresets_currentIndexChanged( int index )
|
||||
{
|
||||
Q_UNUSED( index );
|
||||
QgsVectorLayerAndAttributeModel *model = dynamic_cast< QgsVectorLayerAndAttributeModel * >( mTreeView->model() );
|
||||
QgsVectorLayerAndAttributeModel *model = qobject_cast< QgsVectorLayerAndAttributeModel * >( mTreeView->model() );
|
||||
Q_ASSERT( model );
|
||||
model->applyVisibilityPreset( mVisibilityPresets->currentText() );
|
||||
}
|
||||
@ -525,14 +525,14 @@ void QgsDxfExportDialog::cleanGroup( QgsLayerTreeNode *node )
|
||||
|
||||
void QgsDxfExportDialog::selectAll()
|
||||
{
|
||||
QgsVectorLayerAndAttributeModel *model = dynamic_cast< QgsVectorLayerAndAttributeModel *>( mTreeView->model() );
|
||||
QgsVectorLayerAndAttributeModel *model = qobject_cast< QgsVectorLayerAndAttributeModel *>( mTreeView->model() );
|
||||
Q_ASSERT( model );
|
||||
model->selectAll();
|
||||
}
|
||||
|
||||
void QgsDxfExportDialog::deSelectAll()
|
||||
{
|
||||
QgsVectorLayerAndAttributeModel *model = dynamic_cast< QgsVectorLayerAndAttributeModel *>( mTreeView->model() );
|
||||
QgsVectorLayerAndAttributeModel *model = qobject_cast< QgsVectorLayerAndAttributeModel *>( mTreeView->model() );
|
||||
Q_ASSERT( model );
|
||||
model->deSelectAll();
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ void QgsStatisticalSummaryDockWidget::updateStringStatistics( bool selectedOnly
|
||||
|
||||
void QgsStatisticalSummaryDockWidget::layerChanged( QgsMapLayer *layer )
|
||||
{
|
||||
QgsVectorLayer *newLayer = dynamic_cast< QgsVectorLayer * >( layer );
|
||||
QgsVectorLayer *newLayer = qobject_cast< QgsVectorLayer * >( layer );
|
||||
if ( mLayer && mLayer != newLayer )
|
||||
{
|
||||
disconnect( mLayer, &QgsVectorLayer::selectionChanged, this, &QgsStatisticalSummaryDockWidget::layerSelectionChanged );
|
||||
|
@ -3455,7 +3455,7 @@ static QVariant fcnGetLayerProperty( const QVariantList &values, const QgsExpres
|
||||
else
|
||||
{
|
||||
//vector layer methods
|
||||
QgsVectorLayer *vLayer = dynamic_cast< QgsVectorLayer * >( layer );
|
||||
QgsVectorLayer *vLayer = qobject_cast< QgsVectorLayer * >( layer );
|
||||
if ( vLayer )
|
||||
{
|
||||
if ( QString::compare( layerProperty, QStringLiteral( "storage_type" ), Qt::CaseInsensitive ) == 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user