Commit 16485fbf authored by Denis Khachko's avatar Denis Khachko

Actor Draw - msleep

parent 236827ec
...@@ -294,6 +294,7 @@ bool DrawScene::event(QEvent * event) ...@@ -294,6 +294,7 @@ bool DrawScene::event(QEvent * event)
dr_mutex->lock(); dr_mutex->lock();
QGraphicsScene::event(event); QGraphicsScene::event(event);
dr_mutex->unlock(); dr_mutex->unlock();
return true;
} }
bool DrawScene::eventFilter(QObject *object, QEvent *event) bool DrawScene::eventFilter(QObject *object, QEvent *event)
...@@ -664,12 +665,14 @@ void DrawView::resizeEvent ( QResizeEvent * event ) ...@@ -664,12 +665,14 @@ void DrawView::resizeEvent ( QResizeEvent * event )
void DrawView::mouseReleaseEvent ( QMouseEvent * event ) void DrawView::mouseReleaseEvent ( QMouseEvent * event )
{ {
pressed=false; pressed=false;
DRAW->drawNet(); DRAW->drawNet();
}; };
void DrawView::mouseMoveEvent ( QMouseEvent * event ) void DrawView::mouseMoveEvent ( QMouseEvent * event )
{ {
if(pressed) if(pressed)
{ {
dr_mutex->lock();
setViewportUpdateMode (QGraphicsView::SmartViewportUpdate); setViewportUpdateMode (QGraphicsView::SmartViewportUpdate);
QPointF delta=mapToScene(press_pos)-mapToScene(event->pos()); QPointF delta=mapToScene(press_pos)-mapToScene(event->pos());
...@@ -688,6 +691,8 @@ void DrawView::resizeEvent ( QResizeEvent * event ) ...@@ -688,6 +691,8 @@ void DrawView::resizeEvent ( QResizeEvent * event )
press_pos=event->pos(); press_pos=event->pos();
qDebug()<<"Ppos"<<press_pos; qDebug()<<"Ppos"<<press_pos;
update(); update();
setViewportUpdateMode (QGraphicsView::NoViewportUpdate);
dr_mutex->unlock();
} }
}; };
void DrawView::setZoom(double zoom) void DrawView::setZoom(double zoom)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment