Re: Re: How to make opie-application " kde-compatible" ?

[email protected] Thu, 25 Jan 2007 13:11:08 +0100
Newsgroups gmane.comp.handhelds.opie.devel
Message-ID <[email protected]>
> On Wed, Jan 24, 2007 at 09:07:17PM +0100, Florian Erfurth wrote:
> > I want to code my own opie-application, which works well on iPAQ, so I 
> > can compile and run natively on i386 archs (it means, without qvfb). I 
> > could do that by using #IFDEF in .h and .cpp files. But... what should I 
> > do in .pro file? I mean kde doesn't have opie libraries. Any idea?
> 
> Honestly, you are going to have to do a lot of work to do this.
Why? I only need do write some lines in order to use qt-libs instead of opie-libs. My code uses following opie-headers:
#include <opie2/ofiledialog.h>
#include <opie2/oprocess.h>

Which could be easily changed to:
#include <qfiledialog.h>
#include <qprocess.h>

And following qpe-header:
#include <qpe/qpeapplication.h>
should be changed to:
#include <qapplication.h>

Of course I should adapt the codes, which uses the opie/qpe-headers. Especially oprocess.h. But that is really easy for me! The .ui file is created by qt-designer2  and it should be no problem with qmake. The only problem is the .pro-file. This contains following:
>>>
TEMPLATE = app
CONFIG  += qt warn_on release
DESTDIR  = $(OPIEDIR)/bin
HEADERS  = speech2textImpl.h
INTERFACES= speech2text.ui
SOURCES  = main.cpp speech2textImpl.cpp
TARGET  = speech2text
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS    += -lopieui2 -lopiecore2
include ( $(OPIEDIR)/include.pro )
<<<

Now you see, in the following lines (DESTDIR, INCLUDEPATH, DEPENDPATH, LIBS and include) need modification in order to be able to create Makefile by entering qmake

> I think you would be better off having an engine which is portable to
> both platforms.
What do you mean with "engine"? Maybe a compile-script?

> Then a UI that is in the Opie tree and an UI which is
> for your favorite desktop. It is a pain to use two different UI code
> sets. But you will find that the Qt libs differ enough between 3.x and
> 2.3 that it isn't comfortable to have one code base for the UI. Pile on
> the differences involved in developing for a handheld vs. a desktop
> (where there are vastly more resources) and one code base will be
> unmanageable.
I think there is no need to change the .ui-file in order to be able to use qmake from qt3. But if it doesn't works, then I can easily create a second .ui-file and then I should modify the INTERFACE line in .pro-file.

cu Floh








_______________________________________________

http://opie.handhelds.org/cgi-bin/moin.cgi/DeveloperWikiIndex

Opie-devel mailing list
[email protected]
https://handhelds.org/mailman/listinfo/opie-devel