[Qt-interest] Build Error with Q_PROPERTY() READ method ; How to invoke a Q_PROPERTY's READ only method
Santhosh Y
santhosh at softjin.com
Wed Jul 28 11:18:18 CEST 2010
Hi,
I have implemented RenewIACallBack() in my class.
But the problem was that as you said, I need to call with 'renew' and
not with 'RenewIACallBack'
Thanks a lot
On 7/28/2010 2:06 PM, unimd at web.de wrote:
> Have you implemented your read-method RenewIACallBack() in your class
> NewGUICOMObj?
> Here you can find a very good explanation how to use properties:
> http://doc.trolltech.com/4.6.2/properties.html
>
> Furthermore if you want to use your defined property in the code you
> should call it by its name which is 'renew' in your case.
> I hope that helps...
> Cheers.
>
> ------------------------------------------------------------------------
> *Von:* Santhosh Y <santhosh at softjin.com>
> *Gesendet:* 28.07.2010 09:59:18
> *An:* "qt-interest at trolltech.com" <qt-interest at trolltech.com>
> *Betreff:* [Qt-interest] Build Error with Q_PROPERTY() READ method
> ; How to invoke a Q_PROPERTY's READ only method
>
> Hi,
>
> Please see the following class, from which I am trying to define a
> Q_PROPERTY, method which is a READ method.
> ///////////// Issue 1 ///////////////////
> class NewGUICOMObj : public QObject
> {
> Q_OBJECT
>
> Q_PROPERTY(bool RenewIACallBack READ RenewIACallBack)
>
> public:
> ............................
> }
> *1>midl\oleaut32.dll : error MIDL2020 : error generating type
> library : SetFuncAndParamNames failed : RenewIACallBack (0x8002802C)*
>
>
>
> /////////////The above issue will go, If I do the following
> ///////////////////
>
> class NewGUICOMObj : public QObject
> {
> Q_OBJECT
>
> Q_PROPERTY(bool renew READ RenewIACallBack)
>
> public:
> ............................
> }
>
> But with this change I am not able to make use of this READ
> property, which I explained in the below Issue 2.
>
> ///////////// Issue 2 ///////////////////
> This code, is to invoke COM object and call an interface which is
> defined using Q_PROPERTY.
>
> HRESULT hres =
> CoCreateInstance(QUuid("{084EF014-6C9B-4d50-8756-263CDAC6DE4B}"),
> // NewGUICOMObj Class ID ==>CLSID
> 0, CLSCTX_SERVER, IID_IUnknown, (LPVOID*)&ptr);
>
> if (hres == S_OK && ptr !=NULL ) { //success
>
> //Creating a QAxObject that wraps the COM object
> referenced by IUnknown.
> QAxObject* comObj= new QAxObject (ptr);
>
> * comObj->property("RenewIACallBack");* //Why would
> this fail?, Is it not the correct way of invoking READ only type
> Q_PROPERTY on QObject.
> } else { //failure
> }
>
>
> Thanks in advance, if some body helps in this regard.
> I am struck and dont know how to solve this!
>
> --
> ----------------------------------------------------
> 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.
> ___________________________________________________________
>
>
>
>
>
> WEB.DE DSL ab 19,99 Euro/Monat. Bis zu 150,- Euro Startguthaben und
> 50,- Euro Geldprämie inklusive! https://freundschaftswerbung.web.de
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> ___________________________________________________________
> WEB.DE DSL ab 19,99 Euro/Monat. Bis zu 150,- Euro Startguthaben und
> 50,- Euro Geldprämie inklusive! https://freundschaftswerbung.web.de
>
>
>
> _______________________________________________
> 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/20100728/becd9d0f/attachment.html
More information about the Qt-interest-old
mailing list