I'm at a new location now and don't have the code in front of me, but it's roughly this.
class MainWindow : public [main GUI window inheritance stuff]
{
Serial m_SerialPort;
...
private slots:
void SerialEventSlot(unsigned int event);
};
class MainWindow : public [main GUI window inheritance stuff]
{
Serial m_SerialPort;
...
private slots:
void SerialEventSlot(unsigned int event);
};
To copy to clipboard, switch view to plain text mode
MainWindow::MainWindow()
{
...
connect(&m_SerialPort, SIGNAL(SerialEventSignal(unsigned int)), this, SLOT(SerialEventSlot(unsigned int))); // this call seems to fail if I try to use 'Qt::QueuedConnection'
}
MainWindow::MainWindow()
{
...
connect(&m_SerialPort, SIGNAL(SerialEventSignal(unsigned int)), this, SLOT(SerialEventSlot(unsigned int))); // this call seems to fail if I try to use 'Qt::QueuedConnection'
}
To copy to clipboard, switch view to plain text mode
void MainWindow::on_buttonClicked()
{
m_SerialPort.Run(); // This causes the receiver thread to be created.
}
void MainWindow::SerialEventSlot(unsigned int event)
{
std::cout << "Detected a Serial Event: " << event << std::endl;
}
void MainWindow::on_buttonClicked()
{
m_SerialPort.Run(); // This causes the receiver thread to be created.
}
void MainWindow::SerialEventSlot(unsigned int event)
{
std::cout << "Detected a Serial Event: " << event << std::endl;
}
To copy to clipboard, switch view to plain text mode
Bookmarks