Originally Posted by
acmezger
that does not explain why the designer handles an empty string correctly, but quiloader not!
Indeed.
Originally Posted by
acmezger
anda, it is about an empty string, the number of blancs is not important
Right. With the recent discussion on spaces I wasn't sure anymore if we were talking about empty strings or non-empty string with whitespace only.
Lets be sure
You have a widget like this
{
Q_OBJECT
Q_PROPERTY(QString text READ text WRITE setText
)
public:
explicit Widget
(QWidget *parent
= 0) : QWidget(parent
), m_text
("foo") {}
void setText
(const QString &text
) { m_text
= text;
} QString text
() const { return m_text;
}
private:
};
class Widget : public QWidget
{
Q_OBJECT
Q_PROPERTY(QString text READ text WRITE setText)
public:
explicit Widget(QWidget *parent = 0) : QWidget(parent), m_text("foo") {}
void setText(const QString &text) { m_text = text; }
QString text() const { return m_text;}
private:
QString m_text;
};
To copy to clipboard, switch view to plain text mode
And what you expect to happen is something like this (using QtTest syntax)
Widget *w = new Widget;
QVERIFY(!w->text().isEmpty());
QVERIFY(w->text().isEmpty());
Widget *w = new Widget;
QVERIFY(!w->text().isEmpty());
w->setProperty("text", QString());
QVERIFY(w->text().isEmpty());
To copy to clipboard, switch view to plain text mode
Only that creation and setProperty() call should have been done by the QUiLoader, right?
Cheers,
_
Bookmarks