这是一个基于模板部件的CSS 规则。
这个CSS 规则的CSS 样式属性是基于一个模板部件的属性来定义的。当你修改那个模板部件时 ,那些改变会反映到这个CSS 规则以及所有拥有这个CSS 规则的部件中 。
使用示例:
Wt::WCssTemplateRule *styleRule = new Wt::WCssTemplateRule("#" + id() + " .item");
Wt::WApplication::instance()->styleSheet().addRule(styleRule);
styleRule->templateWidget()->resize(100, WLength::Auto);
styleRule->templateWidget()->decorationStyle().setCursor(PointingHandCursor);
参考 :
HxLauncher: Launch Android applications by voice commands