Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to auto connect serial port without any clicking on button ?
huythy last edited by huythy
Hello everyone, I have a question .
I wonder if Qt can auto connect a device through serial by itself ?
I mean when i run program, qt looks for a serial port - just one port as the same time, and auto connect it without any clicking on button.
Please help me answer this question. Thank you !
@huythy Not sure what the problem is. When your app starts then just connect the serial port - there is no need for any buttons, you can use serial port even in command line apps without any GUI.
You need to write a code for this. During the startup of the program you can call function which connects to SerialPort. By looking at your explanation, you are clicking on button and this click must be connected a slot(function) which does connections to serial port. In scenario call the slot directly. Slot is like any other member function. No special treatment!!! for slot.
huythy last edited by
I understood that issue, my code is running well. Thank you all of you very much.