Trolltech Home | QSA-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

QSA-interest Archive, February 2006
Using QSA: A very basic question


Message 1 in thread

Hi!

I want to make my Qt4.1 application scriptable, but am having trouble.
My app has something like below: -
[CODE]
  -
                                         Object A
                                         /             \
                              Object AA         Object AB
                            /               \
                     Object AAA       Object AAB
[/CODE]
i.e 'Object A' has two members 'Object AA' & 'Object AB' and 'Object
AA' has two more members 'Object AAA' & 'Object AAB'.

I want all of the above objects accessible from script. For this QSA doc says:
===========================================================
By passing an object to the scripting engine (using
QSInterpreter::addTransientObject() or QSProject::addObject()), this
object and all its signals, slots, properties, and child objects are
made available to scripts
===========================================================
Does it means the following code alone would expose all objects to script:-

Constructor of base object:{
    setObjectName("trial");

    qsProject = new QSProject(this);

    m_pButton1 = new QPushButton("First", this);
    m_pButton2 = new QPushButton("Second", this);
    m_pButton2->move(20, 0);
    m_pButton1->setObjectName("button");
    m_pButton2->setObjectName("buttons");

    widget = new MyWidget(this, qsProject);
    widget->setObjectName("container_");
    widget->resize(50, 50);
    widget->move(50, 50);

    m_pLabel1 = new MyLabel(this);
    m_pLabel1->setText("Hello World!");
    m_pLabel1->move(100, 100);

    m_pLabel2 = new MyLabel(this);
    m_pLabel2->setText("Are You Listning?");
    m_pLabel2->move(100, 105);

    resize( 200, 200);

    qsProject->addObject(this);
    editor = new ScriptEditor( qsProject );
    editor->show();

}

If, for example, I run "Application.trial.visible = true;" everything is file
but, if I run "Application.trial.button.visible = false;", an error is
displayed (Trying to access undefined member)

I have also tried adding all objects to the project but result is same.

Am i missing something? Please guide me.

Thanks in advance
--
 [ signature omitted ] 

Message 2 in thread

Hi

Still no answer. Is my problem not clear to you? Please give me at
least a hint. I am trying very hard without results to make it work.

With regards

Yogesh M

On 2/8/06, Yogesh M <yogeshm02@xxxxxxxxx> wrote:
> Hi!
>
> I want to make my Qt4.1 application scriptable, but am having trouble.
> My app has something like below: -
> [CODE]
>   -
>                                          Object A
>                                          /             \
>                               Object AA         Object AB
>                             /               \
>                      Object AAA       Object AAB
> [/CODE]
> i.e 'Object A' has two members 'Object AA' & 'Object AB' and 'Object
> AA' has two more members 'Object AAA' & 'Object AAB'.
>
> I want all of the above objects accessible from script. For this QSA doc says:
> ===========================================================
> By passing an object to the scripting engine (using
> QSInterpreter::addTransientObject() or QSProject::addObject()), this
> object and all its signals, slots, properties, and child objects are
> made available to scripts
> ===========================================================
> Does it means the following code alone would expose all objects to script:-
>
> Constructor of base object:{
>     setObjectName("trial");
>
>     qsProject = new QSProject(this);
>
>     m_pButton1 = new QPushButton("First", this);
>     m_pButton2 = new QPushButton("Second", this);
>     m_pButton2->move(20, 0);
>     m_pButton1->setObjectName("button");
>     m_pButton2->setObjectName("buttons");
>
>     widget = new MyWidget(this, qsProject);
>     widget->setObjectName("container_");
>     widget->resize(50, 50);
>     widget->move(50, 50);
>
>     m_pLabel1 = new MyLabel(this);
>     m_pLabel1->setText("Hello World!");
>     m_pLabel1->move(100, 100);
>
>     m_pLabel2 = new MyLabel(this);
>     m_pLabel2->setText("Are You Listning?");
>     m_pLabel2->move(100, 105);
>
>     resize( 200, 200);
>
>     qsProject->addObject(this);
>     editor = new ScriptEditor( qsProject );
>     editor->show();
>
> }
>
> If, for example, I run "Application.trial.visible = true;" everything is file
> but, if I run "Application.trial.button.visible = false;", an error is
> displayed (Trying to access undefined member)
>
> I have also tried adding all objects to the project but result is same.
>
> Am i missing something? Please guide me.
>
> Thanks in advance
> --
> Yogesh M
>

