Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
g_j_m committed Jul 9, 2006
1 parent b26ce47 commit ee075a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/core/qgslabelattributes.cpp
Expand Up @@ -71,7 +71,7 @@ QgsLabelAttributes::QgsLabelAttributes( bool def )
setAlignment ( Qt::AlignCenter );
setColor ( QColor(0,0,0) );

setBufferSize ( 0, PointUnits );
setBufferSize ( 1, PointUnits );
setBufferColor ( QColor(255,255,255) );
setBufferStyle ( Qt::NoBrush );

Expand Down
32 changes: 17 additions & 15 deletions src/gui/qgslabeldialog.cpp
Expand Up @@ -62,8 +62,6 @@ QgsLabelDialog::QgsLabelDialog ( QgsLabel *label, QWidget *parent )
this, SLOT(changeBufferColor()) );
connect( pbnDefaultFontColor, SIGNAL(clicked()),
this, SLOT(changeFontColor()) );
connect( chkUseBuffer, SIGNAL(toggled(bool)),
this, SLOT(chkUseBuffer_toggled(bool)) );
}


Expand Down Expand Up @@ -249,7 +247,7 @@ void QgsLabelDialog::init ( )
}
else //defaults for when no offset is defined
{
spinBufferSize->setValue(0);
spinBufferSize->setValue(1);
}
//set the state of the buffer enabled checkbox
chkUseBuffer->setChecked(myLabelAttributes->bufferEnabled());
Expand All @@ -264,9 +262,9 @@ void QgsLabelDialog::init ( )

void QgsLabelDialog::changeFont ( void )
{
#ifdef QGISDEBUG
#ifdef QGISDEBUG
std::cerr << "QgsLabelDialog::changeFont()" << std::endl;
#endif
#endif
bool resultFlag;
mFont = QFontDialog::getFont(&resultFlag, mFont, this );
if ( resultFlag )
Expand All @@ -282,20 +280,24 @@ void QgsLabelDialog::changeFont ( void )

void QgsLabelDialog::changeFontColor(void)
{
#ifdef QGISDEBUG
#ifdef QGISDEBUG
std::cerr << "QgsLabelDialog::changeFontColor()" << std::endl;
#endif
#endif
mFontColor = QColorDialog::getColor ( mFontColor );
lblSample->setPaletteForegroundColor(mFontColor);
QPalette palette = lblSample->palette();
palette.setColor(lblSample->foregroundRole(), mBufferColor);
lblSample->setPalette(palette);
}

void QgsLabelDialog::changeBufferColor(void)
{
#ifdef QGISDEBUG
#ifdef QGISDEBUG
std::cerr << "QgsLabelDialog::changeBufferColor()" << std::endl;
#endif
#endif
mBufferColor = QColorDialog::getColor ( mBufferColor );
lblSample->setPaletteBackgroundColor(mBufferColor);
QPalette palette = lblSample->palette();
palette.setColor(lblSample->backgroundRole(), mBufferColor);
lblSample->setPalette(palette);
}


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

QgsLabelDialog::~QgsLabelDialog()
{
#ifdef QGISDEBUG
#ifdef QGISDEBUG
std::cerr << "QgsLabelDialog::~QgsLabelDialog()" << std::endl;
#endif
#endif
}

void QgsLabelDialog::apply()
{
#ifdef QGISDEBUG
#ifdef QGISDEBUG
std::cerr << "QgsLabelDialog::apply()" << std::endl;
#endif
#endif

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

0 comments on commit ee075a0

Please sign in to comment.