@@ -139,10 +139,9 @@ void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel* filterModel
139139 connect ( mFeatureSelectionModel , SIGNAL ( requestRepaint ( QModelIndexList ) ), this , SLOT ( repaintRequested ( QModelIndexList ) ) );
140140 connect ( mFeatureSelectionModel , SIGNAL ( requestRepaint () ), this , SLOT ( repaintRequested () ) );
141141
142- delete mActionWidget ;
143- mActionWidget = createActionWidget ( 0 );
142+ mActionWidget .reset ( createActionWidget ( 0 ) );
144143 mActionWidget ->setVisible ( false );
145- updateActionImage ( mActionWidget );
144+ updateActionImage ( mActionWidget . data () );
146145 }
147146}
148147
@@ -167,13 +166,13 @@ QWidget* QgsAttributeTableView::createActionWidget( QgsFeatureId fid )
167166
168167 if ( attributeTableConfig.actionWidgetStyle () == QgsAttributeTableConfig::DropDown )
169168 {
170- toolButton = new QToolButton ( this );
169+ toolButton = new QToolButton ();
171170 toolButton->setPopupMode ( QToolButton::MenuButtonPopup );
172171 container = toolButton;
173172 }
174173 else
175174 {
176- container = new QWidget ( this );
175+ container = new QWidget ();
177176 container->setLayout ( new QHBoxLayout () );
178177 container->layout ()->setMargin ( 0 );
179178 }
@@ -400,7 +399,7 @@ void QgsAttributeTableView::columnSizeChanged( int index, int oldWidth, int newW
400399 if ( mFilterModel ->actionColumnIndex () == index )
401400 {
402401 mActionWidget ->resize ( newWidth, mActionWidget ->height () );
403- updateActionImage ( mActionWidget );
402+ updateActionImage ( mActionWidget . data () );
404403 }
405404 emit columnResized ( index, newWidth );
406405}
0 commit comments