[texworks] Script: Questions about the API

Jonathan Kew jfkthame at googlemail.com
Tue Apr 20 23:03:16 CEST 2010


On 20 Apr 2010, at 06:13, Stefan Löffler wrote:

> Hi,
> 
> Am 2010-04-19 03:11, schrieb Jonathan Kew:
>> As for allowing scripts to present richer UI than the few simple dialogs that are currently available, there is an alternative approach we could explore. This is to use Qt's user interface classes, so that Qt Designer can be used to create a .ui file defining the interface (just like TW's own "native" windows and dialogs). Because all the Qt GUI code is already present in the application, this would add very little "bloat"; we'd just need a thin layer of "glue" code connecting the UI loader and widgets to scripts, rather than pulling in an entire multi-megabyte Web browser engine in order to present a dialog box.
>> 
>> I'd welcome other people's thoughts on this, too.
>> 
> 
> For comparison, I've posted a patch for using QUILoader, .ui files, and
> the Qt Designer in general
> (http://code.google.com/p/texworks/issues/detail?id=221#c13).

Cool - I'd also begun a patch for this, so I'll compare the two and see what comes out of the mixture! :)

> Note that - curiously enough - I just found out that you can embed a
> QWebView in the .ui file and it works (for me). This may be related to
> the shared Qt build I use on Linux and may not work in the monolithic
> official builds, but it's worth a try (and worth to monitor the size of
> Tw.exe closely).

That's because you're using a full Qt installation that includes the QtWebkit module (libQtWebkit.so or something like that). It won't work for people using my Mac or Windows builds, where this is not included. We could add it, of course, but the footprint would be BIG.

> 
> This also showed that there still is a bug in Lua - see
> http://code.google.com/p/texworks/issues/detail?id=335#c3 for a fix.

Thanks, I'll check that in too.

JK





More information about the texworks mailing list