mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Allow direct QVariant creation from some QGIS metatypes
This commit is contained in:
parent
b956874f02
commit
0fcff9f2a0
@ -774,5 +774,8 @@ class QgsGeometry
|
|||||||
*/
|
*/
|
||||||
static void convertPointList( const QList<QgsPointV2>& input, QList<QgsPoint>& output );
|
static void convertPointList( const QList<QgsPointV2>& input, QList<QgsPoint>& output );
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from geometry.
|
||||||
|
operator QVariant() const;
|
||||||
|
|
||||||
}; // class QgsGeometry
|
}; // class QgsGeometry
|
||||||
|
|
||||||
|
@ -496,6 +496,9 @@ class QgsFeature
|
|||||||
*/
|
*/
|
||||||
int fieldNameIndex( const QString& fieldName ) const;
|
int fieldNameIndex( const QString& fieldName ) const;
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from features.
|
||||||
|
operator QVariant() const;
|
||||||
|
|
||||||
}; // class QgsFeature
|
}; // class QgsFeature
|
||||||
|
|
||||||
typedef QSet<qint64> QgsFeatureIds;
|
typedef QSet<qint64> QgsFeatureIds;
|
||||||
|
@ -167,6 +167,10 @@ class QgsField
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from fields.
|
||||||
|
operator QVariant() const;
|
||||||
|
|
||||||
}; // class QgsField
|
}; // class QgsField
|
||||||
|
|
||||||
|
|
||||||
@ -364,6 +368,9 @@ class QgsFields
|
|||||||
}
|
}
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from fields.
|
||||||
|
operator QVariant() const;
|
||||||
|
|
||||||
/* SIP_PYOBJECT __getitem__(int key);
|
/* SIP_PYOBJECT __getitem__(int key);
|
||||||
%MethodCode
|
%MethodCode
|
||||||
if (a0 = sipConvertFromSequenceIndex(a0, sipCpp->count()) < 0)
|
if (a0 = sipConvertFromSequenceIndex(a0, sipCpp->count()) < 0)
|
||||||
|
@ -132,5 +132,8 @@ class QgsInterval
|
|||||||
*/
|
*/
|
||||||
static QgsInterval fromString( const QString& string );
|
static QgsInterval fromString( const QString& string );
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from intervals.
|
||||||
|
operator QVariant() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -819,6 +819,12 @@ class CORE_EXPORT QgsGeometry
|
|||||||
*/
|
*/
|
||||||
static void convertPointList( const QgsPointSequenceV2 &input, QList<QgsPoint> &output );
|
static void convertPointList( const QgsPointSequenceV2 &input, QList<QgsPoint> &output );
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from geometry.
|
||||||
|
operator QVariant() const
|
||||||
|
{
|
||||||
|
return QVariant::fromValue( *this );
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QgsGeometryPrivate* d; //implicitely shared data pointer
|
QgsGeometryPrivate* d; //implicitely shared data pointer
|
||||||
|
@ -413,6 +413,12 @@ class CORE_EXPORT QgsFeature
|
|||||||
*/
|
*/
|
||||||
int fieldNameIndex( const QString& fieldName ) const;
|
int fieldNameIndex( const QString& fieldName ) const;
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from features.
|
||||||
|
operator QVariant() const
|
||||||
|
{
|
||||||
|
return QVariant::fromValue( *this );
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QExplicitlySharedDataPointer<QgsFeaturePrivate> d;
|
QExplicitlySharedDataPointer<QgsFeaturePrivate> d;
|
||||||
|
@ -153,6 +153,12 @@ class CORE_EXPORT QgsField
|
|||||||
*/
|
*/
|
||||||
bool convertCompatible( QVariant& v ) const;
|
bool convertCompatible( QVariant& v ) const;
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from fields.
|
||||||
|
operator QVariant() const
|
||||||
|
{
|
||||||
|
return QVariant::fromValue( *this );
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QSharedDataPointer<QgsFieldPrivate> d;
|
QSharedDataPointer<QgsFieldPrivate> d;
|
||||||
@ -288,6 +294,12 @@ class CORE_EXPORT QgsFields
|
|||||||
*/
|
*/
|
||||||
QIcon iconForField( int fieldIdx ) const;
|
QIcon iconForField( int fieldIdx ) const;
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from fields.
|
||||||
|
operator QVariant() const
|
||||||
|
{
|
||||||
|
return QVariant::fromValue( *this );
|
||||||
|
}
|
||||||
|
|
||||||
///@cond PRIVATE
|
///@cond PRIVATE
|
||||||
|
|
||||||
class const_iterator;
|
class const_iterator;
|
||||||
|
@ -155,6 +155,12 @@ class CORE_EXPORT QgsInterval
|
|||||||
*/
|
*/
|
||||||
static QgsInterval fromString( const QString& string );
|
static QgsInterval fromString( const QString& string );
|
||||||
|
|
||||||
|
//! Allows direct construction of QVariants from intervals.
|
||||||
|
operator QVariant() const
|
||||||
|
{
|
||||||
|
return QVariant::fromValue( *this );
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//! Duration of interval in seconds
|
//! Duration of interval in seconds
|
||||||
|
Loading…
x
Reference in New Issue
Block a user