[RQt-devel] next steps

Deepayan Sarkar deepayan.sarkar at gmail.com
Sat Nov 14 08:20:01 CET 2009


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)

(2) Add a new class to that package.

> 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).

-Deepayan


More information about the Qtinterfaces-devel mailing list