Guest User

Untitled

a guest
Jul 23rd, 2015
214
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. displayData.cpp
  2.  
  3. displayData::displayData(QPainter *painter)
  4. {
  5. painter->setFont(QFont("times", 13));
  6. painter->drawText(5,15, QString("Speed: " + QString::number(speed)));
  7. painter->drawText(5, 30, QString("Rotation: " + QString::number(planeRotation)));
  8. }
  9.  
  10. displayData.h
  11.  
  12. #ifndef DISPLAYDATA
  13. #define DISPLAYDATA
  14.  
  15. #include <QGraphicsTextItem>
  16.  
  17. class displayData : public QGraphicsTextItem{
  18. public:
  19. displayData(QPainter *painter);
  20. private:
  21. };
  22.  
  23. #endif // DISPLAYDATA
  24.  
  25.  
  26. game.cpp (relevant lines)
  27.  
  28. data = new displayData();
  29. scene->addItem(data);
RAW Paste Data