Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-10

I can do QT from Free Pascal

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Cliff Baeseman

After a couple of nights of hacking I figured out how to run QT from Free Pascal. I was just doing a test of something I had mentioned earlier. I am glad I did this little trial run I found out one hell of alot about the g++ compiler, ld, and the Free Pascal Compiler.

Cliff

Reply by email

Florian Klaempfl
to Cliff Baeseman
Cliff Baeseman wrote 8 lines
After a couple of nights of hacking I figured out how to run QT from Free Pascal. I was just doing a test of something I had mentioned earlier. I am glad I did this little trial run I found out one hell of alot about the g++ compiler, ld, and the Free Pascal Compiler. Cliff

I think the simplest way (but a lot of work!) to use Qt is writing C wrappers to the method calls like:

...
extern "C" {

void QObject_Method(QObject *this,int param1)
{

   this->Method(param1);

}
}

Or did you collect some knowledge about VMTs etc and simulate that using records of proc. vars?

Because our idea is to create a new class type cppclass:

type
   QObject = cppclass
      procedure Method;cppdecl;external:
      ...
   end;

to support cppclasses but for that we need some information how C++ classes work, the main is the vmt which is even different between egcs and old gcc

Reply by email

Cliff Baeseman

Here is the way that I am approaching it.

in CPP

extern "C" IntSendMessage(int Message,int WindgetID, void Data, int DataLength )

in Pascal

const
MSG_CREATE_APPLICATION = 0;
MSG_CREATE_FORM = 1;
begin
  IntSendMessage(MSG_CREATE_APPLICATION, nil,nil,nil )
  intMessageHook(@ Winproc)
  intSendMessage(MSG_CREATE_FORM,Form.ID,Form.Rect, SizeRect);
end.

Those are the only two calls declared external in a shared library. Every thing is done thru that single common interface.

Cliff

Earlier message 53 lines
-----Original Message----- From: Florian Klaempfl To: Date: Thursday, October 14, 1999 5:18 AM Subject: Re: [lazarus] I can do QT from Free Pascal >Cliff Baeseman wrote: >> >> After a couple of nights of hacking I figured out how to run QT from Free >> Pascal. I was just doing a test of something I had mentioned earlier. I am >> glad I did this little trial run I found out one hell of alot about the g++ >> compiler, ld, and the Free Pascal Compiler. >> >> Cliff >> > >I think the simplest way (but a lot of work!) to use Qt is writing C wrappers to >the method calls like: > >... >extern "C" { > >void QObject_Method(QObject *this,int param1) >{ > this->Method(param1); >} >} > >Or did you collect some knowledge about VMTs etc and simulate that using records of >proc. vars? > >Because our idea is to create a new class type cppclass: > >type > QObject = cppclass > procedure Method;cppdecl;external: > ... > end; > >to support cppclasses but for that we need some information how C++ classes work, the >main is the vmt which is even different between egcs and old gcc > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email