Skip to content
Permalink
Browse files

Advanced attribute search dialog replaced with query builder

based on Postgres' query builder.


git-svn-id: http://svn.osgeo.org/qgis/trunk@5034 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Mar 16, 2006
1 parent 71da112 commit 2acc732a0d7bc97d84ee167ee604459c4ee21462
@@ -16,8 +16,11 @@
* *
***************************************************************************/
/* $Id$ */

#include <qstring.h>

#ifndef QGSSEARCHSTRING_H
#define QGSSEARCHSTRING_H

#include <QString>

class QgsSearchTreeNode;

@@ -75,3 +78,4 @@ class QgsSearchString
QString mParserErrorMsg;
};

#endif
@@ -69,7 +69,6 @@ libqgis_guiHEADERS = \
qgisinterface.h \
qgsabout.h \
qgsaddattrdialog.h \
qgsadvancedattrsearch.h \
qgsattributeaction.h \
qgsattributeactiondialog.h \
qgsattributedialog.h \
@@ -130,6 +129,7 @@ libqgis_guiHEADERS = \
qgsrasterlayerproperties.h \
qgsrubberband.h \
qgsrunprocess.h \
qgssearchquerybuilder.h \
qgsserversourceselect.h \
qgssinglesymboldialog.h \
qgssinglesymbolrenderer.h \
@@ -146,7 +146,6 @@ libqgis_gui_la_MOC = \
qgisinterface.moc.cpp \
qgsabout.moc.cpp \
qgsaddattrdialog.moc.cpp \
qgsadvancedattrsearch.moc.cpp \
qgsattributeactiondialog.moc.cpp \
qgsattributedialog.moc.cpp \
qgsattributetabledisplay.moc.cpp \
@@ -187,6 +186,7 @@ libqgis_gui_la_MOC = \
qgsprojectproperties.moc.cpp \
qgsrasterlayerproperties.moc.cpp \
qgsrunprocess.moc.cpp \
qgssearchquerybuilder.moc.cpp \
qgsserversourceselect.moc.cpp \
qgssinglesymboldialog.moc.cpp \
qgsuniquevaluedialog.moc.cpp \
@@ -199,8 +199,7 @@ libqgis_gui_la_SOURCES = \
qgisinterface.cpp \
qgsabout.cpp \
qgsaddattrdialog.cpp \
qgsadvancedattrsearch.cpp \
qgsattributeaction.cpp \
qgsattributeaction.cpp \
qgsattributeactiondialog.cpp \
qgsattributedialog.cpp \
qgsattributetable.cpp \
@@ -258,6 +257,7 @@ libqgis_gui_la_SOURCES = \
qgsrasterlayerproperties.cpp \
qgsrubberband.cpp \
qgsrunprocess.cpp \
qgssearchquerybuilder.cpp \
qgsserversourceselect.cpp \
qgssinglesymboldialog.cpp \
qgssinglesymbolrenderer.cpp \

This file was deleted.

This file was deleted.

@@ -21,9 +21,9 @@

#include "qgsapplication.h"
#include "qgsaddattrdialog.h"
#include "qgsadvancedattrsearch.h"
#include "qgsdelattrdialog.h"
#include "qgsfeature.h"
#include "qgssearchquerybuilder.h"
#include "qgssearchtreenode.h"
#include "qgsvectorlayer.h"
#include "qgsvectordataprovider.h"
@@ -252,12 +252,12 @@ void QgsAttributeTableDisplay::search()

void QgsAttributeTableDisplay::advancedSearch()
{
QgsAdvancedAttrSearch* searchDlg = new QgsAdvancedAttrSearch(this);
if (searchDlg->exec())
QgsSearchQueryBuilder dlg(mLayer, this);
dlg.setSearchString(mSearchString);
if (dlg.exec())
{
doSearch(searchDlg->searchString());
doSearch(dlg.searchString());
}
delete searchDlg;
}


@@ -287,6 +287,8 @@ void QgsAttributeTableDisplay::searchShowResultsChanged(int item)

void QgsAttributeTableDisplay::doSearch(const QString& searchString)
{
mSearchString = searchString;

// parse search string (and build parsed tree)
QgsSearchString search;
if (!search.setString(searchString))
@@ -314,7 +316,7 @@ void QgsAttributeTableDisplay::doSearch(const QString& searchString)
QgsVectorDataProvider* provider = mLayer->getDataProvider();
provider->reset();
mSearchIds.clear();
while (fet = provider->getNextFeature(true))
while ((fet = provider->getNextFeature(true)))
{
if (searchTree->checkAgainst(fet->attributeMap()))
{
@@ -66,6 +66,8 @@ class QgsAttributeTableDisplay:public QDialog, private Ui::QgsAttributeTableBase
private:
/** Set the icon theme for this dialog */
void setTheme();

QString mSearchString;
};

#endif

0 comments on commit 2acc732

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