[RQt-devel] next steps

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Nov 13 20:17:25 CET 2009


On Fri, Nov 13, 2009 at 6:15 AM, Michael Lawrence <lawremi at gmail.com> wrote:
>
>
> On Fri, Nov 13, 2009 at 5:56 AM, Deepayan Sarkar <deepayan.sarkar at gmail.com>
> wrote:
>>
>> Hi (Michael, mostly),
>>
>> I'm at the stage where I'm happy with updates to qtutils, which is
>> basically all R code, using signals etc.
>>
>> My next target is qtdevices, i.e., a traditional R graphics device
>> using QGraphicsScene. Is this feasible at this point? I've checked in
>> a few relevant questions in qtbase/questions.txt, the first couple of
>> which would help me plan my next steps:
>>
>>
>>  o Can we use user-written classes (defined in C++) from R yet? e.g.,
>>   RSyntaxHighlighter
>>
>
> Yes, this is possible. Check out, for example, the class wizard demo.

So you're saying that it should be possible to translate a C++ class
to R, right?

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.

>>  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 needs to go into qtbase.h to be used from other packages, right?

BTW, are you getting a crash with

> library(qtbase)
> Qt$QStringList

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Traceback:
 1: .Call(qt_qmethods, x)
 2: qmethods(cl)
 3: qsmokeClass(lib, className)
 4: function () {    class <- qsmokeClass(lib, className)    rm(list =
className, envir = lib)    assign(className, class, lib)
lockBinding(className, lib)    class}()

-Deepayan


More information about the Qtinterfaces-devel mailing list