Hi, I am sorry if this is a very noobish question but I have tried to create a speed-o-meter from the clock example posted somewhere on this site.

This is my code so far in that class:
Qt Code:
  1. #include <QtGui>
  2. #include "graphview.h"
  3. #include "mainwindow.h"
  4. #include "paramwidget.h"
  5. #include "connectbar.h"
  6. #include "mapwidget.h"
  7. #include "speedometer.h"
  8.  
  9.  
  10.  
  11. SpeedoMeter::SpeedoMeter(QWidget *parent)
  12. : QWidget(parent), mdir("messages.txt")
  13. {
  14.  
  15.  
  16.  
  17. // QTimer *timer = new QTimer(this);
  18. // connect(timer, SIGNAL(timeout()), this, SLOT(update()));
  19. // timer->start(1000);
  20.  
  21. setWindowTitle(tr("Speed-O-Meter"));
  22. resize(200, 200);
  23. }
  24.  
  25. void SpeedoMeter::paintEvent(QPaintEvent *)
  26. {
  27.  
  28.  
  29. GraphView* velocity = new GraphView(mdir.getMsgInfo("VELOCITY"), mdir.getMsgInfo("UTC"));
  30. //float velocity = _minfo->getFloat(msg);
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. static const QPoint hourHand[3] = {
  38. QPoint(7, 8),
  39. QPoint(-7, 8),
  40. QPoint(0, -40)
  41. };
  42. // static const QPoint minuteHand[3] = {
  43. // QPoint(7, 8),
  44. // QPoint(-7, 8),
  45. // QPoint(0, -70)
  46. // };
  47.  
  48. QColor hourColor(0, 191, 255);
  49. // QColor minuteColor(0, 127, 127, 191);
  50.  
  51. int side = qMin(width(), height());
  52. // QTime time = QTime::currentTime();
  53.  
  54. QPainter painter(this);
  55. painter.setRenderHint(QPainter::Antialiasing);
  56. painter.translate(width() / 2, height() / 2);
  57. painter.scale(side / 200.0, side / 200.0);
  58.  
  59. painter.setPen(Qt::NoPen);
  60. painter.setBrush(hourColor);
  61.  
  62. painter.save();
  63. painter.rotate(12.0 * ((velocity(0))));
  64. painter.drawConvexPolygon(hourHand, 3);
  65. painter.restore();
  66.  
  67. painter.setPen(hourColor);
  68.  
  69. for (int i = 0; i < 12; ++i) {
  70. painter.drawLine(88, 0, 96, 0);
  71. painter.rotate(30.0);
  72. }
  73.  
  74. //painter.setPen(Qt::NoPen);
  75. //painter.setBrush(minuteColor);
  76.  
  77. //painter.save();
  78. // painter.rotate(6.0 * (time.minute() + time.second() / 60.0));
  79. //painter.drawConvexPolygon(minuteHand, 3);
  80. //painter.restore();
  81.  
  82. //painter.setPen(minuteColor);
  83.  
  84. // for (int j = 0; j < 60; ++j) {
  85. // if ((j % 5) != 0)
  86. // painter.drawLine(92, 0, 96, 0);
  87. //painter.rotate(6.0);
  88. //}
  89. }
To copy to clipboard, switch view to plain text mode 

I get the following error when I try to run it 'velocity' cannot be used as a function.
but thats exactly what I want, the line
Qt Code:
  1. GraphView* velocity = new GraphView(mdir.getMsgInfo("VELOCITY"), mdir.getMsgInfo("UTC"));
To copy to clipboard, switch view to plain text mode 
is used in one of my other classes to decleare a widget and then I place the widget out on my main windows and I get a value from it (speed), this value I want to use in my speedometer so that it looks like a cool analog speedometer and not just the value.

any sugestions?

thanks.