Exposing custom widget properties
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?
Code:
{
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;
};
Thanks :)
P.S. is there any Qt type of float like "QDecimal", "QFloat" or whatever?
Re: Exposing custom widget properties
You have to write your own plugin and float is fine since it is a generic type such as int. For a simple pugin see http://doc.trolltech.com/4.6/designe...getplugin.html