Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
nish1013
Posts: 253
Registered: ‎08-14-2010
My Device: Not Specified

sample code question

Hi,

 

Please refer to below code

 

#include <QObject>
#include <QString>
#include <bb/cascades/CustomControl>
 
class CustomTextControl : public bb::cascades::CustomControl
{
    Q_OBJECT
    Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
 
public:
    // Constructs the text control. This is where you'd instantiate its
    // visual components. 
    CustomTextControl();
    virtual ~CustomTextControl();
 
    // Get and set the text for the control
    QString text();  // why this is not "QString text() const throw()"  ?
    void setText(QString text);
 
signals:
    // Emitted when the text changes
    void textChanged();
};

 Thank you in advance

Please use plain text.