<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Using a Qt application as a library]]></title><description><![CDATA[<p dir="auto">I would like to develop a non-GUI C++ application that some functionality from a Qt application. Would it be possible to set up (for example) a CMake project that makes functions from a Qt application available in some other source code?</p>
<p dir="auto">Appreciate this is quite a vague question, and would be happy to be more specific about what I have in mind if anyone has any ideas!</p>
<p dir="auto">Regards,</p>
<p dir="auto">Ben</p>
]]></description><link>https://forum.qt.io/topic/87482/using-a-qt-application-as-a-library</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 06:02:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/87482.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Feb 2018 12:35:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using a Qt application as a library on Mon, 05 Feb 2018 14:36:51 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
Ok but if the parsing code uses anything Qt, it might not like to be created with no QApplication object.</p>
<p dir="auto">QMake is a make maker. So its already generic. As much as CMake. If you look in the build folder, you will see it creates<br />
a normale MakeFile.</p>
]]></description><link>https://forum.qt.io/post/440473</link><guid isPermaLink="true">https://forum.qt.io/post/440473</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Mon, 05 Feb 2018 14:36:51 GMT</pubDate></item><item><title><![CDATA[Reply to Using a Qt application as a library on Mon, 05 Feb 2018 14:32:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/steadysupply">@<bdi>steadysupply</bdi></a> I guess that your main concern here should not be regarding the build system (which should be phase 2) but how/if the TeXstudio application was/is prepared from the very beginning for some parts of it to be compiled/built as a module, i.e. shared library.<br />
From a quick look at its source code, it doesn't look so easy... In that case, another path could be to use just the source code itself for the part(s) you need. This approach could have the potential drawback of maintenance, although you may want to use the features of the version control tool (i.e.) to <a href="https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial" target="_blank" rel="noopener noreferrer nofollow ugc">handle external submodules</a></p>
]]></description><link>https://forum.qt.io/post/440471</link><guid isPermaLink="true">https://forum.qt.io/post/440471</guid><dc:creator><![CDATA[Pablo J. Rogina]]></dc:creator><pubDate>Mon, 05 Feb 2018 14:32:36 GMT</pubDate></item><item><title><![CDATA[Reply to Using a Qt application as a library on Mon, 05 Feb 2018 14:26:02 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your reply. I don't intend on having the shared library display any UI, I just want to use some features of a Qt application in the backend for a web site; in particular the LaTeX parsing and rendering capabilities of TeXstudio (which is a Qt application).</p>
<p dir="auto">I'd like to hear from anyone who has done something similar, or has experience in porting a Qmake project to a more generic build system ...</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Ben</p>
]]></description><link>https://forum.qt.io/post/440468</link><guid isPermaLink="true">https://forum.qt.io/post/440468</guid><dc:creator><![CDATA[steadysupply]]></dc:creator><pubDate>Mon, 05 Feb 2018 14:26:02 GMT</pubDate></item><item><title><![CDATA[Reply to Using a Qt application as a library on Mon, 05 Feb 2018 14:06:12 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
As i see, you biggest issue with using it as a LIB will be to spin the message pump if you plan<br />
on letting the DLL show any GUI.<br />
<a href="https://stackoverflow.com/questions/11054087/starting-qt-gui-from-dll-in-dllstart-function" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/11054087/starting-qt-gui-from-dll-in-dllstart-function</a></p>
]]></description><link>https://forum.qt.io/post/440460</link><guid isPermaLink="true">https://forum.qt.io/post/440460</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Mon, 05 Feb 2018 14:06:12 GMT</pubDate></item><item><title><![CDATA[Reply to Using a Qt application as a library on Mon, 05 Feb 2018 13:49:01 GMT]]></title><description><![CDATA[<p dir="auto">I'm on Linux, so yes a shared library is what I'll need to create.</p>
<p dir="auto">As far as I know, the Qt application I'm looking at doesn't offer a command line interface (or other programmable interface) for the features I'm interested in.</p>
<p dir="auto">My question was really <em>how</em> would I start to go about creating a shared library from a Qt project that is designed to build an executable and not a shared library? The particular project in question is TeXstudio. I already asked a similar question over there: <a href="https://github.com/texstudio-org/texstudio/issues/30" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/texstudio-org/texstudio/issues/30</a></p>
<p dir="auto">I imagine it would be a question of porting the <code>qmake</code> config files to some other build system (I'll probably use CMake) ... is this something people do? Are there any resources out there discussing common fitfalls etc?</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Ben</p>
]]></description><link>https://forum.qt.io/post/440454</link><guid isPermaLink="true">https://forum.qt.io/post/440454</guid><dc:creator><![CDATA[steadysupply]]></dc:creator><pubDate>Mon, 05 Feb 2018 13:49:01 GMT</pubDate></item><item><title><![CDATA[Reply to Using a Qt application as a library on Mon, 05 Feb 2018 13:36:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/steadysupply">@<bdi>steadysupply</bdi></a> so to understand, you want to create an application that would reuse functionality available already in a Qt application, right?<br />
Ideally, such Qt application should be written in a way that GUI is separated from backend, and in this case you need to create a shared library (or DLL in Windows)with the backend features so it can be used by other applications.<br />
If changes to source code of Qt application is not possible, how is such Qt application exposing the feature(s) you want to use? (i.e. provinding different command line arguments make the application do some things? or does the Qt application expose some REST API?)</p>
]]></description><link>https://forum.qt.io/post/440445</link><guid isPermaLink="true">https://forum.qt.io/post/440445</guid><dc:creator><![CDATA[Pablo J. Rogina]]></dc:creator><pubDate>Mon, 05 Feb 2018 13:36:26 GMT</pubDate></item><item><title><![CDATA[Reply to Using a Qt application as a library on Mon, 05 Feb 2018 12:55:26 GMT]]></title><description><![CDATA[<p dir="auto">I think you should make a dll.</p>
]]></description><link>https://forum.qt.io/post/440434</link><guid isPermaLink="true">https://forum.qt.io/post/440434</guid><dc:creator><![CDATA[mrdebug]]></dc:creator><pubDate>Mon, 05 Feb 2018 12:55:26 GMT</pubDate></item></channel></rss>