1
/***************************************************************************
2
qgssinglesymboldialog.cpp - description
5
copyright : (C) 2003 by Marco Hugentobler
6
email : mhugent@geo.unizh.ch
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
19
#include "qgssinglesymboldialog.h"
20
#include "qgsmarkercatalogue.h"
21
#include "qgssinglesymbolrenderer.h"
23
#include "qgssymbol.h"
24
#include "qgssymbologyutils.h"
25
#include "qgsvectorlayer.h"
26
#include "qgsvectordataprovider.h"
27
#include "qgslogger.h"
29
#include <QColorDialog>
32
#include <QFileDialog>
33
#include <QListWidgetItem>
36
#define DO_NOT_USE_STR "<off>"
38
QgsSingleSymbolDialog::QgsSingleSymbolDialog(): QDialog(), mVectorLayer( 0 )
41
QgsDebugMsg( "entered." );
44
QgsSingleSymbolDialog::QgsSingleSymbolDialog( QgsVectorLayer * layer, bool disabled ): QDialog(), mVectorLayer( layer ), mDisabled( disabled )
47
QgsDebugMsg( "entered." );
50
//set point symbol list
53
// If this layer doesn't have points, break out of the following
54
// two loops after the first iteration. This gives one point
55
// symbol in the dialog, etc so that other code can rely on such a
56
// fact, but avoids the long time required to load all of the
57
// available symbols when they are not needed.
59
// NOTE BY Tim: I think the note above and the break out in the
60
// loops can be removed now with changes I have made to use combo
61
// boxes for line style and fill style...test and remove if poss.
63
QAction *refreshAction = new QAction( tr( "Refresh markers" ), lstSymbols );
64
lstSymbols->addAction( refreshAction );
65
connect( refreshAction, SIGNAL( triggered() ), QgsMarkerCatalogue::instance(), SLOT( refreshList() ) );
66
connect( QgsMarkerCatalogue::instance(), SIGNAL( markersRefreshed() ), this, SLOT( refreshMarkers() ) );
67
lstSymbols->setContextMenuPolicy( Qt::ActionsContextMenu );
69
//do the signal/slot connections
70
connect( btnOutlineColor, SIGNAL( clicked() ), this, SLOT( selectOutlineColor() ) );
71
connect( btnFillColor, SIGNAL( clicked() ), this, SLOT( selectFillColor() ) );
72
connect( outlinewidthspinbox, SIGNAL( valueChanged( double ) ), this, SLOT( resendSettingsChanged() ) );
73
connect( mLabelEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( resendSettingsChanged() ) );
74
connect( lstSymbols, SIGNAL( currentItemChanged( QListWidgetItem *, QListWidgetItem * ) ),
75
this, SLOT( symbolChanged( QListWidgetItem *, QListWidgetItem * ) ) );
76
connect( mPointSizeSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( resendSettingsChanged() ) );
77
connect( mPointSizeUnitsCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( resendSettingsChanged() ) );
78
connect( mRotationClassificationComboBox, SIGNAL( currentIndexChanged( const QString & ) ),
79
this, SLOT( resendSettingsChanged() ) );
80
connect( mScaleClassificationComboBox, SIGNAL( currentIndexChanged( const QString & ) ),
81
this, SLOT( resendSettingsChanged() ) );
82
connect( mSymbolComboBox, SIGNAL( currentIndexChanged( const QString & ) ),
83
this, SLOT( resendSettingsChanged() ) );
84
connect( cboOutlineStyle, SIGNAL(
85
currentIndexChanged( const QString & ) ), this, SLOT( resendSettingsChanged() ) );
86
connect( cboFillStyle, SIGNAL(
87
currentIndexChanged( const QString & ) ), this, SLOT( resendSettingsChanged() ) );
88
//need this to deal with when texture fill is selected or deselected
89
connect( cboFillStyle, SIGNAL(
90
currentIndexChanged( int ) ), this, SLOT( fillStyleChanged( int ) ) );
91
connect( toolSelectTexture, SIGNAL( clicked() ), this, SLOT( selectTextureImage() ) );
96
void QgsSingleSymbolDialog::refreshMarkers()
98
lstSymbols->blockSignals( true );
101
QPen pen( QColor( 0, 0, 255 ) );
102
QBrush brush( QColor( 220, 220, 220 ), Qt::SolidPattern );
105
QStringList ml = QgsMarkerCatalogue::instance()->list();
106
for ( QStringList::iterator it = ml.begin(); it != ml.end(); ++it )
108
QPixmap myPixmap = QPixmap::fromImage( QgsMarkerCatalogue::instance()->imageMarker( *it, size, pen, brush ) );
109
QListWidgetItem * mypItem = new QListWidgetItem( lstSymbols );
111
myIcon.addPixmap( myPixmap );
112
mypItem->setIcon( myIcon );
113
mypItem->setText( "" );
114
mypItem->setToolTip( *it );
115
//store the symbol offset in the UserData role for later retrieval
116
mypItem->setData( Qt::UserRole, *it );
117
mypItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
118
if ( mVectorLayer && mVectorLayer->geometryType() != QGis::Point )
125
// Find out the numerical fields of mVectorLayer, and populate the ComboBoxes
126
QgsVectorDataProvider *provider = mVectorLayer->dataProvider();
129
const QgsFieldMap & fields = provider->fields();
132
mRotationClassificationComboBox->addItem( DO_NOT_USE_STR, -1 );
133
mScaleClassificationComboBox->addItem( DO_NOT_USE_STR, -1 );
134
mSymbolComboBox->addItem( DO_NOT_USE_STR, -1 );
135
for ( QgsFieldMap::const_iterator it = fields.begin();
139
QVariant::Type type = ( *it ).type();
140
if ( type == QVariant::Int || type == QVariant::Double )
142
mRotationClassificationComboBox->addItem( it->name(), it.key() );
143
mScaleClassificationComboBox->addItem( it->name(), it.key() );
145
else if ( type == QVariant::String )
147
mSymbolComboBox->addItem( it->name(), it.key() );
153
QgsDebugMsg( "Warning, data provider is null" );
157
//set outline / line style
159
cboOutlineStyle->addItem( QIcon( QgsSymbologyUtils::char2LinePixmap( "SolidLine" ) ), "", "SolidLine" );
160
cboOutlineStyle->addItem( QIcon( QgsSymbologyUtils::char2LinePixmap( "DashLine" ) ), "", "DashLine" );
161
cboOutlineStyle->addItem( QIcon( QgsSymbologyUtils::char2LinePixmap( "DotLine" ) ), "", "DotLine" );
162
cboOutlineStyle->addItem( QIcon( QgsSymbologyUtils::char2LinePixmap( "DashDotLine" ) ), "" , "DashDotLine" );
163
cboOutlineStyle->addItem( QIcon( QgsSymbologyUtils::char2LinePixmap( "DashDotDotLine" ) ), "", "DashDotDotLine" );
164
cboOutlineStyle->addItem( QIcon( QgsSymbologyUtils::char2LinePixmap( "NoPen" ) ), tr( "None" ), "NoPen" );
167
//set pattern icons and state
169
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "SolidPattern" ) ), "", "SolidPattern" );
170
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "HorPattern" ) ), "", "HorPattern" );
171
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "VerPattern" ) ), "", "VerPattern" );
172
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "CrossPattern" ) ), "", "CrossPattern" );
173
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "BDiagPattern" ) ), "", "BDiagPattern" );
174
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "FDiagPattern" ) ), "", "FDiagPattern" );
175
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "DiagCrossPattern" ) ), "", "DiagCrossPattern" );
176
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "Dense1Pattern" ) ), "", "Dense1Pattern" );
177
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "Dense2Pattern" ) ), "", "Dense2Pattern" );
178
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "Dense3Pattern" ) ), "", "Dense3Pattern" );
179
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "Dense4Pattern" ) ), "", "Dense4Pattern" );
180
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "Dense5Pattern" ) ), "", "Dense5Pattern" );
181
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "Dense6Pattern" ) ), "", "Dense6Pattern" );
182
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "Dense7Pattern" ) ), "", "Dense7Pattern" );
183
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "NoBrush" ) ), tr( "None" ), "NoBrush" );
184
cboFillStyle->addItem( QIcon( QgsSymbologyUtils::char2PatternPixmap( "TexturePattern" ) ), tr( "Texture" ), "TexturePattern" );
186
if ( mVectorLayer && mVectorLayer->geometryType() != QGis::Point )
188
mGroupPoint->setVisible( false );
189
mGroupPoint->setEnabled( false );
190
mGroupDrawingByField->setVisible( false );
191
mGroupDrawingByField->setEnabled( false );
202
const QgsSingleSymbolRenderer *renderer = dynamic_cast<const QgsSingleSymbolRenderer *>( mVectorLayer->renderer() );
206
// Set from the existing renderer
207
set( renderer->symbols().first() );
211
// Take values from an example instance
212
QgsSingleSymbolRenderer exampleRenderer = QgsSingleSymbolRenderer( mVectorLayer->geometryType() );
213
set( exampleRenderer.symbols().first() );
218
QgsDebugMsg( "Warning, layer is a null pointer" );
222
lstSymbols->blockSignals( false );
225
QgsSingleSymbolDialog::~QgsSingleSymbolDialog()
227
QgsDebugMsg( "entered." );
230
void QgsSingleSymbolDialog::selectOutlineColor()
232
QColor c = QColorDialog::getColor( btnOutlineColor->color(), this );
236
btnOutlineColor->setColor( c );
237
emit settingsChanged();
243
void QgsSingleSymbolDialog::selectFillColor()
245
QColor c = QColorDialog::getColor( btnFillColor->color(), this );
249
btnFillColor->setColor( c );
250
emit settingsChanged();
256
//should this method have a different name?
257
void QgsSingleSymbolDialog::selectTextureImage()
259
QString fileName = QFileDialog::getOpenFileName( this, "Open File",
261
"Images (*.png *.xpm *.jpg)" ); //should we allow other types of images?
263
if ( fileName.isNull() == false )
264
{ //only process the string if the user clicked OK
265
mTexturePath = fileName;
266
resendSettingsChanged();
270
void QgsSingleSymbolDialog::apply( QgsSymbol *sy )
272
//query the values of the widgets and set the symbology of the vector layer
273
if ( btnFillColor->isEnabled() )
274
sy->setFillColor( btnFillColor->color() );
276
if ( outlinewidthspinbox->isEnabled() )
277
sy->setLineWidth( outlinewidthspinbox->value() );
279
if ( btnOutlineColor->isEnabled() )
280
sy->setColor( btnOutlineColor->color() );
283
// Apply point symbol
285
if ( lstSymbols->isEnabled() && lstSymbols->currentItem() )
287
sy->setNamedPointSymbol( lstSymbols->currentItem()->data( Qt::UserRole ).toString() ) ;
290
if ( mPointSizeSpinBox->isEnabled() )
291
sy->setPointSize( mPointSizeSpinBox->value() );
293
if ( mPointSizeUnitsCheckBox->isEnabled() )
294
sy->setPointSizeUnits( mPointSizeUnitsCheckBox->isChecked() );
296
std::map<QString, int>::iterator iter;
297
if ( mRotationClassificationComboBox->isEnabled() )
299
sy->setRotationClassificationField( mRotationClassificationComboBox->itemData( mRotationClassificationComboBox->currentIndex() ).toInt() );
302
if ( mScaleClassificationComboBox->isEnabled() )
304
sy->setScaleClassificationField( mScaleClassificationComboBox->itemData( mScaleClassificationComboBox->currentIndex() ).toInt() );
307
if ( mSymbolComboBox->isEnabled() )
309
sy->setSymbolField( mSymbolComboBox->itemData( mSymbolComboBox->currentIndex() ).toInt() );
313
// Apply the line style
315
if ( cboOutlineStyle->isEnabled() )
317
QString myLineStyle =
318
cboOutlineStyle->itemData( cboOutlineStyle->currentIndex(), Qt::UserRole ).toString();
319
sy->setLineStyle( QgsSymbologyUtils::qString2PenStyle( myLineStyle ) );
326
//Store the file path, and set the brush to TexturePattern. If we have a different button selected,
327
// the below code will override it, but leave the file path alone.
329
sy->setCustomTexture( mTexturePath );
331
if ( cboFillStyle->isEnabled() )
333
QString myFillStyle =
334
cboFillStyle->itemData( cboFillStyle->currentIndex(), Qt::UserRole ).toString();
335
sy->setFillStyle( QgsSymbologyUtils::qString2BrushStyle( myFillStyle ) );
338
if ( mLabelEdit->isEnabled() )
339
sy->setLabel( mLabelEdit->text() );
342
void QgsSingleSymbolDialog::apply()
344
QgsSymbol* sy = new QgsSymbol( mVectorLayer->geometryType() );
347
QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( mVectorLayer->geometryType() );
348
renderer->addSymbol( sy );
349
renderer->updateSymbolAttributes();
351
mVectorLayer->setRenderer( renderer );
354
void QgsSingleSymbolDialog::unset()
356
mLabelEdit->setEnabled( false );
357
lstSymbols->setEnabled( false );
358
mPointSizeSpinBox->setEnabled( false );
359
mPointSizeUnitsCheckBox->setEnabled( false );
360
mRotationClassificationComboBox->setEnabled( false );
361
mScaleClassificationComboBox->setEnabled( false );
362
mSymbolComboBox->setEnabled( false );
363
outlinewidthspinbox->setEnabled( false );
364
btnOutlineColor->setEnabled( false );
365
cboOutlineStyle->setEnabled( false );
367
cboFillStyle->setEnabled( false );
368
btnFillColor->setEnabled( false );
371
void QgsSingleSymbolDialog::set( const QgsSymbol *sy )
374
mLabelEdit->setText( sy->label() );
377
QString mySymbolName = sy->pointSymbolName();
378
for ( int i = 0; i < lstSymbols->count(); ++i )
380
if ( lstSymbols->item( i )->data( Qt::UserRole ).toString() == ( mySymbolName ) )
382
lstSymbols->setCurrentItem( lstSymbols->item( i ) );
383
lstSymbols->item( i )->setBackground( QBrush( Qt::cyan ) );
387
mPointSizeSpinBox->setValue( sy->pointSize() );
388
mPointSizeUnitsCheckBox->setChecked( sy->pointSizeUnits() );
392
index = mRotationClassificationComboBox->findData( sy->rotationClassificationField() );
393
mRotationClassificationComboBox->setCurrentIndex( index < 0 ? 0 : index );
395
index = mScaleClassificationComboBox->findData( sy->scaleClassificationField() );
396
mScaleClassificationComboBox->setCurrentIndex( index < 0 ? 0 : index );
398
index = mSymbolComboBox->findData( sy->symbolField() );
399
mSymbolComboBox->setCurrentIndex( index < 0 ? 0 : index );
401
outlinewidthspinbox->setValue( sy->pen().widthF() );
403
//set line width 1 as minimum to avoid confusion between line width 0 and no pen line style
404
// ... but, drawLine is not correct with width > 0 -> until solved set to 0
405
outlinewidthspinbox->setMinimum( 0 );
407
btnFillColor->setColor( sy->brush().color() );
409
btnOutlineColor->setColor( sy->pen().color() );
411
//load the icons stored in QgsSymbologyUtils.cpp (to avoid redundancy)
414
// Set the line style combo
417
QPen myPen = sy->pen();
418
QString myLineStyle = QgsSymbologyUtils::penStyle2QString( myPen.style() );
419
for ( int i = 0; i < cboOutlineStyle->count(); ++i )
421
if ( cboOutlineStyle->itemData( i, Qt::UserRole ).toString() == myLineStyle )
423
cboOutlineStyle->setCurrentIndex( i );
429
// Set the brush combo
432
QBrush myBrush = sy->brush();
433
QString myFillStyle = QgsSymbologyUtils::brushStyle2QString( myBrush.style() );
434
for ( int i = 0; i < cboFillStyle->count(); ++i )
436
if ( cboFillStyle->itemData( i, Qt::UserRole ).toString() == myFillStyle )
438
cboFillStyle->setCurrentIndex( i );
443
//get and show the file path, even if we aren't using it.
444
mTexturePath = sy->customTexture();
445
//if the file path isn't empty, show the image on the button
446
if ( sy->customTexture().size() > 0 )
448
//show the current texture image
449
// texture->setPixmap(QPixmap(sy->customTexture()));
453
//show the default question mark
454
//texture->setPixmap(QgsSymbologyUtils::char2PatternPixmap("TexturePattern"));
457
mLabelEdit->setEnabled( true );
458
lstSymbols->setEnabled( true );
459
mPointSizeSpinBox->setEnabled( true );
460
mPointSizeUnitsCheckBox->setEnabled( true );
461
mRotationClassificationComboBox->setEnabled( true );
462
mScaleClassificationComboBox->setEnabled( true );
463
mSymbolComboBox->setEnabled( true );
464
outlinewidthspinbox->setEnabled( true );
465
btnOutlineColor->setEnabled( true );
466
cboOutlineStyle->setEnabled( true );
468
if ( mVectorLayer && mVectorLayer->geometryType() != QGis::Line )
470
btnFillColor->setEnabled( true );
471
cboFillStyle->setEnabled( true );
475
void QgsSingleSymbolDialog::updateSet( const QgsSymbol *sy )
477
if ( mLabelEdit->isEnabled() && mLabelEdit->text() != sy->label() )
478
mLabelEdit->setEnabled( false );
480
if ( lstSymbols->isEnabled() && lstSymbols->currentItem()->data( Qt::UserRole ).toString() != sy->pointSymbolName() )
481
lstSymbols->setEnabled( false );
483
if ( mPointSizeSpinBox->isEnabled() && !doubleNear( mPointSizeSpinBox->value(), sy->pointSize() ) )
484
mPointSizeSpinBox->setEnabled( false );
486
if ( mPointSizeUnitsCheckBox->isEnabled() && mPointSizeUnitsCheckBox->isChecked() != sy->pointSizeUnits() )
487
mPointSizeUnitsCheckBox->setEnabled( false );
489
if ( mRotationClassificationComboBox->isEnabled() &&
490
mRotationClassificationComboBox->itemData( mRotationClassificationComboBox->currentIndex() ).toInt() != sy->rotationClassificationField() )
491
mRotationClassificationComboBox->setEnabled( false );
493
if ( mScaleClassificationComboBox->isEnabled() &&
494
mScaleClassificationComboBox->itemData( mScaleClassificationComboBox->currentIndex() ).toInt() != sy->scaleClassificationField() )
495
mScaleClassificationComboBox->setEnabled( false );
497
if ( mSymbolComboBox->isEnabled() &&
498
mSymbolComboBox->itemData( mSymbolComboBox->currentIndex() ).toInt() != sy->symbolField() )
499
mSymbolComboBox->setEnabled( false );
501
if ( outlinewidthspinbox->isEnabled() && !doubleNear( outlinewidthspinbox->value(), sy->pen().widthF() ) )
502
outlinewidthspinbox->setEnabled( false );
504
if ( btnFillColor->isEnabled() && btnFillColor->color() != sy->brush().color() )
505
btnFillColor->setEnabled( false );
507
if ( btnOutlineColor->isEnabled() && btnOutlineColor->color() != sy->pen().color() )
508
btnOutlineColor->setEnabled( false );
510
if ( cboOutlineStyle->isEnabled() )
512
QPen myPen = sy->pen();
513
QString myLineStyle = QgsSymbologyUtils::penStyle2QString( myPen.style() );
514
if ( cboOutlineStyle->itemData( cboOutlineStyle->currentIndex(), Qt::UserRole ).toString() != myLineStyle )
515
cboOutlineStyle->setEnabled( false );
518
if ( cboFillStyle->isEnabled() )
520
QBrush myBrush = sy->brush();
521
QString myFillStyle = QgsSymbologyUtils::brushStyle2QString( myBrush.style() );
522
if ( cboFillStyle->itemData( cboFillStyle->currentIndex(), Qt::UserRole ).toString() != myFillStyle )
523
cboFillStyle->setEnabled( false );
527
void QgsSingleSymbolDialog::setOutlineColor( QColor& c )
529
btnOutlineColor->setColor( c );
532
void QgsSingleSymbolDialog::setOutlineStyle( Qt::PenStyle pstyle )
534
QString myLineStyle = QgsSymbologyUtils::penStyle2QString( pstyle );
535
for ( int i = 0; i < cboOutlineStyle->count(); ++i )
537
if ( cboOutlineStyle->itemData( i, Qt::UserRole ).toString() == myLineStyle )
539
cboOutlineStyle->setCurrentIndex( i );
545
void QgsSingleSymbolDialog::setFillColor( QColor& c )
547
btnFillColor->setColor( c );
550
void QgsSingleSymbolDialog::setFillStyle( Qt::BrushStyle fstyle )
552
QgsDebugMsg( QString( "Setting fill style: %1" ).arg( QgsSymbologyUtils::brushStyle2QString( fstyle ) ) );
554
QString myFillStyle = QgsSymbologyUtils::brushStyle2QString( fstyle );
555
for ( int i = 0; i < cboFillStyle->count(); ++i )
557
if ( cboFillStyle->itemData( i, Qt::UserRole ).toString() == myFillStyle )
559
cboFillStyle->setCurrentIndex( i );
565
void QgsSingleSymbolDialog::setOutlineWidth( double width )
567
outlinewidthspinbox->setValue( width );
570
QColor QgsSingleSymbolDialog::getOutlineColor()
572
return btnOutlineColor->color();
575
Qt::PenStyle QgsSingleSymbolDialog::getOutlineStyle()
577
QString myLineStyle =
578
cboOutlineStyle->itemData( cboOutlineStyle->currentIndex(), Qt::UserRole ).toString();
579
return QgsSymbologyUtils::qString2PenStyle( myLineStyle );
582
double QgsSingleSymbolDialog::getOutlineWidth()
584
return outlinewidthspinbox->value();
587
QColor QgsSingleSymbolDialog::getFillColor()
589
return btnFillColor->color();
592
Qt::BrushStyle QgsSingleSymbolDialog::getFillStyle()
594
QString myFillStyle =
595
cboFillStyle->itemData( cboFillStyle->currentIndex(), Qt::UserRole ).toString();
596
return QgsSymbologyUtils::qString2BrushStyle( myFillStyle );
599
void QgsSingleSymbolDialog::resendSettingsChanged()
601
emit settingsChanged();
604
QString QgsSingleSymbolDialog::label()
606
return mLabelEdit->text();
609
void QgsSingleSymbolDialog::setLabel( QString label )
611
mLabelEdit->setText( label );
614
void QgsSingleSymbolDialog::symbolChanged
615
( QListWidgetItem * current, QListWidgetItem * previous )
617
current->setBackground( QBrush( Qt::cyan ) );
620
previous->setBackground( QBrush( Qt::white ) );
622
emit settingsChanged();
625
void QgsSingleSymbolDialog::fillStyleChanged( int theIndex )
627
//if the new style is texture we need to enable the texture
628
//selection button, otherwise disable it
629
QString myFillStyle =
630
cboFillStyle->itemData( theIndex, Qt::UserRole ).toString();
631
if ( "TexturePattern" == myFillStyle )
633
toolSelectTexture->setEnabled( true );
637
toolSelectTexture->setEnabled( false );
642
void QgsSingleSymbolDialog::keyPressEvent( QKeyEvent * e )
644
// Ignore the ESC key to avoid close the dialog without the properties window
645
if ( e->key() == Qt::Key_Escape )