Skip to content

Commit ee075a0

Browse files
author
g_j_m
committedJul 9, 2006
- Fix a missing slot warning
- Tidy up #ifdef QGISDEBUGs - Replace some qt3 compabitilty code with the 'qt4 way' - Use a default label buffer size of 1 instead of 0 to reduce user confusion git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5573 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed
 

‎src/core/qgslabelattributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ QgsLabelAttributes::QgsLabelAttributes( bool def )
7171
setAlignment ( Qt::AlignCenter );
7272
setColor ( QColor(0,0,0) );
7373

74-
setBufferSize ( 0, PointUnits );
74+
setBufferSize ( 1, PointUnits );
7575
setBufferColor ( QColor(255,255,255) );
7676
setBufferStyle ( Qt::NoBrush );
7777

‎src/gui/qgslabeldialog.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ QgsLabelDialog::QgsLabelDialog ( QgsLabel *label, QWidget *parent )
6262
this, SLOT(changeBufferColor()) );
6363
connect( pbnDefaultFontColor, SIGNAL(clicked()),
6464
this, SLOT(changeFontColor()) );
65-
connect( chkUseBuffer, SIGNAL(toggled(bool)),
66-
this, SLOT(chkUseBuffer_toggled(bool)) );
6765
}
6866

6967

@@ -249,7 +247,7 @@ void QgsLabelDialog::init ( )
249247
}
250248
else //defaults for when no offset is defined
251249
{
252-
spinBufferSize->setValue(0);
250+
spinBufferSize->setValue(1);
253251
}
254252
//set the state of the buffer enabled checkbox
255253
chkUseBuffer->setChecked(myLabelAttributes->bufferEnabled());
@@ -264,9 +262,9 @@ void QgsLabelDialog::init ( )
264262

265263
void QgsLabelDialog::changeFont ( void )
266264
{
267-
#ifdef QGISDEBUG
265+
#ifdef QGISDEBUG
268266
std::cerr << "QgsLabelDialog::changeFont()" << std::endl;
269-
#endif
267+
#endif
270268
bool resultFlag;
271269
mFont = QFontDialog::getFont(&resultFlag, mFont, this );
272270
if ( resultFlag )
@@ -282,20 +280,24 @@ void QgsLabelDialog::changeFont ( void )
282280

283281
void QgsLabelDialog::changeFontColor(void)
284282
{
285-
#ifdef QGISDEBUG
283+
#ifdef QGISDEBUG
286284
std::cerr << "QgsLabelDialog::changeFontColor()" << std::endl;
287-
#endif
285+
#endif
288286
mFontColor = QColorDialog::getColor ( mFontColor );
289-
lblSample->setPaletteForegroundColor(mFontColor);
287+
QPalette palette = lblSample->palette();
288+
palette.setColor(lblSample->foregroundRole(), mBufferColor);
289+
lblSample->setPalette(palette);
290290
}
291291

292292
void QgsLabelDialog::changeBufferColor(void)
293293
{
294-
#ifdef QGISDEBUG
294+
#ifdef QGISDEBUG
295295
std::cerr << "QgsLabelDialog::changeBufferColor()" << std::endl;
296-
#endif
296+
#endif
297297
mBufferColor = QColorDialog::getColor ( mBufferColor );
298-
lblSample->setPaletteBackgroundColor(mBufferColor);
298+
QPalette palette = lblSample->palette();
299+
palette.setColor(lblSample->backgroundRole(), mBufferColor);
300+
lblSample->setPalette(palette);
299301
}
300302

301303

@@ -313,16 +315,16 @@ int QgsLabelDialog::itemNoForField(QString theFieldName, QStringList theFieldLis
313315

314316
QgsLabelDialog::~QgsLabelDialog()
315317
{
316-
#ifdef QGISDEBUG
318+
#ifdef QGISDEBUG
317319
std::cerr << "QgsLabelDialog::~QgsLabelDialog()" << std::endl;
318-
#endif
320+
#endif
319321
}
320322

321323
void QgsLabelDialog::apply()
322324
{
323-
#ifdef QGISDEBUG
325+
#ifdef QGISDEBUG
324326
std::cerr << "QgsLabelDialog::apply()" << std::endl;
325-
#endif
327+
#endif
326328

327329
//set the label props that are NOT bound to a field in the attributes tbl
328330
//All of these are set in the layerAttributes member of the layer

0 commit comments

Comments
 (0)
Please sign in to comment.