I found the problem. When I call the slot:
void MainWindow::newNetwork() {
if(!newnet)
newnet = new NewNetworkDialog(this);
newnet->exec();
}
void MainWindow::newNetwork() {
if(!newnet)
newnet = new NewNetworkDialog(this);
newnet->exec();
}
To copy to clipboard, switch view to plain text mode
I declared it in newnetworkdialog.h as:
QDialog* newnet;
To copy to clipboard, switch view to plain text mode
I wrongly assumed it would initialize to zero. By adding to the MainWindow constructor:
newnet = 0;
newnet = 0;
To copy to clipboard, switch view to plain text mode
It works now. My apologies as this is a basic C++ issue. But my question is why did it work in debug mode and would there be a better way to initialize the newnet to point to null?
Bookmarks