<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">The QObject inclusing just took effect for a while. The Runtime error keeps happening.<BR>My other guess is a environment problem with VisualStudio and QTLibrary specially related with the QListWidget class.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Declaring the QListWidget at the .h works fine however when I create an instance in the .cpp, the runtime error show up.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">My .h:<BR>#pragma once<BR>#include &lt;QListWidget&gt;<BR>#include &lt;QPushButton&gt;<BR>#include "StatusType.h"</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>class CStatusListWidget :<BR>&nbsp;public QObject<BR>{&nbsp;<BR>&nbsp;Q_OBJECT<BR>public:<BR>&nbsp;CStatusListWidget(void);<BR>&nbsp;~CStatusListWidget(void);<BR>&nbsp;void addStatus(CStatusType *status);</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">private slots:<BR>&nbsp;void clearList();</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">private:<BR>&nbsp;void init();<BR>&nbsp;QListWidget *m_ListWidget;<BR>&nbsp;QPushButton *m_ClearPB;<BR>};</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">My .cpp:</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">#include "statuslistwidget.h"<BR>#include &lt;QVBoxLayout&gt;<BR>#include &lt;QGroupBox&gt;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">CStatusListWidget::CStatusListWidget(void)<BR>{<BR>&nbsp;this-&gt;init();<BR>}</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>CStatusListWidget::~CStatusListWidget(void){}</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">void CStatusListWidget::init()<BR>{<BR>&nbsp;QVBoxLayout *mainLayout = new QVBoxLayout();&nbsp;<BR>&nbsp;QGroupBox *mainBox&nbsp; = new QGroupBox("Status List", NULL);<BR>&nbsp;mainBox-&gt;setLayout(mainLayout);</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;m_ListWidget = NULL; //Just assigning a NULL is working as expected.<BR>&nbsp;//m_ListWidget = new QListWidget(); //Creating an instance will compile however break at runtime.<BR>...</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">If the problem happens and I just make a build (instead of rebuild = clean + build), it keeps breaking even for a working state identified previously. The working state just return to really works after a rebuild.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">I tried with different machines and the problem is the same, i.e., somehow related with QListWidget.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Anybody can help me to solve such problem?<BR>Thanks!</DIV></div><br>


      Abra sua conta no <a href="http://br.rd.yahoo.com/mail/taglines/mail/*http://br.mail.yahoo.com/">Yahoo! Mail</a>, o único sem limite de espaço para armazenamento! 
</body></html>