Skip to content
Permalink
Browse files

Q_PROPERTY to define dialog title in field expression widget

  • Loading branch information
3nids committed May 6, 2014
1 parent 73d11ae commit 90f0721e1ef5bc8ddac302b6721e22e9de3287aa
Showing with 12 additions and 6 deletions.
  1. +3 −3 python/gui/qgsfieldexpressionwidget.sip
  2. +9 −3 src/gui/qgsfieldexpressionwidget.h
@@ -17,6 +17,9 @@ class QgsFieldExpressionWidget : QWidget
//! set the geometry calculator used in the expression dialog
void setGeomCalculator( const QgsDistanceArea &da );

//! return the title used for the expression dialog
const QString expressionDialogTitle();

/**
* @brief currentField returns the currently selected field or expression if allowed
* @param isExpression determines if the string returned is the name of a field or an expression
@@ -27,9 +30,6 @@ class QgsFieldExpressionWidget : QWidget
//! Returns the currently used layer
QgsVectorLayer* layer();

protected:
void changeEvent( QEvent* event );

signals:
//! the signal is emitted when the currently selected field changes
void fieldChanged( QString fieldName );
@@ -28,6 +28,7 @@ class QgsMapLayer;
class QgsVectorLayer;
class QgsFieldModel;


/**
* @brief The QgsFieldExpressionWidget class reates a widget to choose fields and edit expressions
* It contains a combo boxto display the fields and expression and a button to open the expression dialog.
@@ -39,6 +40,8 @@ class QgsFieldModel;
class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY( QString expressionDialogTitle READ expressionDialogTitle WRITE setExpressionDialogTitle )

public:
/**
* @brief QgsFieldExpressionWidget creates a widget with a combo box to display the fields and expression and a button to open the expression dialog
@@ -48,6 +51,9 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
//! define the title used in the expression dialog
void setExpressionDialogTitle( QString title );

//! return the title used for the expression dialog
const QString expressionDialogTitle() { return mExpressionDialogTitle; }

//! set the geometry calculator used in the expression dialog
void setGeomCalculator( const QgsDistanceArea &da );

@@ -61,9 +67,6 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
//! Returns the currently used layer
QgsVectorLayer* layer();

protected:
void changeEvent( QEvent* event );

signals:
//! the signal is emitted when the currently selected field changes
void fieldChanged( QString fieldName );
@@ -102,6 +105,9 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget

bool isExpressionValid( const QString expressionStr );

protected:
void changeEvent( QEvent* event );

private:
QComboBox* mCombo;
QToolButton* mButton;

0 comments on commit 90f0721

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