<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

  <channel>

  
  <title>Qt DevNet forums: C++ Gurus 1294158329**  </title>
  <link>http://qt-project.org/forums/viewforum/36/</link>
  <description>RSS feed for latest posts in C++ Gurus</description>
  <copyright>Copyright 2012 Qt Developer Network</copyright>
  <docs>http://www.rssboard.org/rss-specification</docs>
  <generator>ExpressionEngine v2.3.1 http://expressionengine.com/</generator>
  <lastBuildDate>Tue, 04 Jan 2011 18:25:29 GMT</lastBuildDate>
  <atom:link href="http://qt-project.org/feeds/all_forums/36" rel="self" type="application/rss+xml" />
  
  
  
        <item>
            <title>namespace best practice</title>
            <link>http://qt-project.org/forums/viewreply/86630</link>
            <author>AlekseyOk</author>
            <description><![CDATA[To add all classes into one namespace you should add

	namespace youSpace
&#123;
&amp;nbsp; &amp;nbsp; you_class_declaration and/or definition
&#125;


	to each header and cpp file. Of course you can add

	using namespace youSpace;


	to cpp file.]]></description>
            <guid isPermaLink="false">700c8498f7f3dcebbbd2b06e20256b85</guid>
            <pubDate>Thu, 24 May 2012 11:57:54 GMT</pubDate>
        </item>
  
        <item>
            <title>namespace best practice</title>
            <link>http://qt-project.org/forums/viewthread/17472</link>
            <author>fluca1978</author>
            <description><![CDATA[Hi all,
I&#8217;m going to refactor a few classes in my project to belong all to the same namespace. Each class has its own header and implementation file. I&#8217;m just curious to know which is the best practice to contain all of them in a single namespace, do I have to create a &#8220;namespace&#8221; file like:

	namespace mySpace&#123;
&amp;nbsp; &amp;nbsp; class MyClassA;
&amp;nbsp; &amp;nbsp; class MyClassB;
&#125;


	or add the namespace block in each header file or what? Any suggestion is welcome.]]></description>
            <guid isPermaLink="false">0f846c49a0a7459bbbdb40c85741d23c</guid>
            <pubDate>Thu, 24 May 2012 10:28:55 GMT</pubDate>
        </item>
  
        <item>
            <title>How do I compile my Qt Application for different systems?</title>
            <link>http://qt-project.org/forums/viewreply/86565</link>
            <author>maplesyrup23</author>
            <description><![CDATA[What do you mean by a different driver?]]></description>
            <guid isPermaLink="false">c4d2fe8fa852ffdcb96c07b040824db7</guid>
            <pubDate>Wed, 23 May 2012 20:47:27 GMT</pubDate>
        </item>
  
        <item>
            <title>How do I compile my Qt Application for different systems?</title>
            <link>http://qt-project.org/forums/viewthread/17453</link>
            <author>maplesyrup23</author>
            <description><![CDATA[I&#8217;ve been using QExtSerialPort, and for some reason when I run and compile where I wrote the code (64 bit machine), it writes signals to the Arduino board. When I take the executable and its dependencies to another system, the signals are then not written to the Arduino board. 

	I suspect it may be because the app is compiled in a 64 bit machine and not in a 32 bit machine. Has this occured to any one of you guys? 

	Also, how do I compile it for a 32 bit computer? 

	Thank you in advance.]]></description>
            <guid isPermaLink="false">a1afd484c100cc8b451e4f6ca4b928b7</guid>
            <pubDate>Wed, 23 May 2012 16:38:31 GMT</pubDate>
        </item>
  
        <item>
            <title>Place to declare constants.</title>
            <link>http://qt-project.org/forums/viewreply/86037</link>
            <author>Mari&amp;oslash;&amp;trade;</author>
            <description><![CDATA[If these are real colors used for drawing, then it’s all right to make them properties.
Yes, these are real colors. I mean objects.


And of cause if you don’t ever want to change these values, then don’t declare them as properties.
Yes, I don&#8217;t want to change these values.

	Probably I will use local variables as constants:
void Rect::draw&#40;&#41;
&#123;
&amp;nbsp; &amp;nbsp; const QColor penColor&#40;&#41;;
&amp;nbsp; &amp;nbsp; const QColor brushColor&#40;&#41;;
&#125;


	@Serg Thanks for this tip:

For compile&#45;time constant in class you can use unnamed enum.]]></description>
            <guid isPermaLink="false">9a8c6ceccab265fd9857cb7c8f640bc6</guid>
            <pubDate>Fri, 18 May 2012 05:00:44 GMT</pubDate>
        </item>
  
        <item>
            <title>Place to declare constants.</title>
            <link>http://qt-project.org/forums/viewthread/17220</link>
            <author>Mari&amp;oslash;&amp;trade;</author>
            <description><![CDATA[Hello,

	My name is Mario, I&#8217;m new to this forum
and I sincerely apologize for my bad English.

	I am having a dilemma about which is the best place to declare constants.
For example, I have an item that is derived from QGraphicsItem,
this element has two constant colors: pen color and brush color.

	I&#8217;m thinking of declaring them as private constants:
class Rect : public QGraphicsItem
&#123;
&amp;nbsp;....
&amp;nbsp; &amp;nbsp; private:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static const int _penColor = 0;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static const int _brushColor = 1;
&#125;;


	But it also can be declared as definitions in the header:
#define PENCOLOR 0
#define BRUSHCOLOR 1


	As well as local variables:
void Rect::draw&#40;&#41;
&#123;
&amp;nbsp; &amp;nbsp; const int penColor = 0;
&amp;nbsp; &amp;nbsp; const int brushColor = 1;
&#125;


	Maybe this is not important, but I wish I know what you think?

	Thanks, Mariø.]]></description>
            <guid isPermaLink="false">a8c047e2fd60465111f5d184dc7e4fd4</guid>
            <pubDate>Tue, 15 May 2012 00:08:32 GMT</pubDate>
        </item>
  
        <item>
            <title>char array to qint24 array</title>
            <link>http://qt-project.org/forums/viewreply/85608</link>
            <author>Volker</author>
            <description><![CDATA[If you want to reinterpret to a 32 bit type, you need 32bits in the beginning. So temp should be an array of four bytes with the high byte set to 0, not 3 bytes (24 bits).

	Also, be aware of endianess issues &#8211; it depends on the CPU architecture whether the most significant byte is at index 0 or at index 3.]]></description>
            <guid isPermaLink="false">2970f2fee56c2f1ee589a32d9dec3388</guid>
            <pubDate>Sun, 13 May 2012 23:22:27 GMT</pubDate>
        </item>
  
        <item>
            <title>Using Qt in Eclipse... without qmake?</title>
            <link>http://qt-project.org/forums/viewreply/85589</link>
            <author>Randomaniac</author>
            <description><![CDATA[Thanks a lot :D Though I&#8217;m hoping I&#8217;ll only be needing moc since he&#8217;s the only one complaining.]]></description>
            <guid isPermaLink="false">2237b152ce2039c2ecbc5c47e97c9868</guid>
            <pubDate>Sun, 13 May 2012 15:32:35 GMT</pubDate>
        </item>
  
        <item>
            <title>Using Qt in Eclipse... without qmake?</title>
            <link>http://qt-project.org/forums/viewthread/17179</link>
            <author>Randomaniac</author>
            <description><![CDATA[Hi there,

	I&#8217;m new around here and decided to just keep lurking the forums until I&#8217;ve now encountered a problem I probably won&#8217;t be able to fix without any help. 

	I&#8217;m working on a C++ project in Eclipse (educational purposes) and decided to add some nice Qt GUI. This is achieved by using the Debug and Release options in Eclipse with the default g++ compiler. However, when using the Q_OBJECT macro I get &#8216;vtable&#8217; errors. After a long time of research I found that all these problems can be led back to qmake, as it apparently makes things a lot easier. However, I don&#8217;t have the luxury to use qmake in my project as it is not generally accepted in our team and have to be able to manage with just make.

	Is there any way I can integrate the Q_OBJECT macro in my project, using the default make? Even though I have the integrated Qt environment installed I code everything manually and don&#8217;t use it as to make it easier for my team to integrate it into their own Eclipse. 

	Any help or feedback would be greatly appreciated!

	Randomaniac]]></description>
            <guid isPermaLink="false">15258d56a148c190400652410be79edd</guid>
            <pubDate>Sun, 13 May 2012 13:37:27 GMT</pubDate>
        </item>
  
        <item>
            <title>[SOLVED] What mistake am I making when passing the signals to the Main Window slot?</title>
            <link>http://qt-project.org/forums/viewreply/85427</link>
            <author>maplesyrup23</author>
            <description><![CDATA[I took out the wait condition and the same thing occurred: It hanged and didn&#8217;t print of the emitted signals even though the qDebug statements went through.]]></description>
            <guid isPermaLink="false">f95a1b3b43b0ed9973c7c16455e87aed</guid>
            <pubDate>Fri, 11 May 2012 12:15:40 GMT</pubDate>
        </item>
  

  </channel>
</rss>
