Interfacing Qt with SIMPL library
-
I manage the SIMPL open source project (icanprogram.ca/simpl). This project has developed a QNX like synchronous Send/Receive/Reply messaging library. This project has been in existence for nearly 20 years and is very mature.
Recently I had a request from one of the SIMPL users asking how to interface with the Qt library. I know of Qt but have never developed with it.
The interfacing need is quite basic. SIMPL exposes a filedescriptor which is used to manage synchronization of messages. SIMPL uses a blocking method to ensure message continuity. We need to be able to multiplex on that file descriptor to avoid blocking the GUI while waiting for a message.
Perhaps the easiest way to see what is required is to imagine a very simple test case. A Qt interface exposes a basic text box and in SIMPL terms blocks as a Receiver. Another SIMPL module (written in C) is the Sender. It sends a text string to the GUI which in turn displays in the text box.
How would you go about designing this interface? Would you use the qsocketNotifier method? If so could you direct me to some good sample code. I know Qt uses slots and signals. Would this be the way forward?
Thanks in advance for any suggestions or pointers to sample code.
bob
-
I manage the SIMPL open source project (icanprogram.ca/simpl). This project has developed a QNX like synchronous Send/Receive/Reply messaging library. This project has been in existence for nearly 20 years and is very mature.
Recently I had a request from one of the SIMPL users asking how to interface with the Qt library. I know of Qt but have never developed with it.
The interfacing need is quite basic. SIMPL exposes a filedescriptor which is used to manage synchronization of messages. SIMPL uses a blocking method to ensure message continuity. We need to be able to multiplex on that file descriptor to avoid blocking the GUI while waiting for a message.
Perhaps the easiest way to see what is required is to imagine a very simple test case. A Qt interface exposes a basic text box and in SIMPL terms blocks as a Receiver. Another SIMPL module (written in C) is the Sender. It sends a text string to the GUI which in turn displays in the text box.
How would you go about designing this interface? Would you use the qsocketNotifier method? If so could you direct me to some good sample code. I know Qt uses slots and signals. Would this be the way forward?
Thanks in advance for any suggestions or pointers to sample code.
bob
@bobicanprogram not that I have used it before, but using QSocketNotifier sounds a good idea. You may find this example as a guideline, specially how/when to read data that is available.
-
Thanks for the prompt response. I'll take a look at that example.
Bob