QSlider handle is being hidden when changing the background of the groove

后端 未结 1 1365
再見小時候
再見小時候 2021-01-24 03:03

I\'m trying to change the background image of the grove and set an image on the handle. While doing so, I ran into a situation where the handle (which works) is being covered b

相关标签:
1条回答
  • 2021-01-24 03:22

    It seems to be a bug, it seems that the handle is resized to a size that makes it invisible, but if it can move with some difficulty. The last statement I checked with the following code.

     connect(mySlider, &QSlider::valueChanged, [=](int value){
         qDebug()<<value;
     });
    

    It is advisable to place a width and height, by example:

    mySlider->setStyleSheet("QSlider::groove:horizontal {background-color:yellow;}"
                            "QSlider::handle:horizontal {background-color:blue; height:16px; width: 16px;}");
    

    0 讨论(0)
提交回复
热议问题