166 if ( variant.isNull() || !variant.isValid() )
169 switch ( variant.type() )
171 case QVariant::Invalid:
175 case QVariant::LongLong:
176 case QVariant::ULongLong:
177 case QVariant::Double:
180 case QVariant::StringList:
182 case QVariant::Locale:
183 case QVariant::RegularExpression:
185 case QVariant::EasingCurve:
186 case QVariant::ModelIndex:
187 case QVariant::PersistentModelIndex:
189 case QVariant::LastType:
194 if ( variant.toDate().isNull() )
196 QgsDebugError( QStringLiteral(
"NULL QDateTime was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
201 if ( variant.toTime().isNull() )
203 QgsDebugError( QStringLiteral(
"NULL QTime was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
207 case QVariant::DateTime:
208 if ( variant.toDate().isNull() )
210 QgsDebugError( QStringLiteral(
"NULL QDate was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
215 if ( variant.toChar().isNull() )
217 QgsDebugError( QStringLiteral(
"NULL QChar was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
221 case QVariant::String:
222 if ( variant.toString().isNull() )
224 QgsDebugError( QStringLiteral(
"NULL QString was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
228 case QVariant::ByteArray:
229 if ( variant.toByteArray().isNull() )
231 QgsDebugError( QStringLiteral(
"NULL QByteArray was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
235 case QVariant::BitArray:
236 if ( variant.toBitArray().isNull() )
238 QgsDebugError( QStringLiteral(
"NULL QBitArray was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
243 if ( variant.toRect().isNull() )
245 QgsDebugError( QStringLiteral(
"NULL QRect was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
249 case QVariant::RectF:
250 if ( variant.toRectF().isNull() )
252 QgsDebugError( QStringLiteral(
"NULL QRectF was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
257 if ( variant.toSize().isNull() )
259 QgsDebugError( QStringLiteral(
"NULL QSize was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
263 case QVariant::SizeF:
264 if ( variant.toSizeF().isNull() )
266 QgsDebugError( QStringLiteral(
"NULL QSizeF was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
271 if ( variant.toLine().isNull() )
273 QgsDebugError( QStringLiteral(
"NULL QLine was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
277 case QVariant::LineF:
278 if ( variant.toLineF().isNull() )
280 QgsDebugError( QStringLiteral(
"NULL QLineF was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
284 case QVariant::Point:
285 if ( variant.toPoint().isNull() )
287 QgsDebugError( QStringLiteral(
"NULL QPoint was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
291 case QVariant::PointF:
292 if ( variant.toPointF().isNull() )
294 QgsDebugError( QStringLiteral(
"NULL QPointF was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
299 if ( variant.toUuid().isNull() )
301 QgsDebugError( QStringLiteral(
"NULL QUuid was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
305 case QVariant::Pixmap:
306 if ( variant.value< QPixmap >().isNull() )
308 QgsDebugError( QStringLiteral(
"NULL QPixmap was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
312 case QVariant::Image:
313 if ( variant.value< QImage >().isNull() )
315 QgsDebugError( QStringLiteral(
"NULL QImage was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
319 case QVariant::Region:
320 if ( variant.value< QRegion >().isNull() )
322 QgsDebugError( QStringLiteral(
"NULL QRegion was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
326 case QVariant::Bitmap:
327 if ( variant.value< QBitmap >().isNull() )
329 QgsDebugError( QStringLiteral(
"NULL QBitmap was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
334 if ( variant.value< QIcon >().isNull() )
336 QgsDebugError( QStringLiteral(
"NULL QIcon was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
340 case QVariant::Vector2D:
341 if ( variant.value< QVector2D >().isNull() )
343 QgsDebugError( QStringLiteral(
"NULL QVector2D was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
347 case QVariant::Vector3D:
348 if ( variant.value< QVector3D >().isNull() )
350 QgsDebugError( QStringLiteral(
"NULL QVector3D was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
354 case QVariant::Vector4D:
355 if ( variant.value< QVector4D >().isNull() )
357 QgsDebugError( QStringLiteral(
"NULL QVector4D was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
361 case QVariant::Quaternion:
362 if ( variant.value< QQuaternion >().isNull() )
364 QgsDebugError( QStringLiteral(
"NULL QQuaternion was stored in a QVariant -- stop it! Always use an invalid QVariant() instead." ) );
369 case QVariant::Color:
371 case QVariant::Brush:
372 case QVariant::Polygon:
373 case QVariant::Palette:
374 case QVariant::Cursor:
375 case QVariant::KeySequence:
377 case QVariant::TextLength:
378 case QVariant::PolygonF:
379 case QVariant::TextFormat:
380 case QVariant::Transform:
381 case QVariant::Matrix4x4:
382 case QVariant::SizePolicy:
385 case QVariant::UserType: