void MainWindow::startup()
// Get pointer to layout manager for main window
// Add LCD screen to the main window layout at specified position
LCD = new(IPR5000_LCD)(this);
LCD->setGeometry(430,50,320,240);
LCD->setParent(this);
layout->addWidget(LCD);
KeyManagementAgent key_management_agent;
SettingsFileRetrievalAgent settings_agent( key_management_agent );
connect(&settings_agent, SIGNAL(updateSettingsNotification()), LCD, SLOT(restarting()));
// move it to its own thread and do stuff with it.
settings_agent.moveToThread(settingsFileUpdaterThread);
settingsFileUpdaterThread->start();
QMetaObject::invokeMethod(&settings_agent,
"worker_thread", Qt
::QueuedConnection);
}
void MainWindow::startup()
// Get pointer to layout manager for main window
QLayout* layout = this->layout();
// Add LCD screen to the main window layout at specified position
LCD = new(IPR5000_LCD)(this);
LCD->setGeometry(430,50,320,240);
LCD->setParent(this);
layout->addWidget(LCD);
KeyManagementAgent key_management_agent;
SettingsFileRetrievalAgent settings_agent( key_management_agent );
connect(&settings_agent, SIGNAL(updateSettingsNotification()), LCD, SLOT(restarting()));
// move it to its own thread and do stuff with it.
QThread *settingsFileUpdaterThread = new QThread;
settings_agent.moveToThread(settingsFileUpdaterThread);
settingsFileUpdaterThread->start();
QMetaObject::invokeMethod(&settings_agent, "worker_thread", Qt::QueuedConnection);
}
To copy to clipboard, switch view to plain text mode
void IPR5000_LCD::restarting()
{
ui->stackedWidget->setCurrentIndex(2);
}
void IPR5000_LCD::restarting()
{
ui->stackedWidget->setCurrentIndex(2);
}
To copy to clipboard, switch view to plain text mode
Like I said previously I do this sort of thing other places without problems so I don't see any reason there would be a problem with the 'LCD', it just happens to be this thread that is giving me issues.
Commenting out the code in the restarting() method still results in a segfault. I tried printing a simple debug message and it still crashes. I don't think it's a problem with the LCD class. The LCD slot is never called because the signal is never emitted, that's how I know it cant be the LCD.
Edit: It will loop about 5-8 times before it throws a segfault.
I really appreciate the help.
Bookmarks