hi all,
I am working on Visual studio C++ with Qt4.7.
I have a class and I made a button in the toolBar and connect it to a method. and connect the method to another class. and when I debug, the error found is: "Unhandled exception at 0x505b3f4f (QtCored4.dll) in zsensormonitor.exe: 0xC0000005: Access violation writing location 0xcccccccc."
mainwindow.cpp
Node *sNode;
connect(work,SIGNAL(clicked()),this,SLOT(showC()));
void MainWindow::showC()
{
find_Addr();
}
void MainWindow::find_Addr()
{
this->sNode->showB();
}
node.cpp
static QList <QString> list;
void Node::showB()
{
for(int i=0; i<=list.size(); i++)
{
list << Address;
m.setText(list[i]);
m.exec();
}
}
Node *sNode;
work=new QPushButton(tr("please"));
connect(work,SIGNAL(clicked()),this,SLOT(showC()));
void MainWindow::showC()
{
find_Addr();
}
void MainWindow::find_Addr()
{
this->sNode->showB();
}
node.cpp
static QList <QString> list;
void Node::showB()
{
QMessageBox m;
QPushButton *b;
QPushButton *k;
b=m.addButton(tr("Ok"),QMessageBox::AcceptRole);
k=m.addButton(tr("Cancel"),QMessageBox::AcceptRole);
for(int i=0; i<=list.size(); i++)
{
list << Address;
m.setText(list[i]);
m.exec();
}
}
To copy to clipboard, switch view to plain text mode
please anyone help me
Bookmarks