<div dir="ltr"><div>Try initializing that `ui` with 0 and see what happens.<br></div><div><br></div><div>Similar for using the property from a destructor or destruction sequence, since moc is unable to track the pointers in use.</div>

<div>Also think about objects you don't control, i.e. Q_PROPERTY(QString label ALIAS AnyCrap m_parent->labelWidget->objectName()) ...and so on.</div></div><div class="gmail_extra"><br clear="all"><div>Regards,<br>

Konstantin</div>
<br><br><div class="gmail_quote">2014-03-11 10:59 GMT+02:00 Svetkin Mikhail <span dir="ltr"><<a href="mailto:mikhail.svetkin@gmail.com" target="_blank">mikhail.svetkin@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class=""><div dir="ltr">Why do you think moc will crash?<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">2014-03-11 14:30 GMT+06:00 Konstantin Ritt <span dir="ltr"><<a href="mailto:ritt.ks@gmail.com" target="_blank">ritt.ks@gmail.com</a>></span>:<br>


</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>
<div>> Would suggest to solve this problem in this way(The code marked as duplicate does not need anymore.):</div><div><div class="h5"><div>> Q_PROPERTY<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> label ALIAS CustomWidgetFirst ui->custom_widget_first_obj->value <span style="margin:0px;padding:0px;color:rgb(54,53,52)">) </span><span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;margin:0px;padding:0px;color:rgb(54,53,52)"> </span><span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;color:rgb(0,128,0)">// where "value" property name</span></div>




<div><br></div></div></div></div><div><div class="h5"><div>I don't think moc is able to guarantee no crash at `ui->custom_widget_first_obj->value`. So you're trading safety for nothing.<br></div><div class="gmail_extra">

<br clear="all"><div>
Konstantin</div>


<br><br><div class="gmail_quote">2014-03-11 5:12 GMT+02:00 Svetkin Mikhail <span dir="ltr"><<a href="mailto:mikhail.svetkin@gmail.com" target="_blank">mikhail.svetkin@gmail.com</a>></span>:<div><div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div style="font-size:13px;font-family:arial,sans-serif"><div>Explain:</div><div>I was creating custom widgets with the help of Qt-designer.<br>And I have noticed I have to duplicate my code, if I want to edit properties of the widget in qt-designer property editor.<br>





</div></div><div style="font-size:13px;font-family:arial,sans-serif"><div><div>Simple Example: </div><div><br></div><div><ol style="font-family:Verdana,'DejaVu Sans',Geneva,sans-serif;margin:1em 0px;padding:0px;list-style:none;color:rgb(175,175,175);font-size:12px;line-height:18px">





<div><div><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:green">// custom_widget_first.h</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include <QWidget></span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include <QString></span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include <QPaintEvent></span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">class</span> CustomWidgetFirst <span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">public</span> <a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a>  <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">Q_OBJECT</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">  Q_PROPERTY(</span><a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> value READ label WRITE setLabel)</div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">public</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">explicit</span> CustomWidgetFirst<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span>parent <span style="margin:0px;padding:0px;color:rgb(54,53,52)">=</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">0</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  ~CustomWidgetFirst<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> label<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> const<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">void</span> setLabel<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">const</span> <a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">&</span>label<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">protected</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span></div></li>




<li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">void</span> paintEvent<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QPaintEvent.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QPaintEvent</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span>event<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">private</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> m_label<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:green">// custom_widget_first.cpp</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include "custom_widget_first.h"</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">CustomWidgetFirst<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">CustomWidgetFirst</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span>parent<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span> <a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span>parent<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> CustomWidgetFirst<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">label</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">const</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">return</span> m_label<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">void</span> CustomWidgetFirst<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">setLabel</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">const</span> <a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">&</span>label<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span>  <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  m_label <span style="margin:0px;padding:0px;color:rgb(54,53,52)">=</span> label<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">void</span> CustomWidgetFirst<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">paintEvent</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QPaintEvent.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QPaintEvent</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span>event<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:green">// some paint</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">CustomWidgetFirst<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">~CustomWidgetFirst</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="color:rgb(54,53,52)">}</span><br></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:green">// custom_widget_second.h</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include <QWidget></span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include <QString></span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">namespace</span> Ui <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div></li>





<li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">class</span> Form<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div></li>





<li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">class</span> CustomWidgetSecond <span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">public</span> <a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a>  <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">Q_OBJECT</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  Q_PROPERTY<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> text</div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">             READ getUiCustomWidgetSecondTextLabel</div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">             WRITE setUiCustomWidgetSecondTextLabel<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">public</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">explicit</span> CustomWidgetSecond<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span>parent <span style="margin:0px;padding:0px;color:rgb(54,53,52)">=</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">0</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  ~CustomWidgetSecond<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  </div></li></div></div><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> getUiCustomWidgetFirstLabel<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> const<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;               </span><span style="color:rgb(0,128,0)">// dublicate code</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">void</span> setUiCustomWidgetFirstTextLabel<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">const</span> <a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">&</span>text<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">; </span><span style="color:rgb(0,128,0)">// dublicate code</span></div>





