Qt-interest Archive, March 2002
Qt and CORBA
Message 1 in thread
Hi everybody,
I'm going to implement some application using CORBA (MICO implementation).
1. Are there any problems with writing qt (console) applications using CORBA?
2. Is it better to use CApp (derived from QApplication) or implement
application as "ordinary" C++ app?
3. Is it possible to send remote signals and connecting remote slots?
Thanks in advance.
--
[ signature omitted ]
Message 2 in thread
> Hi everybody,
>
> I'm going to implement some application using CORBA (MICO
> implementation).
I have not used MICO, only TAO and OmniORB.
> 1. Are there any problems with writing qt (console)
> applications using CORBA?
No, not more problems than writing any CORBA app ;-)
One problem that you first will stumble on is that both Qt and
most ORBs want to run it's own "main thread" that kind of "hangs"
tha application. The Qt app model hangs in QApplication::exec() and
the orb usually hangs in ORB::run(). You can do ORB::run()in a seperate
thread but you will sooner or later get hard to find errors. We found
it easier to do orb work when the GUI loop is awaken, like:
void orbWork(){
if(orb->work_pending()){
orb->perform_work();
}
}
where orbWork is a slot connected to QApplications guiThreadAwake() signal.
This requires that the orb is a member variable of a QObject, but that
is usually not a problem.
> 2. Is it better to use CApp (derived from QApplication) or implement
> application as "ordinary" C++ app?
Pardon me for not understanding the question...
> 3. Is it possible to send remote signals and connecting remote slots?
I'd say no. Not using the Qt connect(SIGNAL(),SLOT()) paradigm anyhow.
The remote object that you got a reference to (somehow) will not be
a QObject but a CORBA-object of some kind. No QObject, no signal or slots.
You can naturally subclass your CORBA class from both QObject and your
CORBA interface, but you won't be able to define your slots as slots in
your IDL-file anyway so...
--
[ signature omitted ]
Message 3 in thread
On Tue 12. March 2002 09:08, you wrote:
> > 2. Is it better to use CApp (derived from QApplication) or implement
> > application as "ordinary" C++ app?
>
> Pardon me for not understanding the question...
CApp is class derived from QApplication with some CORBA extensions which are
usually written in all "tutorial" programs, so you can use it or leave it and
write the code on your own. Why? Maybe there are some incompatibilities, MICO
team use (in)famous "#define private protected" in CApp.
Thanks for other answers!
--
[ signature omitted ]