My target languages are Python and (hopefully) Ocaml.
However, if you didn't see, I'm familiar with how SWIG works as far as writing interfaces. I'm curious as to how you might write a SWIG interface for an application that is built on top of Qt. There are cases when swig must generate a wrapper function that must receive an object that it doesn't know anything about; there isn't something like PyQt for SWIG that will allow you to build your interfaces and have support for the underlying libraries. However, I read in the SWIG manual that SWIG treats unknown objects as pointers, so that it didn't matter. Indeed, I generated my interface just fine, although when I called into it it seg faulted.
I'm pretty sure, but not completely, that SIP is what I want to use, but I'd like to be able to use SWIG for the capability to generate interfaces to other languages, such as OCaml.
________________________________
From: Ruben De Smet <ruben.de.smet@...>
To: Kenneth Miller <kennethadammiller@...>
Sent: Wednesday, August 28, 2013 3:06 PM
Subject: Re: [Swig-user] Using SWIG to wrap application written in QT
What is your target language? Some are better supported than others.
Anyway, I'm new too to swig, I wont be a massive help.
You'll want to write a specialised interface file though, which will
'convert' between C(++) and your scripting language.
I wrote some wrappers to PHP in the meantime, continuing tomorrow
Greets
R
Op 28-08-13 22:01, Kenneth Miller schreef:
> ping :)
>
> ------------------------------------------------------------------------
> *From:* Kenneth Miller <kennethadammiller@...>
> *To:* "swig-user@..." <swig-user@...>
> *Sent:* Monday, August 26, 2013 8:16 AM
> *Subject:* Using SWIG to wrap application written in QT
>
> So I have this application that I'm writing that uses the Qt libraries.
> I want to wrap the my application and all of it's objects so that I can
> call it from a scripting language quickly, be it python, or ocaml or
> whatever. Anyway, for the last bit I've been trying to get a module
> compiled that will allow me to dynamically call into the classes &
> functions that I've defined. SWIG seems to work right, and recently I
> even got my own self defined class within a module from my C++ source to
> run, although it segfaulted and I have yet to find out exactly why.
>
> Can this be done? I mean, I was wondering it would be more appropriate
> that I use SIP, or if maybe what I'm looking to do is dangerous because
> I am building off the Qt platform... One of the problems that I'm facing
> (I think) is that some arguments to my classes and functions are Qt
> objects. But I can't export those functions in my SWIG module without
> also writing a wrapper to the Qt objects manually (is that right?). I'm
> very new to SWIG, but I definitely need the speed of a scripting
> language for my development, because C++ and qt without it are just
> tremendously slow. Plus I have a slow machine.
>
> Can anybody advise me what the best route is in order to get what I
> want? SIP or SWIG?
>
>
>
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Swig-user mailing list
> Swig-user@...
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
--
Rubens Fortune
...[Linux's] capacity to talk via any medium except smoke signals. --
Dr. Greg Wettstein, Roger Maris Cancer Center |