Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added query builder to rule properties dialog (rule-based renderer). …
…Patch from #3303 - contributed by Nathan Woodrow

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14878 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 9, 2010
1 parent 9ef391f commit 40e73e7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -39,6 +39,7 @@ Mathias Walker
Matt Amos
Maurizio Napolitano
Milena Nowotarska
Nathan Woodrow
Nikos Alexandris
Paul Ramsey
Richard Duivenvoorde
Expand Down
11 changes: 11 additions & 0 deletions src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
Expand Up @@ -176,6 +176,7 @@ void QgsRuleBasedRendererV2Widget::removeRule()
#include "qgscategorizedsymbolrendererv2widget.h"
#include "qgsgraduatedsymbolrendererv2.h"
#include "qgsgraduatedsymbolrendererv2widget.h"
#include "qgssearchquerybuilder.h"
#include <QDialogButtonBox>
#include <QInputDialog>

Expand Down Expand Up @@ -315,9 +316,19 @@ QgsRendererRulePropsDialog::QgsRendererRulePropsDialog( const QgsRuleBasedRender
l->addWidget( symbolSel );
groupSymbol->setLayout( l );

connect( btnExpressionBuilder, SIGNAL( clicked() ), this, SLOT( buildExpreesion() ) );
connect( btnTestFilter, SIGNAL( clicked() ), this, SLOT( testFilter() ) );
}

void QgsRendererRulePropsDialog::buildExpreesion()
{
QgsSearchQueryBuilder dlg( mLayer, this );
dlg.setSearchString( editFilter->text() );

if ( dlg.exec() )
editFilter->setText( dlg.searchString() );
}

void QgsRendererRulePropsDialog::testFilter()
{
QgsSearchString filterParsed;
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgsrulebasedrendererv2widget.h
Expand Up @@ -110,6 +110,7 @@ class GUI_EXPORT QgsRendererRulePropsDialog : public QDialog, private Ui::QgsRen

public slots:
void testFilter();
void buildExpreesion();

protected:
QgsRuleBasedRendererV2::Rule mRule;
Expand Down
20 changes: 18 additions & 2 deletions src/ui/qgsrendererrulepropsdialogbase.ui
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>547</width>
<height>300</height>
<width>545</width>
<height>298</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -16,6 +16,9 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="rightMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
Expand All @@ -26,6 +29,19 @@
<item>
<widget class="QLineEdit" name="editFilter"/>
</item>
<item>
<widget class="QPushButton" name="btnExpressionBuilder">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnTestFilter">
<property name="text">
Expand Down

0 comments on commit 40e73e7

Please sign in to comment.