Unsolved Share Qt classes between two Qt app?
-
Imagining that I have two Qt apps running. The first one creates a Qt class QDir,for example:
QDir dir("/");
Can I send "dir" to another app?
Or how does another app access "dir"? -
@Mr-Pang
Hello,
When you want to share classes, you put them in a library (usually a dynamically loaded one) and export them from it. Each application then uses that library and the classes contained within,Kind regards.
-
Hi
To add to @kshegunov , if you want two apps to share data, you can also use
QSharedMemory as shown in the
Shared Memory Example
http://doc.qt.io/qt-5/qtcore-ipc-sharedmemory-example.htmlAlso, a low tech version could also be via
parameters
http://doc.qt.io/qt-5/qcommandlineparser.html
Even if one app is allowed to start the other. -
Thanks. This tip seems useful.
-
@kshegunov said:
@Mr-Pang
Hello,
When you want to share classes, you put them in a library (usually a dynamically loaded one) and export them from it. Each application then uses that library and the classes contained within,Kind regards.
I think the data is what is required to be shared. A library file won't help in this area without something elaborate going on inside (like QSharedMemory or equivalent).
-