To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx


Message 3 in thread

I am also interested this. I guess the problem is how to address
the child objects. Currently I am using this:

class ObjectA : public QObject
{
    Q_OBJECT
    //Q_PROPERTY(ObjectAA objAA Read objAA)

public slots:
    ObjectAA* objAA();
}

The property does not work in my test, thats why it is commented out.
I can access it as Application.objA.objAA() however. Also I must
mention I have made registered the classes ObjectA and ObjectAA in an
objectfactory and gave them objectName's equal to the class name.

Maybe this helps. Maybe gunnar can shed a bit more light on it.
-- 
 [ signature omitted ] 

Message 4 in thread

Try passing each object to the interpreter using addTransientVariable 
().  This is assuming you are using Qt 4.1.0 and QSA 1.2.0.   
Something like this:

QList<QObject*> children = A.findChildren<QObject*>(); // Get list of  
child objects
foreach (QObject *obj, children) {
	if (!obj->objectName().isEmpty()) {
		interpreter.addTransientVariable( obj->objectName(),  
QVariant::fromValue(obj) );
	}
}

All child objects of "A" will then be accessible as global variables  
according to their object names.

Joel

On Feb 15, 2006, at 10:38 AM, Seneca wrote:

> I am also interested this. I guess the problem is how to address
> the child objects. Currently I am using this:
>
> class ObjectA : public QObject
> {
>     Q_OBJECT
>     //Q_PROPERTY(ObjectAA objAA Read objAA)
>
> public slots:
>     ObjectAA* objAA();
> }
>
> The property does not work in my test, thats why it is commented out.
> I can access it as Application.objA.objAA() however. Also I must
> mention I have made registered the classes ObjectA and ObjectAA in an
> objectfactory and gave them objectName's equal to the class name.
>
> Maybe this helps. Maybe gunnar can shed a bit more light on it.
> -- 
> Seneca
>
>
> YM> Hi
>
> YM> Still no answer. Is my problem not clear to you? Please give me at
> YM> least a hint. I am trying very hard without results to make it  
> work.
>
> YM> With regards
>
> YM> Yogesh M
>
> YM> On 2/8/06, Yogesh M <yogeshm02@xxxxxxxxx> wrote:
>>> Hi!
>>>
>>> I want to make my Qt4.1 application scriptable, but am having  
>>> trouble.
>>> My app has something like below: -
>>> [CODE]
>>>   -
>>>                                          Object A
>>>                                          /             \
>>>                               Object AA         Object AB
>>>                             /               \
>>>                      Object AAA       Object AAB
>>> [/CODE]
>>> i.e 'Object A' has two members 'Object AA' & 'Object AB' and 'Object
>>> AA' has two more members 'Object AAA' & 'Object AAB'.
>>>
>>> I want all of the above objects accessible from script. For this  
>>> QSA doc says:
>>> ===========================================================
>>> By passing an object to the scripting engine (using
>>> QSInterpreter::addTransientObject() or QSProject::addObject()), this
>>> object and all its signals, slots, properties, and child objects are
>>> made available to scripts
>>> ===========================================================
>>> Does it means the following code alone would expose all objects  
>>> to script:-
>>>
>>> Constructor of base object:{
>>>     setObjectName("trial");
>>>
>>>     qsProject = new QSProject(this);
>>>
>>>     m_pButton1 = new QPushButton("First", this);
>>>     m_pButton2 = new QPushButton("Second", this);
>>>     m_pButton2->move(20, 0);
>>>     m_pButton1->setObjectName("button");
>>>     m_pButton2->setObjectName("buttons");
>>>
>>>     widget = new MyWidget(this, qsProject);
>>>     widget->setObjectName("container_");
>>>     widget->resize(50, 50);
>>>     widget->move(50, 50);
>>>
>>>     m_pLabel1 = new MyLabel(this);
>>>     m_pLabel1->setText("Hello World!");
>>>     m_pLabel1->move(100, 100);
>>>
>>>     m_pLabel2 = new MyLabel(this);
>>>     m_pLabel2->setText("Are You Listning?");
>>>     m_pLabel2->move(100, 105);
>>>
>>>     resize( 200, 200);
>>>
>>>     qsProject->addObject(this);
>>>     editor = new ScriptEditor( qsProject );
>>>     editor->show();
>>>
>>> }
>>>
>>> If, for example, I run "Application.trial.visible = true;"  
>>> everything is file
>>> but, if I run "Application.trial.button.visible = false;", an  
>>> error is
>>> displayed (Trying to access undefined member)
>>>
>>> I have also tried adding all objects to the project but result is  
>>> same.
>>>
>>> Am i missing something? Please guide me.
>>>
>>> Thanks in advance
>>> --
>>> Yogesh M
>>>
>
> YM> To unsubscribe - send "unsubscribe" in the subject to qsa- 
> interest-request@xxxxxxxxxxxxx
>
> To unsubscribe - send "unsubscribe" in the subject to qsa-interest- 
> request@xxxxxxxxxxxxx

