Skip to content
Permalink
Browse files

Fix random sort order of symbols in Symbol Export dialog

Fixes #20572
  • Loading branch information
nyalldawson committed May 23, 2020
1 parent 3961fa2 commit 987310fe90de2b21deb5c2564eb051e1d72548b2
@@ -66,6 +66,7 @@ QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle *style, QWidget
mGroupSelectionDlg = nullptr;
mTempFile = nullptr;

QgsStyle *dialogStyle = nullptr;
if ( mDialogMode == Import )
{
setWindowTitle( tr( "Import Item(s)" ) );
@@ -91,8 +92,7 @@ QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle *style, QWidget
label->setText( tr( "Select items to import" ) );
buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Import" ) );

mModel = new QgsStyleModel( mTempStyle.get(), this );
listItems->setModel( mModel );
dialogStyle = mTempStyle.get();
}
else
{
@@ -115,7 +115,7 @@ QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle *style, QWidget

buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Export" ) );

mModel = new QgsStyleModel( mStyle, this );
dialogStyle = mStyle;
}

#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
@@ -125,7 +125,10 @@ QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle *style, QWidget
#endif
listItems->setIconSize( QSize( static_cast< int >( iconSize ), static_cast< int >( iconSize * 0.9 ) ) ); // ~100, 90 on low dpi

mModel = new QgsStyleProxyModel( dialogStyle, this );

mModel->addDesiredIconSize( listItems->iconSize() );

listItems->setModel( mModel );

connect( listItems->selectionModel(), &QItemSelectionModel::selectionChanged,
@@ -30,7 +30,7 @@
class QgsStyle;
class QgsStyleGroupSelectionDialog;
class QgsTemporaryCursorOverride;
class QgsStyleModel;
class QgsStyleProxyModel;
class QTemporaryFile;

/**
@@ -148,7 +148,7 @@ class GUI_EXPORT QgsStyleExportImportDialog : public QDialog, private Ui::QgsSty
QString mFileName;
Mode mDialogMode;

QgsStyleModel *mModel = nullptr;
QgsStyleProxyModel *mModel = nullptr;

QgsStyle *mStyle = nullptr;
std::unique_ptr< QgsStyle > mTempStyle;

0 comments on commit 987310f

Please sign in to comment.
You can’t perform that action at this time.