Skip to content
Permalink
Browse files

Use selected text in label combo box for start off expression text

  • Loading branch information
NathanW2 committed Jun 19, 2011
1 parent 6610187 commit d95442138c0bfa610542624fae1d7f38f61a7d49
Showing with 10 additions and 1 deletion.
  1. +3 −1 src/app/qgslabelinggui.cpp
  2. +6 −0 src/gui/qgsexpressionbuilder.cpp
  3. +1 −0 src/gui/qgsexpressionbuilder.h
@@ -34,7 +34,6 @@
#include <QApplication>
#include <QMessageBox>


QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QWidget* parent )
: QDialog( parent ), mLBL( lbl ), mLayer( layer ), mMapCanvas( mapCanvas )
{
@@ -470,6 +469,9 @@ void QgsLabelingGui::showExpressionDialog()
connect(buttonBox,SIGNAL( accepted() ),dlg,SLOT( accept() ) );
connect(buttonBox,SIGNAL( rejected() ),dlg,SLOT( reject() ) );

// Set the current expression using the selected text in the combo box.
builder->setExpressionString(this->cboFieldName->currentText());

if ( dlg->exec() == QDialog::Accepted )
{
QString expression = builder->getExpressionString();
@@ -32,3 +32,9 @@ QString QgsExpressionBuilder::getExpressionString()
{
return this->txtExpressionString->toPlainText();
}

void QgsExpressionBuilder::setExpressionString(const QString expressionString)
{
this->txtExpressionString->setPlainText(expressionString);
}

@@ -26,6 +26,7 @@ class QgsExpressionBuilder : public QWidget, private Ui::QgsExpressionBuilder {
~QgsExpressionBuilder();

QString getExpressionString();
void setExpressionString(const QString expressionString);
};

#endif // QGSEXPRESSIONBUILDER_H

0 comments on commit d954421

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