<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 <QListWidget><BR>#include <QPushButton><BR>#include "StatusType.h"</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>class CStatusListWidget :<BR> public QObject<BR>{ <BR> Q_OBJECT<BR>public:<BR> CStatusListWidget(void);<BR> ~CStatusListWidget(void);<BR> void addStatus(CStatusType *status);</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">private slots:<BR> void clearList();</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">private:<BR> void init();<BR> QListWidget *m_ListWidget;<BR> 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 <QVBoxLayout><BR>#include <QGroupBox></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">CStatusListWidget::CStatusListWidget(void)<BR>{<BR> this->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> QVBoxLayout *mainLayout = new QVBoxLayout(); <BR> QGroupBox *mainBox = new QGroupBox("Status List", NULL);<BR> mainBox->setLayout(mainLayout);</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> m_ListWidget = NULL; //Just assigning a NULL is working as expected.<BR> //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>