title: qvariant_cast with custom type
body: <p>I have this class, register it to use as QVariant</p>
  
  <pre><code>class MyTimeLine
  {
  public:
     MyTimeLine(double kStart = 0, double kEnd = 1);
     void paint(QPainter *painter, const QRect &amp;rect,
                const QPalette &amp;palette)const;
  private:
     double _kStartTime;
     double _kEndTime;
  };
  Q_DECLARE_METATYPE(MyTimeLine)
  </code></pre>
  
  <p>Then i convert it in QVariant, and when i want use qvariant_cast and get MyTimeLine object  i get object, created by default constructor</p>
  
  <pre><code>myTask-&gt;setData(2,Qt::UserRole,
  QVariant::fromValue(MyTimeLine(a,b)));
  
  MyTimeLine taskTimeLine = qvariant_cast&lt;MyTimeLine&gt;(index.data());
  //taskTimeLine._kStartTime = 0;
  //taskTimeLine._kEndTime = 1; 
  </code></pre>