[Qt-interest] Few queries on Q_PROPERTY() macro

Santhosh Y santhosh at softjin.com
Thu Jul 1 15:44:01 CEST 2010


Hi ,

Please see the following class, from which I would like to expose few 
more interfaces as part of COM object
======================================================================================
// NewGUICOMObj - COM object ;     It is derived from QObject, for 
adding Q_PROPERTY
class NewGUICOMObj : public QObject
{
         Q_OBJECT
         Q_PROPERTY(bool visible READ isVisible WRITE setVisible) //This 
is I am able to write correctly; And also I am able to use from tester 
side  using this com object
*         //Q1:  What is wrong with the following Q_PROPERTY declaration*
         //Q_PROPERTY(char *path  READ readPath WRITE setPath)
    public:
         // constructor
         NewGUICOMObj (char* p, QObject * parent = 0) : ptr_(p), 
QObject(parent)
         {
         }
*         //Q2: Following Method I would like to expose on COM object*. 
*Please tell me how to write using Q_PROPERTY*
          void RenewCallback(eOwner owner)   {...........}

*         // Q3: Following Method also I would like to expose on COM 
object*. *Please tell me how to write using Q_PROPERTY*
         int createInstance ()
         {
             int value;
             ................................ // creation goes here
             return value;
         }

         bool isVisible () const {return true;  /*TODO*/}

         void setVisible(bool on)
         {
             this->visible = on;
             createInstance();
         }

         void setPath (char* path) {this->ptr_ = path;}
         char* readPath ()const  {return ptr_;}
     private:

         bool  visible;
         char* ptr_;
         AeraLauncherNS::AeraController* controller;
};
======================================================================================
In the above class, please answer my 3-questions.

Regards,
Santhosh

-- 
----------------------------------------------------
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/20100701/58e3806a/attachment.html 


More information about the Qt-interest-old mailing list