mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Add a convenience constructor from QString to QgsSearchString
git-svn-id: http://svn.osgeo.org/qgis/trunk@13944 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
50734ac052
commit
e9828f8ef3
@ -9,6 +9,10 @@ class QgsSearchString
|
||||
//! constructor
|
||||
QgsSearchString();
|
||||
|
||||
//! construct and parse a string
|
||||
//! @note added in v1.6
|
||||
QgsSearchString( const QString & str );
|
||||
|
||||
//! copy constructor - makes also copy of search tree
|
||||
QgsSearchString( const QgsSearchString& str );
|
||||
|
||||
|
@ -30,6 +30,11 @@ QgsSearchString::QgsSearchString()
|
||||
mTree = NULL;
|
||||
}
|
||||
|
||||
QgsSearchString::QgsSearchString( const QString & str )
|
||||
{
|
||||
mTree = NULL;
|
||||
setString( str );
|
||||
}
|
||||
|
||||
QgsSearchString::QgsSearchString( const QgsSearchString& str )
|
||||
{
|
||||
@ -62,8 +67,10 @@ QgsSearchString::~QgsSearchString()
|
||||
|
||||
bool QgsSearchString::setString( QString str )
|
||||
{
|
||||
mParserErrorMsg.clear();
|
||||
|
||||
// empty string
|
||||
if ( str == "" )
|
||||
if ( str.isEmpty() )
|
||||
{
|
||||
clear();
|
||||
return true;
|
||||
@ -107,5 +114,5 @@ void QgsSearchString::clear()
|
||||
{
|
||||
delete mTree;
|
||||
mTree = NULL;
|
||||
mString = "";
|
||||
mString.clear();
|
||||
}
|
||||
|
@ -35,9 +35,13 @@ class QgsSearchTreeNode;
|
||||
class CORE_EXPORT QgsSearchString
|
||||
{
|
||||
public:
|
||||
//! constructor
|
||||
//! construct an empty string
|
||||
QgsSearchString();
|
||||
|
||||
//! construct and parse a string
|
||||
//! @note added in v1.6
|
||||
QgsSearchString( const QString & str );
|
||||
|
||||
//! copy constructor - makes also copy of search tree
|
||||
QgsSearchString( const QgsSearchString& str );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user