C++ (Qt)QStyleOptionSlider opt;initStyleOption(&opt);QRect gr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this);int span = gr.width();