khedive |
2019-08-26 10:25 |
请教一下,在用你的rulebar类的时候遇到一个问题 pos = int(qRound((cur - lower) * increment + 1e-12)); if (m_direction==Qt::Horizontal){ QRect rt(pos,height-length,1,length); painter->drawLine(rt.topLeft(),rt.bottomLeft()); }else{ QRect rt(height-length,pos,length,1); painter->drawLine(rt.topLeft(),rt.topRight()); } [attachment=20757] 当pos超过窗口中心位置,在窗口偏右位置的时候,这个pos不是10的倍数,我看了下,是因为increment小于1的问题,我简单把算increment的地方的width加了个1先这么处理了,但是不清楚您当初的想法是什么 |
|