This is something i´ve been struggling with since i started using stylesheets on QT.
I have this style:
QPushButton#btnNewCamera
{
border-radius: 5px;
min-width: 20px;
min-height: 20px;
background-position: center;
background-repeat: no-repeat;
}
This is the code I had to set to make it work.
createNewCameraBtn = new QPushButton();
createNewCameraBtn->setObjectName( tr("btnNewCamera") );
createNewCameraBtn->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
createNewCameraBtn->setFixedWidth(20);
Does it make sense?. Telling the size twice?. This buttons are always the same size. If i set the fixed size less than 20, it works anyway (because it keeps the minimum size from the stylesheet... so that makes me guess that stylesheet sizes are prioritary...)
But why not just tell the size inside the stylesheet. Why add those other lines?
Could somebody explain me what happens with this?. Why min-width on the styletheet to make it work?. Why not just give it the info about the background and make it work like the old style buttons?