I am confused now. I thought the problem was that an empty string was not applied, but now it is about incorrect number of whitespaces?
Cheers,
_
Printable View
I am confused now. I thought the problem was that an empty string was not applied, but now it is about incorrect number of whitespaces?
Cheers,
_
that does not explain why the designer handles an empty string correctly, but quiloader not!
regards
anda, it is about an empty string, the number of blancs is not important
regards
"Correctly" is a relative term.
Now I'm confused. So you say QUiLoader should call your method to replace the empty string with an empty string? That's not really how the property system works. If you are relying on such behavior then you are abusing the system. Property setters are for changing property values, not for something else. If you want to do some initialization or something like that, better do it either in the constructor or using QMetaObject::invokeMethod(..., Qt::QueuedConnection) to execute some code after the flow returns to the event loop.Quote:
anda, it is about an empty string, the number of blancs is not important
Could you try to explain to us what your method is doing and why?
in my custom widget I initialize the property to a non-empty string. with the designer I construct my custom widget by emptying the string. This is reflected in the ui file. When I then load in my application with quiloader.load the routine responsible for setting this property is not called in qt5.1 but called in qt4.8
regards
And why are you doing that?
my custom widget needs a default non-empty string that can be emptied by the user . in principle that should not matter
regards
If you're not willing to share more information, then I can't help you, sorry.
Attachment 9450Attachment 9451Attachment 9448Attachment 9449
I can do not more than give you these attachments of a custom widget
Indeed.
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
And what you expect to happen is something like this (using QtTest syntax)
Code:
Widget *w = new Widget; QVERIFY(!w->text().isEmpty()); QVERIFY(w->text().isEmpty());
Only that creation and setProperty() call should have been done by the QUiLoader, right?
Cheers,
_
yes, that is it. A better idea you can get through the sources a attached before
regards
Folks,
this is really a bug in QFormLoader and has been solved by the Qt-Gurus. see bug 33130
thanks to you all participating
regards
Anton