QTfrontend/ui/widget/drawmapwidget.cpp
changeset 13209 f5d36be88c61
parent 11046 47a8c19ecb60
child 13240 950186baa764
equal deleted inserted replaced
13207:d948d39e5da8 13209:f5d36be88c61
    54 {
    54 {
    55     m_scene = scene;
    55     m_scene = scene;
    56 
    56 
    57     ui->graphicsView->setScene(scene);
    57     ui->graphicsView->setScene(scene);
    58     connect(scene, SIGNAL(pathChanged()), this, SLOT(pathChanged()));
    58     connect(scene, SIGNAL(pathChanged()), this, SLOT(pathChanged()));
       
    59     connect(scene, SIGNAL(brushSizeChanged(int)), this, SLOT(brushSizeChanged_slot(int)));
    59 }
    60 }
    60 
    61 
    61 void DrawMapWidget::resizeEvent(QResizeEvent * event)
    62 void DrawMapWidget::resizeEvent(QResizeEvent * event)
    62 {
    63 {
    63     Q_UNUSED(event);
    64     Q_UNUSED(event);
   129 }
   130 }
   130 
   131 
   131 void DrawMapWidget::setPathType(DrawMapScene::PathType pathType)
   132 void DrawMapWidget::setPathType(DrawMapScene::PathType pathType)
   132 {
   133 {
   133     if(m_scene) m_scene->setPathType(pathType);
   134     if(m_scene) m_scene->setPathType(pathType);
       
   135 }
       
   136 
       
   137 void DrawMapWidget::setBrushSize(int brushSize)
       
   138 {
       
   139     if(m_scene) m_scene->setBrushSize(brushSize);
   134 }
   140 }
   135 
   141 
   136 void DrawMapWidget::save(const QString & fileName)
   142 void DrawMapWidget::save(const QString & fileName)
   137 {
   143 {
   138     if(m_scene)
   144     if(m_scene)
   177 void DrawMapWidget::pathChanged()
   183 void DrawMapWidget::pathChanged()
   178 {
   184 {
   179     ui->lblPoints->setNum(m_scene->pointsCount());
   185     ui->lblPoints->setNum(m_scene->pointsCount());
   180 }
   186 }
   181 
   187 
   182 
   188 void DrawMapWidget::brushSizeChanged_slot(int brushSize)
       
   189 {
       
   190     emit brushSizeChanged(brushSize);
       
   191 }
   183 
   192 
   184 DrawMapView::DrawMapView(QWidget *parent) :
   193 DrawMapView::DrawMapView(QWidget *parent) :
   185     QGraphicsView(parent)
   194     QGraphicsView(parent)
   186 {
   195 {
   187    setMouseTracking(true);
   196    setMouseTracking(true);