01-06-2014 08:26 AM
Setting textStyle.color from QML works just fine. Although, when I try to create controls in C++ and add them dynamically to a container created in QML, the textStyle.color gets ignored every time.
Label* lbl= new Label(); QString text("SomeText"); lbl->textStyle()->setColor(QColor("#000000")); //QColor color = QColor::fromRgb(255, 0, 0); //QVariant variant = color; //lbl->textStyle()->setColor(variant); lbl->setText(text); container->add(lbl);
container is a bb::cascades::Container instantiated from QML.
Solved! Go to Solution.
01-06-2014 08:35 AM
I haven't tried calling setColor directly, but the following works:
()); bodyTextStyle.setColor(Color::fromARGB(0xff5a595a) ); label->setTextStyle(bodyTextStyle);
Could you try if Color::fromARGB(0xaarrggbb) variant works?
01-06-2014 09:08 AM
Yep, it works. Although, there is no setTextStyle on label, but I've set it through the Builder.
works as well. The difference is that I've been using the QColor, not Color. Thanks!