[composer] Avoid hang when adding columns to table on Win (fix ##11462)

This commit is contained in:
Nyall Dawson 2014-10-22 19:39:02 +11:00
parent 6be9d08061
commit 5f9e45af49

6
src/app/composer/qgscomposerattributetablewidget.cpp Normal file → Executable file
View File

@ -179,10 +179,15 @@ void QgsComposerAttributeTableWidget::on_mAttributesPushButton_clicked()
composition->beginMultiFrameCommand( mComposerTable, tr( "Table attribute settings" ) );
}
//temporarily block updates for the window, to stop table trying to repaint under windows (#11462)
window()->setUpdatesEnabled( false );
QgsAttributeSelectionDialog d( mComposerTable, mComposerTable->sourceLayer(), 0 );
if ( d.exec() == QDialog::Accepted )
{
mComposerTable->refreshAttributes();
//safe to unblock updates
window()->setUpdatesEnabled( true );
mComposerTable->update();
if ( composition )
{
@ -197,6 +202,7 @@ void QgsComposerAttributeTableWidget::on_mAttributesPushButton_clicked()
{
//undo changes
mComposerTable->setColumns( currentColumns );
window()->setUpdatesEnabled( true );
if ( composition )
{
composition->cancelMultiFrameCommand();