To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx


Message 5 in thread

Hi

Your suggestion is not working either, perhaps i am not using it correctly.

I've prepared an extremely basic trial app to check my code. I am
attaching that for further reference (it is just 6.4 KB) has .pro as
well as .kdevelop files so you can use it easily.

I've documented my experiances in qsatrial.cpp present in the package.

Hope you will take trouble to help me.

With regards

Yogesh

(Joel: I'm sending this directly to you as i don't know the attachment
will be accepted by qsa-interest or not)

On 2/15/06, Joel Nordell <joelnordell@xxxxxxxxx> wrote:
> Try passing each object to the interpreter using addTransientVariable
> ().  This is assuming you are using Qt 4.1.0 and QSA 1.2.0.
> Something like this:
>
> QList<QObject*> children = A.findChildren<QObject*>(); // Get list of
> child objects
> foreach (QObject *obj, children) {
>         if (!obj->objectName().isEmpty()) {
>                 interpreter.addTransientVariable( obj->objectName(),
> QVariant::fromValue(obj) );
>         }
> }
>
> All child objects of "A" will then be accessible as global variables
> according to their object names.
>
> Joel
>
> On Feb 15, 2006, at 10:38 AM, Seneca wrote:
>
> > I am also interested this. I guess the problem is how to address
> > the child objects. Currently I am using this:
> >
> > class ObjectA : public QObject
> > {
> >     Q_OBJECT
> >     //Q_PROPERTY(ObjectAA objAA Read objAA)
> >
> > public slots:
> >     ObjectAA* objAA();
> > }
> >
> > The property does not work in my test, thats why it is commented out.
> > I can access it as Application.objA.objAA() however. Also I must
> > mention I have made registered the classes ObjectA and ObjectAA in an
> > objectfactory and gave them objectName's equal to the class name.
> >
> > Maybe this helps. Maybe gunnar can shed a bit more light on it.
> > --
> > Seneca
> >
> >
> > YM> Hi
> >
> > YM> Still no answer. Is my problem not clear to you? Please give me at
> > YM> least a hint. I am trying very hard without results to make it
> > work.
> >
> > YM> With regards
> >
> > YM> Yogesh M
> >
> > YM> On 2/8/06, Yogesh M <yogeshm02@xxxxxxxxx> wrote:
> >>> Hi!
> >>>
> >>> I want to make my Qt4.1 application scriptable, but am having
> >>> trouble.
> >>> My app has something like below: -
> >>> [CODE]
> >>>   -
> >>>                                          Object A
> >>>                                          /             \
> >>>                               Object AA         Object AB
> >>>                             /               \
> >>>                      Object AAA       Object AAB
> >>> [/CODE]
> >>> i.e 'Object A' has two members 'Object AA' & 'Object AB' and 'Object
> >>> AA' has two more members 'Object AAA' & 'Object AAB'.
> >>>
> >>> I want all of the above objects accessible from script. For this
> >>> QSA doc says:
> >>> ===========================================================
> >>> By passing an object to the scripting engine (using
> >>> QSInterpreter::addTransientObject() or QSProject::addObject()), this
> >>> object and all its signals, slots, properties, and child objects are
> >>> made available to scripts
> >>> ===========================================================
> >>> Does it means the following code alone would expose all objects
> >>> to script:-
> >>>
> >>> Constructor of base object:{
> >>>     setObjectName("trial");
> >>>
> >>>     qsProject = new QSProject(this);
> >>>
> >>>     m_pButton1 = new QPushButton("First", this);
> >>>     m_pButton2 = new QPushButton("Second", this);
> >>>     m_pButton2->move(20, 0);
> >>>     m_pButton1->setObjectName("button");
> >>>     m_pButton2->setObjectName("buttons");
> >>>
> >>>     widget = new MyWidget(this, qsProject);
> >>>     widget->setObjectName("container_");
> >>>     widget->resize(50, 50);
> >>>     widget->move(50, 50);
> >>>
> >>>     m_pLabel1 = new MyLabel(this);
> >>>     m_pLabel1->setText("Hello World!");
> >>>     m_pLabel1->move(100, 100);
> >>>
> >>>     m_pLabel2 = new MyLabel(this);
> >>>     m_pLabel2->setText("Are You Listning?");
> >>>     m_pLabel2->move(100, 105);
> >>>
> >>>     resize( 200, 200);
> >>>
> >>>     qsProject->addObject(this);
> >>>     editor = new ScriptEditor( qsProject );
> >>>     editor->show();
> >>>
> >>> }
> >>>
> >>> If, for example, I run "Application.trial.visible = true;"
> >>> everything is file
> >>> but, if I run "Application.trial.button.visible = false;", an
> >>> error is
> >>> displayed (Trying to access undefined member)
> >>>
> >>> I have also tried adding all objects to the project but result is
> >>> same.
> >>>
> >>> Am i missing something? Please guide me.
> >>>
> >>> Thanks in advance
> >>> --
> >>> Yogesh M
> >>>
> >
> > YM> To unsubscribe - send "unsubscribe" in the subject to qsa-
> > interest-request@xxxxxxxxxxxxx
> >
> > To unsubscribe - send "unsubscribe" in the subject to qsa-interest-
> > request@xxxxxxxxxxxxx
>
> To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx
>
>

