[Qt-interest] what is wrong with Q_property declaration

Scott Aron Bloom Scott.Bloom at onshorecs.com
Tue Jul 6 22:27:40 CEST 2010


Please only reply to the lsit....

 

Im not sure what you are trying to do.  Please give a code example
trying to get done...  Not just a line of code, but a compliable
example.

 

Scott

From: Santhosh Y [mailto:santhosh at softjin.com] 
Sent: Tuesday, July 06, 2010 3:12 AM
To: Scott Aron Bloom
Subject: Re: [Qt-interest] what is wrong with Q_property declaration

 

Hi Scott,

It works for me. I tried your suggesiton.

Is this like following:

1.	If there are any WRITE methods exposed using Q_PROPERTY then we
should call using dynamicCall () using QAxObject
2.	If there are any READ methods exposed using Q_PROPERTY then we
should call using property() using QAxObject


Is my understanding correct. But I tried sth like above and it is
working for me consistently.

Regards
Santhosh

On 7/3/2010 10:46 PM, Scott Bloom wrote: 

I may be mistaken, but that's not how I use properties...

Try this...

obj->property( "state" ).toInt()

Scott

On 7/3/10 3:23 AM, "Santhosh Y" <santhosh at softjin.com> wrote:

Hi,
What is wrong with the following Q_PROPERTY declaration; Since when I
call on QAxObject using dynamic call it is failing.

class COMObj : public QObject
{
    Q_OBJECT

        Q_PROPERTY(int state  READ RenewCallBack)

    public slots:
        // To create instance 
       int RenewCallBack ()
       {
            QWidget* w = new QWidget();
            w->setWindowTitle ("COM WIDGET");
            w->show();
            return 0;
        }
};

// Default Factory Export
QAXFACTORY_DEFAULT(
COMObj,   // Class Name
"{09855869-3BB0-4c59-B154-975AD2B4FAFB}",   // Class Id
"{9F6756D8-6F9C-418a-A4B8-1CCA467DC60B}",   // Interface Id
"{D804C926-4DC1-4dae-AC25-75C0A78DB1D9}",   // Events Id
"{1E863943-50A2-4e3b-A8F7-1EC2FF69D485}",   // Type Lib id
"{02F8986B-993A-460c-A941-6D4C245DAA37}")  // Application id
=======================================================


QAxObject* axObj_ = new QAxObject("debugbuild.COMObj");
  if (axObj_->dynamicCall("RenewCallBack") == QVariant()) { 
}

"QAxBase: Error calling IDispatch member RenewCallBack: Member not
found"

Please tell me what I am doing wrong.


----------------------------------------------------
Y Santhosh Kumar - 
Senior Software Engineer,
SoftJin Technologies Pvt Ltd,
www.softjin.com <http://www.softjin.com> 
----------------------------------------------------


Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended
solely
for  the use  of the  individual or entity  to which they  are
addressed. It
may  contain confidential,  proprietary or legally  privileged
information.
If  you  are  not  the  intended recipient please be advised that you
have
received  this  message in error and any use is strictly prohibited.
Please
immediately  delete it  and all copies of it from your system, destroy
any
hard  copies  of  it and  notify  the  sender  by return mail. You must
not,
directly or indirectly, use,  disclose,  distribute, print, or copy any
part of
this message if you are not the intended recipient.
___________________________________________________________

________________________________

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest






-- 
----------------------------------------------------
Y Santhosh Kumar - 
Senior Software Engineer,
SoftJin Technologies Pvt Ltd,
www.softjin.com
----------------------------------------------------
 
 
Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended
solely
for  the use  of the  individual or entity  to which they  are
addressed. It
may  contain confidential,  proprietary or legally  privileged
information.
If  you  are  not  the  intended recipient please be advised that you
have
received  this  message in error and any use is strictly prohibited.
Please
immediately  delete it  and all copies of it from your system, destroy
any
hard  copies  of  it and  notify  the  sender  by return mail. You must
not,
directly or indirectly, use,  disclose,  distribute, print, or copy any
part of
this message if you are not the intended recipient.
___________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100706/c12b263d/attachment.html 


More information about the Qt-interest-old mailing list