[Qt-interest] Qt library in (non)Qt application

Marco Borm qt-lists at retrodesignfan.eu
Mon Mar 30 10:07:58 CEST 2009


Tumarov Alexander wrote:
> This is not about GUI or non-GUI.
> I want to write a library that may be used in a QT-aware or not Qt-aware
> applications.
> Just as example - I want to create a threads inside library and use QT's
> image capabilities for image maninupalation. The API with this library will
> not contain any type exported from QT.
> How this can be do?
>
> Additional question that raises  - of object allocated on head inside shared
> library can be safely deleted (new/delete) in the application itself? 
> It was a while when I last time developed on windows - but I recall that
> there were some issues with this. 
Also under Windows there is no real problem sharing objects between app 
and dlls if you do it the right way:
1. Components sharing objects on the head must use the same heap-manager
Typically this means using the same crt in all components and use them 
as a dll/so.
2. If you share objects using a base class / interface pointer don't 
miss the virtual deconstructor if the receiver should delete the object.

I think the bigger problem here is that you don't know if the app will 
construct a QApplication or not.

> Qt has a lot of implicitly shared
> objects... it's good to know how they deallocated :)
>
> Dan White wrote:
>
>   
>> If you use Qt, your application is Qt based.
>>
>> Might you be asking about GUI vs non-GUI applications ?
>>
>> On Mar 29, 2009, at 5:41 AM, Tumarov Alexander wrote:
>>
>>     
>>> I am looking for information what should be done (if possible) to use
>>> Qt in a library that is going to be used by application that
>>> 1) can be qt based
>>> 2) can be non-qt based.
>>>
>>> is there any good documents that explain what should and what
>>> should not be
>>> done in/with such library?
>>>
>>> p.s. library can be either shared or static.
>>>
>>> Thank you in advance.
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>       
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>   




More information about the Qt-interest-old mailing list