+/**
+ * Draws route to the route dialog
+ * @param QPaintEvent
+ */
+void RouteDialog::paintEvent(QPaintEvent *)
+{
+ int i, maxi;
+ qreal x1, y1, x2, y2;
+ int scx1, scy1, scx2, scy2;
+
+ QPainter painter(this);
+
+ painter.setRenderHint(QPainter::Antialiasing, true);
+ painter.setPen(QPen((Qt::black),2));
+ painter.setBrush(QBrush((Qt::yellow), Qt::SolidPattern));
+
+ // Draw route window frsme
+ painter.drawLine(left,top,right,top);
+ painter.drawLine(right,top,right,bottom);
+ painter.drawLine(left,top,left,bottom);
+ painter.drawLine(left,bottom,right,bottom);
+
+ maxi = vertexList.size();
+ for (i=0; i<maxi-1; i++)
+ {
+ x1 = vertexList.at(i).x();
+ y1 = vertexList.at(i).y();
+ x2 = vertexList.at(i+1).x();
+ y2 = vertexList.at(i+1).y();
+
+ scx1 = left + (x1-xmin)/(xmax-xmin)*(right-left);
+ scy1 = top + (ymax-y1)/(ymax-ymin)*(bottom-top);
+ scx2 = left + (x2-xmin)/(xmax-xmin)*(right-left);
+ scy2 = top + (ymax-y2)/(ymax-ymin)*(bottom-top);
+
+ painter.drawLine( scx1, scy1, scx2, scy2);
+ }
+}
+