Skip to content

Commit 90f0721

Browse files
committedMay 6, 2014
Q_PROPERTY to define dialog title in field expression widget
1 parent 73d11ae commit 90f0721

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed
 

‎python/gui/qgsfieldexpressionwidget.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class QgsFieldExpressionWidget : QWidget
1717
//! set the geometry calculator used in the expression dialog
1818
void setGeomCalculator( const QgsDistanceArea &da );
1919

20+
//! return the title used for the expression dialog
21+
const QString expressionDialogTitle();
22+
2023
/**
2124
* @brief currentField returns the currently selected field or expression if allowed
2225
* @param isExpression determines if the string returned is the name of a field or an expression
@@ -27,9 +30,6 @@ class QgsFieldExpressionWidget : QWidget
2730
//! Returns the currently used layer
2831
QgsVectorLayer* layer();
2932

30-
protected:
31-
void changeEvent( QEvent* event );
32-
3333
signals:
3434
//! the signal is emitted when the currently selected field changes
3535
void fieldChanged( QString fieldName );

‎src/gui/qgsfieldexpressionwidget.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class QgsMapLayer;
2828
class QgsVectorLayer;
2929
class QgsFieldModel;
3030

31+
3132
/**
3233
* @brief The QgsFieldExpressionWidget class reates a widget to choose fields and edit expressions
3334
* It contains a combo boxto display the fields and expression and a button to open the expression dialog.
@@ -39,6 +40,8 @@ class QgsFieldModel;
3940
class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
4041
{
4142
Q_OBJECT
43+
Q_PROPERTY( QString expressionDialogTitle READ expressionDialogTitle WRITE setExpressionDialogTitle )
44+
4245
public:
4346
/**
4447
* @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
4851
//! define the title used in the expression dialog
4952
void setExpressionDialogTitle( QString title );
5053

54+
//! return the title used for the expression dialog
55+
const QString expressionDialogTitle() { return mExpressionDialogTitle; }
56+
5157
//! set the geometry calculator used in the expression dialog
5258
void setGeomCalculator( const QgsDistanceArea &da );
5359

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

64-
protected:
65-
void changeEvent( QEvent* event );
66-
6770
signals:
6871
//! the signal is emitted when the currently selected field changes
6972
void fieldChanged( QString fieldName );
@@ -102,6 +105,9 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
102105

103106
bool isExpressionValid( const QString expressionStr );
104107

108+
protected:
109+
void changeEvent( QEvent* event );
110+
105111
private:
106112
QComboBox* mCombo;
107113
QToolButton* mButton;

0 commit comments

Comments
 (0)
Please sign in to comment.