Is there a way to have custom widget properties shown in Qt Creator ( in this section http://imgur.com/TJx6F.png ) just using promotion? I find that the plugin method is quite tedious and promotion is so easy, I'd love to get them from just promoting.
If the only way to get these properties into Qt Creator is with plugins, is this the correct way of exposing the price and name variables?
{
Q_OBJECT
Q_PROPERTY( QString m_sServiceName READ getServiceName WRITE setServiceName DESIGNABLE
true );
Q_PROPERTY( float m_fPrice READ getPrice WRITE setPrice DESIGNABLE true );
public:
ServiceButton
(QWidget *parent
= 0);
public slots:
float getPrice();
void setPrice( float f );
protected:
float m_fPrice;
};
class ServiceButton : public QPushButton
{
Q_OBJECT
Q_PROPERTY( QString m_sServiceName READ getServiceName WRITE setServiceName DESIGNABLE true );
Q_PROPERTY( float m_fPrice READ getPrice WRITE setPrice DESIGNABLE true );
public:
ServiceButton(QWidget *parent = 0);
public slots:
QString getServiceName();
void setServiceName( QString s );
float getPrice();
void setPrice( float f );
protected:
QString m_sServiceName;
float m_fPrice;
};
To copy to clipboard, switch view to plain text mode
Thanks 
P.S. is there any Qt type of float like "QDecimal", "QFloat" or whatever?
Bookmarks