How to bind Qt3 and Qt4 main event loop.
Hello All.
I have a dynamic library. It were written using Qt3. The library export some function with GUI. The functions doesn't contain any Qt3 special classes in interface... It's look like:
Code:
typedef char* (*pcl_show)(const char*, const char* , const char*, const char*, const char*);
The function shows some table on screen.
So, I can use this function in any programming language. I succesfully use it in Delphi and Qt3.
But when I start use Qt4 and try to include this library in my project I found that window (from my library) does not painting in my application.
What I must do to use my GUI Qt3 library in Qt4? I think this happend because of difference between QApplication of Qt4 and Qt3. Are they have a common qApp object?
P.S. Sorry for my "English". English is not my favourite language.
Re: How to bind Qt3 and Qt4 main event loop.
Did you recompile the library for Qt4?
Re: How to bind Qt3 and Qt4 main event loop.
Quote:
Originally Posted by wysota
Did you recompile the library for Qt4?
No, I didn't. It is very difficult because this library depends on additional Qt3 designer plugins., so I need to recompile this plugins and so on... I just want to use this library in Qt4 with out recompile... Can I do that?
Re: How to bind Qt3 and Qt4 main event loop.
No, you have to recompile. Qt3 and Qt4 use separate event loops, you'd have to create separate QApplication objects and run them in different threads. I don't know if it's possible at all, as this could result in a namespace clash during linking.
Re: How to bind Qt3 and Qt4 main event loop.
It's hard to understand, but I found a solution. If I create QApplication object in my library (Qt3) first, after that I create QApplication instance in my application (Qt4) then my program begin to work properly :)
Re: How to bind Qt3 and Qt4 main event loop.
And both of the loops run in the same thread?
Re: How to bind Qt3 and Qt4 main event loop.
Quote:
Originally Posted by wysota
And both of the loops run in the same thread?
I did not create any thread manualy but two instance of QApplication. Probably QApplication create own thread and main event loop (?). I don't know exacatly... Can you explain?
Re: How to bind Qt3 and Qt4 main event loop.
Well... If you run QApplication::exec(), it never returns (or to be exact, returns when the application is about to close). To have two event loops running, you'd have to call QApplication::exec() for both application objects.