【发布时间】:2014-08-16 02:32:10
【问题描述】:
我在图形视图中绘制时用于存储点。但是当我尝试多次添加线/点时,它不会被绘制。该点被存储,但绘画只完成一次。 我已经构建了多次绘制事物的信号。以下是代码: 点.cpp
void point::mousePressEvent(QGraphicsSceneMouseEvent *e)
{
if(e->button()==Qt::LeftButton) {
if(mClick){
x1 = e->pos().x();
y1 = e->pos().y();
mClick = false;
mPaintFlag = true;
update();
emit DrawFinished();//signal connected with the slot drawpoint() to paint the things mutiple times
}
//storage
_store.set_point(e->pos());
store_point.push_back(_store);
qDebug() << _store.getValue();
qDebug() << "Size of vector =" << store_point.size() << "and" << store_point.capacity();
update();
}
【问题讨论】: