[Interest] ListElement value cannot be a property script

Gian Maxera gmaxera at gmail.com
Fri Jun 5 13:25:02 CEST 2015


Thank you. The workaround works.
But now the question is for Qt developers: Is there any possibility that in the near future this will be solved without using these kind of workaround that can be a annoying with long and complex data ?

Thanks,
Gianluca.


> On 5 Jun 2015, at 12:10, Kristoffersen, Even (NO14) <Even.Kristoffersen at Honeywell.com> wrote:
> 
> Hello,
>  
> The way I’ve been working around this limitation is to add the list elements programmatically in a Component.onCompleted: script.
>  
> ListModel
> {
>                 id: example
>  
>                 Component.onCompleted:
>                 {
>                                append(“name”: "Alexander<br><font size=\"1\">" + qsTr("Sales Executive, Russia") + "</font>")
>                 }
> }
>  
> -Even
>  
> From: interest-bounces+even.kristoffersen=honeywell.com at qt-project.org <mailto:interest-bounces+even.kristoffersen=honeywell.com at qt-project.org> [mailto:interest-bounces+even.kristoffersen=honeywell.com at qt-project.org <mailto:interest-bounces+even.kristoffersen=honeywell.com at qt-project.org>] On Behalf Of Gian Maxera
> Sent: 5. juni 2015 12:52
> To: interest at qt-project.org <mailto:interest at qt-project.org>
> Subject: [Interest] ListElement value cannot be a property script
>  
> Hello,
> I have a ListElement as following:
>  
> ListElement {
>        name: "Alexander<br><font size=\"1\">"+qsTr("Sales Executive, Russia")+"</font>"
>  
> And QML complain to load it because I cannot use script as property value for ListElement.
>  
> But if I write the following:
> ListElement {
>        name: qsTr("Alexander<br><font size=\"1\">Sales Executive, Russia</font>”)
>  
> QML can load the ListElement and there no more error.
> But I would like to don’t include into translation text the HTML tags and text that don’t need to be translated.
> So, I can solve the problem and have something similar to the first one that comply with ListElement requirements ?
>  
> Thanks,
> Gianluca.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150605/79784f09/attachment.html>


More information about the Interest mailing list