Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update comments
  • Loading branch information
NathanW2 committed Oct 16, 2011
1 parent 17d326e commit 7f5e1c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/qgslabelinggui.cpp
Expand Up @@ -495,6 +495,7 @@ void QgsLabelingGui::showExpressionDialog()
{
//TODO extract this out to a dialog.
QgsExpressionBuilderDialog dlg( mLayer, cboFieldName->currentText() , this );
dlg.setWindowTitle( tr("Expression based label") );
if ( dlg.exec() == QDialog::Accepted )
{
QString expression = dlg.expressionBuilder()->getExpressionString();
Expand Down
14 changes: 10 additions & 4 deletions src/gui/qgsexpressionbuilder.h
Expand Up @@ -24,12 +24,14 @@
#include "QStandardItem"
#include "QSortFilterProxyModel"

/** Search proxy used to filter the QgsExpressionBuilderWidget tree.
* The default search for a tree model only searches top level this will handle one
* level down
*/
class QgsExpressionItemSearhProxy : public QSortFilterProxyModel
{
public:
QgsExpressionItemSearhProxy()
{
}
QgsExpressionItemSearhProxy() { }

bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
{
Expand All @@ -40,6 +42,8 @@ class QgsExpressionItemSearhProxy : public QSortFilterProxyModel
}
};

/** An expression item that can be used in the QgsExpressionBuilderWidget tree.
*/
class QgsExpressionItem : public QStandardItem
{
public:
Expand Down Expand Up @@ -95,7 +99,9 @@ class QgsExpressionItem : public QStandardItem
QgsExpressionItem::ItemType mType;
};

/** A reusable widget that can be used to build a expression string. */
/** A reusable widget that can be used to build a expression string.
* See QgsExpressionBuilderDialog for exmaple of usage.
*/
class QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExpressionBuilder {
Q_OBJECT
public:
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsexpressionbuilderdialog.h
Expand Up @@ -13,6 +13,7 @@ class QgsExpressionBuilderDialog : public QDialog, private Ui::QgsExpressionBuil
QgsExpressionBuilderWidget* expressionBuilder();

void setExpressionText( QString text );

protected:
/**
* Handle closing of the window
Expand Down

0 comments on commit 7f5e1c8

Please sign in to comment.