You’re right, I tried to draw a button by inheriting Rectangle and it was easy to style it. However, my team use qml desktop component, button is just a small case :(
I tried to modify the plugin like this: “qstyleitem.cpp” . I think I can set the style from there but don’t know how :p
case Button: {
if (!m_styleoption)
m_styleoption = new QStyleOptionButton();
QStyleOptionButton *opt = qstyleoption_cast<QStyleOptionButton*>(m_styleoption);
opt->text = text();
opt->features = (activeControl() == "default") ?
QStyleOptionButton::DefaultButton :
QStyleOptionButton::None;
}
break;
Another way is “convert” QML to a widget and apply a style for it. But I don’t know how to implement it :p
Do you have any comments, ideas …?
↧