当前位置: 代码迷 >> QT开发 >> 怎么去掉Qt绘图中的白线
  详细解决方案

怎么去掉Qt绘图中的白线

热度:109   发布时间:2016-04-25 03:30:02.0
如何去掉Qt绘图中的白线?

贴上代码:
    double x=0;
    double y=0;
    QColor brushColor;
    painter.setPen(QPen(Qt::NoPen));//明明去掉了边框
    for(x=0;x<300;x++){
        for(y=0;y<40;y++){
             brushColor.setHsl(600-x+y,255,125);//设置颜色,色度、饱和度、亮度
             painter.setBrush(QBrush(brushColor));                                                
             painter.drawRect(210+x*sectionWidth/300,58+y*sectionHeight/40,sectionWidth/300,
             sectionHeight/40);//sectionWidth、sectionHeight分布是区域的宽和高
        }
    }

我明明去掉了边线,为什么会出现白线呢?求大神支招去掉白线!

------解决方案--------------------
不要去掉边框,将边框和画刷的颜色设置的一样,你一个问题还问了两遍
  相关解决方案