问题
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