Open one Qt app (not as a process) in another Qt app as a dock widget
-
Hi there,
Is it possible to open another Qt app in my current Qt app but not start it as a process with QProcess but as a separate thread?
Say, for example, open the other app in its own dock widget or MDI, whichever is better for that purpose.
Since every Qt app is derived from a QWidget, can I pass an app's object from another project to my current app's dock->setWidget(????) for example?
Would I need to create another project as a DLL and then instantiate that app in my current app so I could use it?
What's the best solution if it's doable, at all?
Thanks!
-
Hi and welcome to devnet,
No, not like that.
If you want to share classes and logic between several applications, the usual way is to create libraries and reuse them.
Some projects do that using the subdirs template where all the widgets and business logic are located in one or more libraries and then they are re-used to produce one or more applications. For example a command line tool and a GUI for it.
KDE's KPart system is another example.
-
Thank you so much for replying so quickly!
Re/ the subdirs template, I found this: https://wiki.qt.io/SUBDIRS_-_handling_dependencies
Is that a good reference?KParts sounds very intriguing but is it still being worked on or has it been archived and forgotten about?
-
It's a bit complex.
The documentation of the template has improved and should be enough.
As for the KPart status, I currently can't tell.
-
Integrate the main widget directly in your application. So you have a single application.