<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>From This Day - Registering custom types Comments</title>
  <id>tag:blog.ayoy.net,2012:/2009/2/15/registering-custom-types/comments</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://blog.ayoy.net/2009/2/15/registering-custom-types/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2009/2/15/registering-custom-types" rel="alternate" type="text/html"/>
  <updated>2010-10-23T12:09:07Z</updated>
  <entry xml:base="http://blog.ayoy.net/">
    <author>
      <name>Monah Tuk</name>
    </author>
    <id>tag:blog.ayoy.net,2009-02-15:1:3086</id>
    <published>2010-10-23T12:09:07Z</published>
    <updated>2010-10-23T12:09:07Z</updated>
    <category term="Qt"/>
    <link href="http://blog.ayoy.net/2009/2/15/registering-custom-types" rel="alternate" type="text/html"/>
    <title>Comment on 'Registering custom types' by Monah Tuk</title>
<content type="html">&lt;p&gt;Ohhhh&#8230; Sorry my previous comment need formating&#8230;&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://blog.ayoy.net/">
    <author>
      <name>Monah Tuk</name>
    </author>
    <id>tag:blog.ayoy.net,2009-02-15:1:3085</id>
    <published>2010-10-23T12:07:00Z</published>
    <updated>2010-10-23T12:07:00Z</updated>
    <category term="Qt"/>
    <link href="http://blog.ayoy.net/2009/2/15/registering-custom-types" rel="alternate" type="text/html"/>
    <title>Comment on 'Registering custom types' by Monah Tuk</title>
<content type="html">&lt;p&gt;Hi Ayoy, in additions, It good to register stream operators like
qRegisterMetaTypeStreamOperators(&#8220;PhotoFormat&#8221;);&lt;/p&gt;


	&lt;p&gt;And declare it with next prototypes:
QDataStream &#38;operator&amp;lt;&amp;lt;(QDataStream &#38;out, const PhotoFormat &#38;obj);
QDataStream &#38;operator&amp;gt;&amp;gt;(QDataStream &#38;in, PhotoFormat &#38;obj);&lt;/p&gt;


	&lt;p&gt;It need for serialization class and usefull to use custom types with QSettings, for ex, implemenations of &#8216;operator&amp;lt;&amp;lt;&#8217;:
QDataStream &#38; operator &amp;lt;&amp;lt;(QDataStream &#38;out, const PhotoFormat &#38;obj)
{
    QString name = obj.getFormatName();
    QSizeF  size = obj.getSize();
    qreal   dst1 = obj.getTopPateDistance();
    qreal   dst2 = obj.getNoseChinDistance();
}&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;out &amp;lt;&amp;lt; name &amp;lt;&amp;lt; size &amp;lt;&amp;lt; dst1 &amp;lt;&amp;lt; dst2;
return out;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Code from real project :-)&lt;/p&gt;</content>  </entry>
</feed>

