Automatically turn on the vector layer label toggle when the user sets

the label field. 


git-svn-id: http://svn.osgeo.org/qgis/trunk@5875 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
g_j_m 2006-09-26 10:08:53 +00:00
parent c61099c60e
commit 749f822bd0
3 changed files with 18 additions and 1 deletions

View File

@ -71,8 +71,15 @@ public slots:
/** Initialise dialog to vector layer values */
void init ( void );
void on_cboLabelField_activated(int) {emit labelSourceSet(); }
signals:
/* emitted when anitem in label source list is chosen */
void labelSourceSet();
protected slots:
private:
QgsLabel *mLabel;
QColor mFontColor;

View File

@ -47,6 +47,8 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(QgsVectorLayer * lyr,
QVBoxLayout *layout = new QVBoxLayout( labelOptionsFrame );
labelDialog = new QgsLabelDialog ( layer->label(), labelOptionsFrame);
layout->addWidget( labelDialog );
connect(labelDialog, SIGNAL(labelSourceSet()),
this, SLOT(setLabelCheckBox()));
// Create the Actions dialog tab
QgsVectorDataProvider *dp = dynamic_cast<QgsVectorDataProvider *>(layer->getDataProvider());
@ -77,7 +79,8 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(QgsVectorLayer * lyr,
QgsVectorLayerProperties::~QgsVectorLayerProperties()
{
disconnect(labelDialog, SIGNAL(labelSourceSet()),
this, SLOT(setLabelCheckBox()));
}
void QgsVectorLayerProperties::sliderTransparency_valueChanged(int theValue)
{
@ -86,6 +89,11 @@ void QgsVectorLayerProperties::sliderTransparency_valueChanged(int theValue)
lblTransparencyPercent->setText(tr("Transparency: ") + QString::number(myInt) + "%");
}//sliderTransparency_valueChanged
void QgsVectorLayerProperties::setLabelCheckBox()
{
labelCheckBox->setCheckState(Qt::Checked);
}
void QgsVectorLayerProperties::alterLayerDialog(const QString & dialogString)
{

View File

@ -50,6 +50,8 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
QString getMetadata();
/** Set transparency based on slider position */
void sliderTransparency_valueChanged(int theValue);
/** Toggles on the label check box */
void setLabelCheckBox();
//
//methods reimplemented from qt designer base class