开发者

Changing stylesheet causes qlabel to move

开发者 https://www.devze.com 2023-04-07 21:16 出处:网络
I have a few labels in a horizontal layout, and I want to enable/disable a border around the labels at certain times.I can do this using stylesheets, but the problem is that every time I enable/disabl

I have a few labels in a horizontal layout, and I want to enable/disable a border around the labels at certain times. I can do this using stylesheets, but the problem is that every time I enable/disable a border this way, the label shifts left or right in the layout by a few pixels.

This is an annoying artifact that takes away from the look of the UI. Does anyone know how to prevent this 开发者_开发问答from happening?

Thanks!

Marlon


If your labels are on a plain background, then don't enable/disable the borders, just change the border colour to match the background.

0

精彩评论

暂无评论...
验证码 换一张
取 消