The button is only stroked on one side, and the text will move
-
Hello, I am in the hover style of the button, that is, when the mouse is moved to the button, I use qss to add border-bottom: 2px solid rgb(255, 255, 255); But the mouse does have a stroke, but the text is The position has also moved up at the same time. If it is stroked on the left, the text will move to the right. How to solve it? In order to let you know my problem quickly, I recorded a few seconds of video to name my problem like you.
Video address: http://qxgtityw1.hn-bkt.clouddn.com/demo.mp4 -
I do not see anything like a button being hovered with moving text in your video.
If the overall size of the button is not changing, and you increase the bottom border from 0 to 2 pixels, then the padding and content would have to move up to allow the border to be drawn.
https://doc.qt.io/qt-5/stylesheet-customizing.html#box-modelYou could try always having a 2 pixel bottom border that changes from rgb(255,255,255,0) to rgb(255,255,255,255), i.e. from transparent white to opaque white.