Wizards: Fix wizards in KDE environments

KDE checks for a "text" property in the wizard pages and will then replace the
text it sees there with some text with added '&' characters. This breaks the
wizards, so rename the properties to something that is not "text".

Task-number: QTCREATORBUG-17503
Change-Id: Ie513848cef9cd795f06a47659abb550abd268b11
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-05-10 15:19:00 +02:00
parent 3c02b9b968
commit 3e8e82b2e3
3 changed files with 4 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ namespace Utils {
// Documentation inside.
class QTCREATOR_UTILS_EXPORT TextFieldCheckBox : public QCheckBox {
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(QString compareText READ text WRITE setText)
Q_PROPERTY(QString trueText READ trueText WRITE setTrueText)
Q_PROPERTY(QString falseText READ falseText WRITE setFalseText)
Q_OBJECT

View File

@@ -33,7 +33,7 @@ namespace Utils {
// Documentation inside.
class QTCREATOR_UTILS_EXPORT TextFieldComboBox : public QComboBox {
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(QString indexText READ text WRITE setText)
Q_OBJECT
public:
explicit TextFieldComboBox(QWidget *parent = 0);

View File

@@ -689,7 +689,7 @@ void CheckBoxField::setup(JsonFieldPage *page, const QString &name)
auto w = static_cast<TextFieldCheckBox *>(widget());
QObject::connect(w, &TextFieldCheckBox::clicked,
page, [this, page]() { m_isModified = true; page->completeChanged();});
page->registerFieldWithName(name, w, "text", SIGNAL(textChanged(QString)));
page->registerFieldWithName(name, w, "compareText", SIGNAL(textChanged(QString)));
}
bool CheckBoxField::validate(MacroExpander *expander, QString *message)
@@ -822,7 +822,7 @@ QWidget *ComboBoxField::createWidget(const QString &displayName, JsonFieldPage *
void ComboBoxField::setup(JsonFieldPage *page, const QString &name)
{
auto w = static_cast<TextFieldComboBox *>(widget());
page->registerFieldWithName(name, w, "text", SIGNAL(text4Changed(QString)));
page->registerFieldWithName(name, w, "indexText", SIGNAL(text4Changed(QString)));
QObject::connect(w, &TextFieldComboBox::text4Changed,
page, [page](QString) { page->completeChanged(); });
}