Unsolved Connecting a QTcpServer to an existing QtGuiApplication business logic
-
First of all, thanks for the welcome and thanks for the reply.
I totally agree with you, but I am afraid that I have to tie to the existing application since I do not have access to that code directly.
I am just looking for a "simple" way to anyhow use the logic without messing up with the current architecture.
I know you are absolutely right, but I that is not an option for me right now.Just to point me in a direction, could you suggest me some approach? i.e., how could I (from my server class) somehow
execute
or simplycall
a function or method located inMainwindow.cpp
without messing around?Thanks again.
-
Are you allowed to modify that MainWindow class ?
-
@SGaist Yes. If I ask to, I can do it. Thanks again.
-
Can you explain what kind of logic should your server trigger ?
-
Of course, the application itself can be categorized as engineering software.
Logic basically makes calculations and numeric simulations based on some predefined input values, and some others that come over its GUI, from the user in each case.
The idea behind the server is to implement an extra channel to serve the results of the application through a web page, receiving those GUI input values through web requests, as an alternative to the current standalone desktop application.Thank you again.
-
In that case it seems that you would need to split some stuff anyway. Otherwise you will have to have your GUI application running on possibly a headless server. Doable but not really practical.
What you could do is split the calculation and business logic in its own library so you can link both the GUI and web version to it.
This would be a subdirs project. So you can have everything in one project.
There might be other client/server possible architecture but that might be out of scope.
-
@SGaist said in Connecting a QTcpServer to an existing QtGuiApplication business logic:
Otherwise you will have to have your GUI application running on possibly a headless server
Yes, I assume the final deploy will be like that, not very practical, yet valid indeed. Running in a machine with an untouched GUI which also runs the server.
Knowing that, could you please suggest me some quite specific approach from where to start trying?
Just the one which does not imply that functionality splitting, no matter if it is not a very pragmatic solution...
I would appreciate that.
Thanks for all. -
I just thought of something, you might be able to avoid the GUI part on the server machine. Pass a parameter to your application so that you can use the web version in place of the GUI version.
You can now concentrate on building your web version. The question is: is absolutely everything build within MainWindow or do you have some stuff that you can reuse in the web version ?
-
I am afraid it is all built within
MainWindow
, and I have to use logic from there.
Thanks @SGaist -
Do you mean it's one big massive class that does absolutely everything ?