Attachment:

Attachment: qsatrial.tar.gz
Description: GNU Zip compressed data


Message 6 in thread

Yogesh,

Looking at your code, I realize my suggestion of addTransientVariable 
() was probably wrong.  In my code, I do not use QSProject, but  
rather I use QSInterpreter directly at a lower level.

Also, if you want to access objects through their parent hierarchy,  
addTransientVariable() is also wrong.  :)

I think it is correct to just do qsProject->addObject(obj).  That  
will place "obj" into the environment, and its children come along  
for the ride.  I don't know why Application.Object.Object3.print()  
does not work in your example, it seems to me it should.  The last  
one, Application.Object.Object3.Object4.print() did not work because  
Object4 is actually a child of Object2.  It does work if you do  
Application.Object.Object2.Object4.print().  :)

It might be a bug in QSA causing Object3 not to be properly  
accessible.  (Or, for that matter, it could be a bug in MY version of  
QSA which is fairly heavily patched..)

But, as far as I can tell, your example is doing everything right  
(aside from Object4's parent being actually Object2), it should work  
the way you are using it.

Joel Nordell
Software Engineer
ONEAC Corp.


On Feb 16, 2006, at 10:29 AM, Yogesh M wrote:

> Hi
>
> Your suggestion is not working either, perhaps i am not using it  
> correctly.
>
> I've prepared an extremely basic trial app to check my code. I am
> attaching that for further reference (it is just 6.4 KB) has .pro as
> well as .kdevelop files so you can use it easily.
>
> I've documented my experiances in qsatrial.cpp present in the package.
>
> Hope you will take trouble to help me.
>
> With regards
>
> Yogesh
>
> (Joel: I'm sending this directly to you as i don't know the attachment
> will be accepted by qsa-interest or not)
>
> On 2/15/06, Joel Nordell <joelnordell@xxxxxxxxx> wrote:
>> Try passing each object to the interpreter using addTransientVariable
>> ().  This is assuming you are using Qt 4.1.0 and QSA 1.2.0.
>> Something like this:
>>
>> QList<QObject*> children = A.findChildren<QObject*>(); // Get list of
>> child objects
>> foreach (QObject *obj, children) {
>>         if (!obj->objectName().isEmpty()) {
>>                 interpreter.addTransientVariable( obj->objectName(),
>> QVariant::fromValue(obj) );
>>         }
>> }
>>
>> All child objects of "A" will then be accessible as global variables
>> according to their object names.
>>
>> Joel
>>
>> On Feb 15, 2006, at 10:38 AM, Seneca wrote:
>>
>>> I am also interested this. I guess the problem is how to address
>>> the child objects. Currently I am using this:
>>>
>>> class ObjectA : public QObject
>>> {
>>>     Q_OBJECT
>>>     //Q_PROPERTY(ObjectAA objAA Read objAA)
>>>
>>> public slots:
>>>     ObjectAA* objAA();
>>> }
>>>
>>> The property does not work in my test, thats why it is commented  
>>> out.
>>> I can access it as Application.objA.objAA() however. Also I must
>>> mention I have made registered the classes ObjectA and ObjectAA  
>>> in an
>>> objectfactory and gave them objectName's equal to the class name.
>>>
>>> Maybe this helps. Maybe gunnar can shed a bit more light on it.
>>> --
>>> Seneca
>>>
>>>
>>> YM> Hi
>>>
>>> YM> Still no answer. Is my problem not clear to you? Please give  
>>> me at
>>> YM> least a hint. I am trying very hard without results to make it
>>> work.
>>>
>>> YM> With regards
>>>
>>> YM> Yogesh M
>>>
>>> YM> On 2/8/06, Yogesh M <yogeshm02@xxxxxxxxx> wrote:
>>>>> Hi!
>>>>>
>>>>> I want to make my Qt4.1 application scriptable, but am having
>>>>> trouble.
>>>>> My app has something like below: -
>>>>> [CODE]
>>>>>   -
>>>>>                                          Object A
>>>>>                                          /             \
>>>>>                               Object AA         Object AB
>>>>>                             /               \
>>>>>                      Object AAA       Object AAB
>>>>> [/CODE]
>>>>> i.e 'Object A' has two members 'Object AA' & 'Object AB' and  
>>>>> 'Object
>>>>> AA' has two more members 'Object AAA' & 'Object AAB'.
>>>>>
>>>>> I want all of the above objects accessible from script. For this
>>>>> QSA doc says:
>>>>> ===========================================================
>>>>> By passing an object to the scripting engine (using
>>>>> QSInterpreter::addTransientObject() or QSProject::addObject()),  
>>>>> this
>>>>> object and all its signals, slots, properties, and child  
>>>>> objects are
>>>>> made available to scripts
>>>>> ===========================================================
>>>>> Does it means the following code alone would expose all objects
>>>>> to script:-
>>>>>
>>>>> Constructor of base object:{
>>>>>     setObjectName("trial");
>>>>>
>>>>>     qsProject = new QSProject(this);
>>>>>
>>>>>     m_pButton1 = new QPushButton("First", this);
>>>>>     m_pButton2 = new QPushButton("Second", this);
>>>>>     m_pButton2->move(20, 0);
>>>>>     m_pButton1->setObjectName("button");
>>>>>     m_pButton2->setObjectName("buttons");
>>>>>
>>>>>     widget = new MyWidget(this, qsProject);
>>>>>     widget->setObjectName("container_");
>>>>>     widget->resize(50, 50);
>>>>>     widget->move(50, 50);
>>>>>
>>>>>     m_pLabel1 = new MyLabel(this);
>>>>>     m_pLabel1->setText("Hello World!");
>>>>>     m_pLabel1->move(100, 100);
>>>>>
>>>>>     m_pLabel2 = new MyLabel(this);
>>>>>     m_pLabel2->setText("Are You Listning?");
>>>>>     m_pLabel2->move(100, 105);
>>>>>
>>>>>     resize( 200, 200);
>>>>>
>>>>>     qsProject->addObject(this);
>>>>>     editor = new ScriptEditor( qsProject );
>>>>>     editor->show();
>>>>>
>>>>> }
>>>>>
>>>>> If, for example, I run "Application.trial.visible = true;"
>>>>> everything is file
>>>>> but, if I run "Application.trial.button.visible = false;", an
>>>>> error is
>>>>> displayed (Trying to access undefined member)
>>>>>
>>>>> I have also tried adding all objects to the project but result is
>>>>> same.
>>>>>
>>>>> Am i missing something? Please guide me.
>>>>>
>>>>> Thanks in advance
>>>>> --
>>>>> Yogesh M
>>>>>
>>>
>>> YM> To unsubscribe - send "unsubscribe" in the subject to qsa-
>>> interest-request@xxxxxxxxxxxxx
>>>
>>> To unsubscribe - send "unsubscribe" in the subject to qsa-interest-
>>> request@xxxxxxxxxxxxx
>>
>> To unsubscribe - send "unsubscribe" in the subject to qsa-interest- 
>> request@xxxxxxxxxxxxx
>>
>>
>
> <qsatrial.tar.gz>

To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx


Message 7 in thread

Yogesh M wrote:
> If, for example, I run "Application.trial.visible = true;" everything is file
> but, if I run "Application.trial.button.visible = false;", an error is
> displayed (Trying to access undefined member)

Hi Yogesh,

This is a know bug in QSA that was fixed some time ago. The attached 
patch fixes the problem.

-
Gunnar

==== src/kernel/quickobjects.cpp#47 - src\kernel\quickobjects.cpp ====
==== src/kernel/quickobjects.cpp#47 - src\kernel\quickobjects.cpp ====
@@ -225,7 +225,7 @@
         // children
         QObjectList children = object->children();
         for (int child_index=0; child_index<children.size(); ++child_index) {
-            if (p == children.at(i)->objectName()) {
+            if (p == children.at(child_index)->objectName()) {
                 mem->setWritable(false);
                 mem->setIndex(qsa_encode_member_index(ObjectType, i, child_index));
                 return true;
@@ -1529,7 +1529,7 @@
             array.put(QString::number(i), ip->wrap(l->at(i)));
         return array;
 
-    } else {        
+    } else {
         int star_count = ti.name.count('*');
         if (star_count) {
 

Message 8 in thread

Hello Gunnar,

GS> This is a know bug in QSA that was fixed some time ago. The attached
GS> patch fixes the problem.

Your patch fixes the problem, thanks! It would be perfect if the
subobject would also appear in the autocompletion drop-down of the
QSEditor. Any idea how this could be done?

-- 
 [ signature omitted ] 

Message 9 in thread

Hi QSA fellows,

regarding autocompletion one of the most wanted features requested
by our customers is that autocompletion / member function popUp
not only works when object names are typed, but also when a 
function / method is typed that returns an object of a specific
type.

E.g.
  the objects of Type Curve have tow methods: getMin() and getMax()

We have an object named "curve1" and a function getCurve() that returns 
a curve object.

When the user types:   
   curve1.   then automatically the popUp with the two methods for curve objects appear

however when the user types:
   getCurve().   nothing appears even though we know that getCurve(). returns objects of 
   type curve and could therefore show the two methods of the curve object.

What do you think?


Wolfgang


BTW: we are on QSA 1.1.3 and will need to stay on the 1.1. series for a while
     since QT 4 is not yet ready for porting our project to it :-(
                   

Seneca wrote:
> 
> Hello Gunnar,
> 
> GS> This is a know bug in QSA that was fixed some time ago. The attached
> GS> patch fixes the problem.
> 
> Your patch fixes the problem, thanks! It would be perfect if the
> subobject would also appear in the autocompletion drop-down of the
> QSEditor. Any idea how this could be done?
> 
> --
> Seneca
> 
> To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx

____________
Virus checked: AVK 16.5658 from 20.02.2006


To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx


Message 10 in thread

Wolfgang Trautenberg wrote:

>When the user types:   
>   curve1.   then automatically the popUp with the two methods for curve objects appear
>
>however when the user types:
>   getCurve().   nothing appears even though we know that getCurve(). returns objects of 
>   type curve and could therefore show the two methods of the curve object.
>
>What do you think?
>  
>

Hello, Wolfgang.

I'm sorry, but this type of introspection is not possible for a 
dynamically typed language, as you will not be able to determine which 
type of object will be returned from a given function, nor which 
properties etc. it will contain, until the given function is actually 
executed. It would in principle be possible to hack it in for certain 
very specific cases, but we've chosen not to, as we feel the lack of 
consistency would be more confusing than helpful.

best regards,
Eskil

To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx


Message 11 in thread

Eskil A. Blomfeldt wrote:

> Wolfgang Trautenberg wrote:
>
>> When the user types:     curve1.   then automatically the popUp with 
>> the two methods for curve objects appear
>>
>> however when the user types:
>>   getCurve().   nothing appears even though we know that getCurve(). 
>> returns objects of   type curve and could therefore show the two 
>> methods of the curve object.
>>
>> What do you think?
>>  
>>
> I'm sorry, but this type of introspection is not possible for a 
> dynamically typed language, as you will not be able to determine which 
> type of object will be returned from a given function, nor which 
> properties etc. it will contain, until the given function is actually 
> executed. It would in principle be possible to hack it in for certain 
> very specific cases, but we've chosen not to, as we feel the lack of 
> consistency would be more confusing than helpful.


Hi again, Wolfgang.

We've discussed this problem a little bit more, and on second thought, 
we will consider adding completion for the cases we can support.

best regards,
Eskil

To unsubscribe - send "unsubscribe" in the subject to qsa-interest-request@xxxxxxxxxxxxx


Message 12 in thread

Hello Eskil,

thanks for the quick reply.
I totally agree with you when it comes to methods of JavaScript / QSA 
classes. However when we are talking about methods of C++ classes which
are exported to QSA, then I think it should be easily possible to 
do this. That would be extremely helpfull.

regards

 Wolfgang

"Eskil A. Blomfeldt" wrote:
> 
> Eskil A. Blomfeldt wrote:
> 
> > Wolfgang Trautenberg wrote:
> >
> >> When the user types:     curve1.   then automatically the popUp with
> >> the two methods for curve objects appear
> >>
> >> however when the user types:
> >>   getCurve().   nothing appears even though we know that getCurve().
> >> returns objects of   type curve and could therefore show the two
> >> methods of the curve object.
> >>
> >> What do you think?
> >>
> >>
> > I'm sorry, but this type of introspection is not possible for a
> > dynamically typed language, as you will not be able to determine which
> > type of object will be returned from a given function, nor which
> > properties etc. it will contain, until the given function is actually
> > executed. It would in principle be possible to hack it in for certain
> > very specific cases, but we've chosen not to, as we feel the lack of
> > consistency would be more confusing than helpful.
> 
> Hi again, Wolfgang.
> 
> We've discussed this problem a little bit more, and on second thought,
> we will consider adding completion for the cases we can support.
> 
> best regards,
> Eskil

-- 
 [ signature omitted ]