Skip to content
Permalink
Browse files

Use symbolv2selectordialog to set style of overview map frame

  • Loading branch information
mhugent committed Jul 11, 2012
1 parent 53fc584 commit 71093ea8dd53eb7f7d3fc15a459d69db647edd38
Showing with 26 additions and 17 deletions.
  1. +8 −2 src/app/composer/qgscomposermapwidget.cpp
  2. +18 −15 src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
@@ -18,8 +18,10 @@
#include "qgscomposermapwidget.h"
#include "qgscomposeritemwidget.h"
#include "qgsmaprenderer.h"
#include "qgsstylev2.h"
#include "qgssymbolv2.h"
#include "qgssymbolv2propertiesdialog.h"
//#include "qgssymbolv2propertiesdialog.h"
#include "qgssymbolv2selectordialog.h"
#include "qgssymbollayerv2utils.h"
#include <QColorDialog>
#include <QFontDialog>
@@ -86,6 +88,7 @@ QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidg
}
}

updateOverviewSymbolMarker();

updateGuiElements();
blockAllSignals( false );
@@ -600,7 +603,10 @@ void QgsComposerMapWidget::on_mOverviewFrameStyleButton_clicked()
{
return;
}
QgsSymbolV2PropertiesDialog d( mComposerMap->overviewFrameMapSymbol(), 0, this );

QgsSymbolV2SelectorDialog d( mComposerMap->overviewFrameMapSymbol(), QgsStyleV2::defaultStyle(), 0 );

//QgsSymbolV2PropertiesDialog d( mComposerMap->overviewFrameMapSymbol(), 0, this );
if ( d.exec() == QDialog::Accepted )
{
updateOverviewSymbolMarker();
@@ -101,25 +101,28 @@ void QgsSymbolV2SelectorDialog::populateSymbolView()
}
model->clear();

QStringList names = mStyle->symbolNames();
for ( int i = 0; i < names.count(); i++ )
if ( mStyle )
{
QgsSymbolV2* s = mStyle->symbol( names[i] );
if ( s->type() != mSymbol->type() )
QStringList names = mStyle->symbolNames();
for ( int i = 0; i < names.count(); i++ )
{
QgsSymbolV2* s = mStyle->symbol( names[i] );
if ( s->type() != mSymbol->type() )
{
delete s;
continue;
}
QStandardItem* item = new QStandardItem( names[i] );
item->setData( names[i], Qt::UserRole ); //so we can show a label when it is clicked
item->setText( "" ); //set the text to nothing and show in label when clicked rather
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
// create preview icon
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( s, previewSize );
item->setIcon( icon );
// add to model
model->appendRow( item );
delete s;
continue;
}
QStandardItem* item = new QStandardItem( names[i] );
item->setData( names[i], Qt::UserRole ); //so we can show a label when it is clicked
item->setText( "" ); //set the text to nothing and show in label when clicked rather
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
// create preview icon
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( s, previewSize );
item->setIcon( icon );
// add to model
model->appendRow( item );
delete s;
}
}

0 comments on commit 71093ea

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