If the original code fragment posted is part of the real code, then the line "MainWindow m;" is creating a new second instance of MainWindow on the stack and is trying to use the QSerialPort that was previously created and opened in the first MainWindow instance.
Bookmarks