-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename qgsquickfeature and remove featuremodel
- Loading branch information
1 parent
0a99b11
commit 00b6019
Showing
17 changed files
with
202 additions
and
643 deletions.
There are no files selected for viewing
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 was deleted.
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,68 @@ | ||
/*************************************************************************** | ||
qgsquickfeaturelayerpair.cpp | ||
--------------------- | ||
Date : Nov 2017 | ||
Copyright : (C) 2017 by Peter Petrik | ||
Email : zilolv at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* 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 "qgsvectorlayer.h" | ||
#include "qgsfeature.h" | ||
|
||
#include "qgsquickfeaturelayerpair.h" | ||
|
||
QgsQuickFeatureLayerPair::QgsQuickFeatureLayerPair() = default; | ||
|
||
QgsQuickFeatureLayerPair::QgsQuickFeatureLayerPair( const QgsFeature &feature, QgsVectorLayer *layer ) | ||
: mLayer( layer ) | ||
, mFeature( feature ) | ||
{ | ||
} | ||
|
||
QgsVectorLayer *QgsQuickFeatureLayerPair::layer() const | ||
{ | ||
return mLayer; | ||
} | ||
|
||
QgsFeature QgsQuickFeatureLayerPair::feature() const | ||
{ | ||
return mFeature; | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::isValid() const | ||
{ | ||
return ( mLayer && mFeature.isValid() && hasValidGeometry() ); | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::operator==( const QgsQuickFeatureLayerPair &other ) const | ||
{ | ||
return ( mLayer == other.layer() ) && ( mFeature == other.feature() ); | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::operator!=( const QgsQuickFeatureLayerPair &other ) const | ||
{ | ||
return ( mLayer != other.layer() ) || ( mFeature != other.feature() ); | ||
} | ||
|
||
bool QgsQuickFeatureLayerPair::hasValidGeometry() const | ||
{ | ||
Q_ASSERT( mLayer ); | ||
|
||
if ( !mFeature.hasGeometry() ) | ||
return false; | ||
|
||
if ( mFeature.geometry().type() != mLayer->geometryType() ) | ||
return false; | ||
|
||
if ( QgsWkbTypes::hasZ( mLayer->wkbType() ) != QgsWkbTypes::hasZ( mFeature.geometry().wkbType() ) ) | ||
return false; | ||
|
||
return true; | ||
} |
Oops, something went wrong.