janus
11th April 2009, 13:17
Hi,
I crated a simple designerplugin. It is a subclassed QLineEdit with a few additional properties:
class QDESIGNER_WIDGET_EXPORT LineEdit : public QLineEdit
{
Q_OBJECT
Q_PROPERTY(QString tableName READ tableName WRITE setTableName)
Q_PROPERTY(QString columnName READ columnName WRITE setColumnName)
public:
LineEdit(QWidget *parent = 0);
QString tableName() const;
void setTableName(const QString &tableName);
QString columnName() const;
void setColumnName(const QString &columnName);
private:
QString m_tableName;
QString m_columnName;
};
Designer loads the plugin, but I do not get the no_translation option in the property editor. I tried to set it in domXML():
QString LineEditPlugin::domXml() const
{
return "<widget class=\"LineEdit\" name=\"lineEdit\">\n"
" <property name=\"tableName\" >\n"
" <string notr=\"true\"></string>\n"
" </property>\n"
" <property name=\"columnName\" >\n"
" <string notr=\"true\"></string>\n"
" </property>\n"
"</widget>\n";
}
The "notr" is always ignored and not saved to the .ui file. Any idea why? and how i can use this feature with the new properties?
I crated a simple designerplugin. It is a subclassed QLineEdit with a few additional properties:
class QDESIGNER_WIDGET_EXPORT LineEdit : public QLineEdit
{
Q_OBJECT
Q_PROPERTY(QString tableName READ tableName WRITE setTableName)
Q_PROPERTY(QString columnName READ columnName WRITE setColumnName)
public:
LineEdit(QWidget *parent = 0);
QString tableName() const;
void setTableName(const QString &tableName);
QString columnName() const;
void setColumnName(const QString &columnName);
private:
QString m_tableName;
QString m_columnName;
};
Designer loads the plugin, but I do not get the no_translation option in the property editor. I tried to set it in domXML():
QString LineEditPlugin::domXml() const
{
return "<widget class=\"LineEdit\" name=\"lineEdit\">\n"
" <property name=\"tableName\" >\n"
" <string notr=\"true\"></string>\n"
" </property>\n"
" <property name=\"columnName\" >\n"
" <string notr=\"true\"></string>\n"
" </property>\n"
"</widget>\n";
}
The "notr" is always ignored and not saved to the .ui file. Any idea why? and how i can use this feature with the new properties?