[RQt-devel] next steps

Michael Lawrence lawremi at gmail.com
Sat Nov 14 16:20:35 CET 2009


On Fri, Nov 13, 2009 at 11:20 PM, Deepayan Sarkar <deepayan.sarkar at gmail.com
> wrote:

> On Fri, Nov 13, 2009 at 1:04 PM, Michael Lawrence <lawremi at gmail.com>
> wrote:
>
> >> It would also be useful to have an existing C++ class wrapped
> >> directly, as with the Qt classes. How much work is involved in having
> >> that set up? This must be a common enough problem.
> >>
> >
> > This is a problem and is a major hang-up for qtpaint. Essentially, we
> need
> > to generate the smoke metadata/bindings for every class we define in C++.
> > Otherwise, instances of the class are not compatible with Smoke (which is
> > usually important when you are extending a Qt class).
>
> So basically, there's some manual work that needs to be done for each
> new class to be made available. Do you have a sense of how much work
> it would be to:
>
> (1) Create a new package with smoke bindings (say that produces a new
> "module" like Qt)
>
>
With qtpaint, I'm trying to figure out the minimal amount of work necessary.
It won't be that bad, if it's well documented. Just need to copy over a lot
of boilerplate and modify the right files. I'd like to do more sharing,
especially with qtbase, but R does not make it so easy. For example, we'd
have to compile the smokegenerator separately for each package. If I could
find that within some 'bin' directory in qtbase it would be a lot cleaner.

(2) Add a new class to that package.
>

This would only require adding a single element to an XML file.


>
> For qtpaint, I'm working on getting the infrastructure in place for
> > generating Smoke for some of the classes (like Layer), though I think
> I'll
> > still just directly bind the painting interface, since Painter just
> derives
> > from QObject, and we do not need those methods.
>
> Sounds good.
>
> >> >>  o Related question: Let's say I want to manipulate a QWidget in
> >> >>   native code; e.g.
> >> >>
> >> >>   In R:
> >> >>
> >> >>      edit <- Qt$QTextEdit()
> >> >>
> >> >>   The in C++:
> >> >>
> >> >>      QTextEdit *editor = getPointer(edit);
> >> >>      RSyntaxHighlighter *highlighter =
> >> >>          new RSyntaxHighlighter(editor->document());
> >> >>
> >> >>   unwrapQWidget() doesn't work obviously, as it uses the old model.
> >> >>   What would be the equivalent in the new world?  If this is
> >> >>   available, then we probably get some flexibility in using both the
> >> >>   old and new models together, even if we can't easily make new C++
> >> >>   classes available in R.
> >> >>
> >> >>
> >> >
> >> > This would be unwrapSmoke().
>
> This seems to work. I've checked in a few changes in qtbase to export
> this, please take a look and make sure I haven't screwed anything up
> (or added unnecessary things).
>
>
Looks good.


> -Deepayan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20091114/384e6ecc/attachment.htm 


More information about the Qtinterfaces-devel mailing list