BothIf you want stylable Qt Quick components, you'll need to upgrade to Qt5.
BothIf you want stylable Qt Quick components, you'll need to upgrade to Qt5.
I found a 2 years old thread, which contains your posts
http://www.qtcentre.org/threads/4788...an-I-change-it
I think this has something very promising, maybe I can "inject" CSS into the component...
My wild idea, it ain't work. Do you have any comments, ideas, anythings... ?
qstyleitem.cppQt Code:
case Button: { if (!m_styleoption) opt->text = text(); a->setStyleSheet("background-color:black;");//=> set CSS here opt->initFrom(a); opt->features = (activeControl() == "default") ? } break;To copy to clipboard, switch view to plain text mode
I don't understand what this code is supposed to do. You are creating a push button and then you are not doing anything with it. What is the intention behind this code? If you expected that calling initFrom and passing the button would magically make your qml desktop component black then this won't happen. QStyleOption::initFrom does not do anything regarding drawing, it simply fills the QStyleOption structure with data taken from its argument. The list of variables is public so you can see in the docs what they are.
Yes, that's a wild idea![]()
I think it's the only place that can modify the style of conponents, so I try to modify it to "inject" a Qss file.
Another idea is use QDeclarative to "convert" QML to a widget and set style from there. But I have no idea how to do it now
You have any ideas?
Reality is that harsh
My team is using those components so I can't change to regulars components which use just qml statements.
Okay, I think I'll look at the source code of Qt5, hope I can reuse some elements to solve the problem.
Thank for the helpI appreciate that
![]()
Bookmarks