>From my experience CSS and QML doesn't mix very well.

Ended up coding a css-like styling system in JavaScript instead.

I hope future versions of QML will introduce better ways to deal with
styling and theming.

Also see: http://developer.qt.nokia.com/wiki/QmlStyling

 -Pelle

2011/6/15 Manuel Martín Ortega <[email protected]>

>  Hello,
>
> I am trying set text color from a css file in a QML.
>
> I can use css only if it is included in the Text.RichText, like this:
>
>     '<style type="text/css">
>         p
>         {
>         color:orange;
>         text-align:center;
>         }
>         </style>
>     <p>Hello</p>'
>
> The problem is I need the same configuration for different texts in
> different places so I try to load a css file but *it doesn't work*:
>
> '<head>
>         <link href="c.css" rel="stylesheet" type="text/css" />
>     </head>
>     <p>Hello</p>'
>
> OR
>
>     '<link href="c.css" rel="stylesheet" type="text/css" />
>     <p>Hello</p>'
>
> ¿Is there any way to load a css file?
>
> THX
>
> ********************************************************************
> This email and any attachments are confidential and meant only for the 
> addressees,
> and may be protected by law. If this email has been sent to you in error,
> please notify the sender immediately and delete this e-mail from your 
> computer.
> emails are not secure and we will not accept liability if this e-mail is 
> accessed
> by anyone or modified or amended following dispatch.  Any views or opinions 
> in this
> email are those of the author and do not represent those of Mirada unless 
> otherwise
> specifically stated.  Although we have taken every reasonable precaution to 
> ensure that
> any attachment to this e-mail has been checked for viruses, we do not accept
> liability for any damages.
>
> Mirada is a public limited company,
> Registered Number: 03609752
> Registered Office: Bentima House, 168-172 Old Street, London. EC1V 9BP
>
>
> _______________________________________________
> Qt-qml mailing list
> [email protected]
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>
>
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to