-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit postgis dialog extension to trunk
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7920 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
mhugent
committed
Jan 10, 2008
1 parent
27afa4e
commit bdad5f6
Showing
9 changed files
with
875 additions
and
359 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/*************************************************************************** | ||
qgsdbfilterproxymodel.cpp - description | ||
------------------------- | ||
begin : Dec 2007 | ||
copyright : (C) 2007 by Marco Hugentobler | ||
email : marco dot hugentobler at karto dot baug dot ethz dot ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsdbfilterproxymodel.h" | ||
|
||
QgsDbFilterProxyModel::QgsDbFilterProxyModel(QObject* parent): QSortFilterProxyModel(parent) | ||
{ | ||
|
||
} | ||
|
||
QgsDbFilterProxyModel::~QgsDbFilterProxyModel() | ||
{ | ||
|
||
} | ||
|
||
bool QgsDbFilterProxyModel::filterAcceptsRow(int row, const QModelIndex & source_parent ) const | ||
{ | ||
//if parent is valid, we have a toplevel item that should be always shown | ||
if(!source_parent.isValid()) | ||
{ | ||
return true; | ||
} | ||
|
||
//else we have a row that describes a table and that | ||
//should be tested using the given wildcard/regexp | ||
return QSortFilterProxyModel::filterAcceptsRow(row, source_parent); | ||
} | ||
|
||
void QgsDbFilterProxyModel::_setFilterWildcard(const QString& pattern) | ||
{ | ||
QSortFilterProxyModel::setFilterWildcard(pattern); | ||
emit layoutChanged(); | ||
} | ||
|
||
void QgsDbFilterProxyModel::_setFilterRegExp(const QString& pattern) | ||
{ | ||
QSortFilterProxyModel::setFilterRegExp(pattern); | ||
emit layoutChanged(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*************************************************************************** | ||
qgsdbfilterproxymodel.h - description | ||
----------------------- | ||
begin : Dec 2007 | ||
copyright : (C) 2007 by Marco Hugentobler | ||
email : marco dot hugentobler at karto dot baug dot ethz dot ch | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSDBFILTERPROXYMODEL_H | ||
#define QGSDBFILTERPROXYMODEL_H | ||
|
||
#include <QSortFilterProxyModel> | ||
|
||
/**A class that implements a custom filter and can be used | ||
as a proxy for QgsDbTableModel*/ | ||
class CORE_EXPORT QgsDbFilterProxyModel: public QSortFilterProxyModel | ||
{ | ||
public: | ||
QgsDbFilterProxyModel(QObject* parent = 0); | ||
~QgsDbFilterProxyModel(); | ||
/**Calls QSortFilterProxyModel::setFilterWildcard and triggers update*/ | ||
void _setFilterWildcard(const QString& pattern); | ||
/**Calls QSortFilterProxyModel::setFilterRegExp and triggers update*/ | ||
void _setFilterRegExp(const QString& pattern); | ||
|
||
protected: | ||
virtual bool filterAcceptsRow(int row, const QModelIndex & source_parent ) const; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.