</li><div><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">private</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  Ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">Form</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span>ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span> <span style="margin:0px;padding:0px;color:green">// ui generated from uic and have several widgets, including CustomWidgetFirst</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:green">// custom_widget_second.cpp</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include "custom_widget_second.h"</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:gray">#include "ui_form.h"</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">CustomWidgetSecond<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">CustomWidgetSecond</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span>parent<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(54,53,52)">:</span> <a href="http://qt-project.org/doc/QWidget.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QWidget</span></a><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span>parent<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">,</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">    ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">new</span> Ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">Form</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">-></span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">setupUi</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">this</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span></div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li></div><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> CustomWidgetSecond<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">getUiCustomWidgetFirstTextLabel</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">const</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{ </span><span style="color:rgb(0,128,0)">// duplicate code</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">return</span> ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">-></span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">CustomWidgetFirst</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">-></span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">label</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;                              </span><span style="color:rgb(0,128,0)">// duplicate code</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}                                                                     </span><span style="color:rgb(0,128,0)">// duplicate code</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"> </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">void</span> CustomWidgetSecond<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">setUiCustomWidgetFirstTextLabel</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">const</span> <a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">&</span>text<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{ </span><span style="color:rgb(0,128,0)">// duplicate code</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">-></span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">CustomWidgetFirst</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">-></span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">setLabel</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span>text<span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">;                                        </span><span style="color:rgb(0,128,0)">// duplicate code</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}                                                                               </span><span style="color:rgb(0,128,0)">// duplicate code</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  </div></li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">CustomWidgetSecond<span style="margin:0px;padding:0px;color:rgb(54,53,52)">::</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">~CustomWidgetSecond</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><span style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span> <span style="margin:0px;padding:0px;color:rgb(54,53,52)">{</span></div>





</li><li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)">  <span style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">delete</span> ui<span style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></div></li>





<li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;list-style:decimal;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;font-size:13px;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0)"><span style="margin:0px;padding:0px;color:rgb(54,53,52)">}</span></div></li></ol><div><font color="#363534" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"><span style="line-height:14px"><br>





</span></font></div></div></div><div><div>Would suggest to solve this problem in this way(The code marked as duplicate does not need anymore.):<br></div><div><ol style="font-family:'Open Sans',sans-serif;color:rgb(175,175,175);line-height:16.899999618530273px;margin:1em 0px;padding:5px 0px;list-style-position:inside">





<li style="margin:0px 0px 0px 32px;padding:0px 0px 0px 12px;font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;list-style:decimal;line-height:14px;background-image:none;border-left-width:3px;border-left-style:solid;border-left-color:rgb(108,226,108)">





<div style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:'Open Sans',sans-serif!important">Q_PROPERTY<span style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span><a href="http://qt-project.org/doc/QString.html" style="color:rgb(68,165,28);margin:0px;padding:0px;text-decoration:none" target="_blank"><span style="margin:0px;padding:0px;font-weight:bold">QString</span></a> label ALIAS CustomWidgetFirst ui->custom_widget_first_obj->value <span style="margin:0px;padding:0px;color:rgb(54,53,52)">) </span><span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;margin:0px;padding:0px;color:rgb(54,53,52)"> </span><span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace;color:rgb(0,128,0)">// where "value" property name</span></div>





</li></ol></div></div></div><div style="font-size:13px;font-family:arial,sans-serif">The ALIAS attribute indicates that the property will be reference on another<br></div><div style="font-size:13px;font-family:arial,sans-serif">





property. If ALIAS property has a signal, you need to declare the same signal</div><div style="font-size:13px;font-family:arial,sans-serif">because moc will automatically  generate connect(aliasObject, aliasSignal, yourClassObject, aliasSignal)</div>





<div style="font-size:13px;font-family:arial,sans-serif">and you will only need call initAliasNotify function in the class construct.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-10 22:43 GMT+06:00 Giuseppe D'Angelo <span dir="ltr"><<a href="mailto:dangelog@gmail.com" target="_blank">dangelog@gmail.com</a>></span>:<div>




<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Can you please explain what this feature is about, why do you think<br>
it's useful, how it's supposed to be used, etc.?<br>
<br>
On 10 March 2014 17:30, <a href="mailto:mikhail.svetkin@gmail.com" target="_blank">mikhail.svetkin@gmail.com</a><br>
<div><div><<a href="mailto:mikhail.svetkin@gmail.com" target="_blank">mikhail.svetkin@gmail.com</a>> wrote:<br>
> Hello, I would like to clarify wherein the complexity<br>
> (<a href="https://codereview.qt-project.org/#change,80412" target="_blank">https://codereview.qt-project.org/#change,80412</a>)?<br>
> Ready to listen to any suggestions and implement them.<br>
><br>
> --<br>
> Mikhail Svetkin<br>
</div></div>> _______________________________________________<br>
> Development mailing list<br>
> <a href="mailto:Development@qt-project.org" target="_blank">Development@qt-project.org</a><br>
> <a href="http://lists.qt-project.org/mailman/listinfo/development" target="_blank">http://lists.qt-project.org/mailman/listinfo/development</a><br>
<span><font color="#888888"><br>
<br>
<br>
--<br>
Giuseppe D'Angelo<br>
</font></span></blockquote></div></div><br></div>
<br>_______________________________________________<br>
Development mailing list<br>
<a href="mailto:Development@qt-project.org" target="_blank">Development@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/development" target="_blank">http://lists.qt-project.org/mailman/listinfo/development</a><br>
<br></blockquote></div></div></div><br></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div>