2
正如我的片段中的註釋媒體鏈接解釋說:爲什麼setwidth到其他然後1使我的線消失?
如預期的筆線設置爲noneSelectedLine
哪裏筆寬度的代碼是不工作= 1
scene = new QGraphicsScene();
Qt::PenStyle ePenStyl = Qt::DashLine;
selectedLine = new QPen(Qt::blue);
noneSelectedLine = new QPen(Qt::red);
selectedLine->setWidth(2);
noneSelectedLine->setWidth(1);
noneSelectedLine->setDashPattern(QVector<qreal>(ePenStyl));
/*If this line is a comment all is running as expected, but as soon as I
set in the following line, all lines where the pen is set to
noneSelectedLine they are not drawn (or at least not visible). What could
be the reason for that?*/
//noneSelectedLine->setWidth(3);
for (int indexI = 0; indexI < 5; indexI++)
{
scene->addItem(&LineSet[indexI]);
}
可以在這裏的是什麼!原因? 如果代碼段中缺少一些信息,請告訴我,我會澄清。
我會檢查,感謝這麼遠。 – dhein