Inconsistent behavior of QSerialPort on Debian
-
All of them physical ports of your computer or converter like usb to serial ?
-
Does it also happen if you change devices e.g. exchange the devices from ttyS1 and ttyS6.
-
Silly question but, did you set DTR in your application ?
-
Hello again,
I finally figured out how this occurs.
BaseSerialDevice.cpp
class BaseSerialDevice : public QObject { Q_OBJECT .... protected: QSerialPort *serial; ....
Problematic.cpp
class Problematic : public BaseSerialDevice { Q_OBJECT ...
MainWindow.h
... private: Problematic worksLikeACharm;
Everything works as expected if defined as a NON-POINTER but if;
MainWindow.h... private: Problematic* notWorksSo;
then in MainWindow.cpp's constructor:
notWorksSo = new Problematic(parent()); or notWorksSo = new Problematic(NULL); or notWorksSo = new Problematic;
the problem occurs as defined at the start of this topic. And same situation occurs if we use QSocket as same architecture.
I tested it from scratch at least 6 times. Im sure of that case.
And Cant believe and cant understand why?
-
And if you build it with
Problematic(this)
?When you don't pass it a parent, do you delete it in the destructor of your MainWindow ?
-
@SGaist Hi.
I am tried with Problematic(this) no change. In case of no parent arg i tried with delete, but nothing changed.
I tried making it static as
MainWindow.hstatic Problematic* notWorksSo;
MainWindow.cpp
Problematic* MainWindow::notWorksSo = 0;
then in constructor
notWorksSo = new Problematic(this);
NOTHING CHANGED.
Any ideas?
-
Without seeing the implementation of these classes I can't tell.