Qt - Unknown property transform

非 Y 不嫁゛ 提交于 2019-12-02 18:19:09

问题


Right, I am doing a small project of mine on Qt and while using the style sheets for my MainWindow.ui it dropped me the error of Unknown property transform. I have used CSS before and I am somewhat familiar with it but I have not had any problem with doing simple translations, transformations etc.

I am well aware that transform is not a standard, yet, used in CSS but I should use -moz-transform, -o-transform, -etc-transform for different browsers.

This is the bit where I am using the transform:

QPushButton#zoomButton
 {
     border-image: url(:/Data/buttonZoom_Idle.png) 0 0 0 0 stretch stretch;
 }
 QPushButton#zoomButton:pressed 
 {
    border-image: url(:/Data/buttonZoom_Pressed.png) 0 0 0 0 stretch stretch;
 }

 QPushButton#zoomButton:hover 
 {
    border-image: url(:/Data/buttonZoom_Hover.png) 0 0 0 0 stretch stretch;
    transform: rotate(30deg); 
 }

回答1:


Qt only supports a subset of CSS for stylesheets for widgets. You find the details on what is supported (and how different properties are interpreted for the different widgets) in the Qt Style Sheets Reference Documentation.



来源:https://stackoverflow.com/questions/41115280/qt-unknown-property-transform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!