From 9674c5ea91912d07f4726140ca2c88669c03f874 Mon Sep 17 00:00:00 2001 From: Samu Laaksonen Date: Sun, 21 Oct 2012 15:46:32 +0300 Subject: HUD demo Added: - some ideas to test display of hud elements Fixed: - HUD now follows the scene when it moves --- src/CircularDisplay.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/CircularDisplay.cpp') diff --git a/src/CircularDisplay.cpp b/src/CircularDisplay.cpp index 31136e7..7a1dc0f 100644 --- a/src/CircularDisplay.cpp +++ b/src/CircularDisplay.cpp @@ -23,17 +23,32 @@ void CircularDisplay::initShape() QPen pen(QColor(0, 0, 0, 255)); QBrush brush(m_displayColor); - pen.setWidth(5); + pen.setWidth(4); p.setPen(pen); - p.setBrush(brush); // draw base ellipse p.drawEllipse(QPointF(25, 35), 20, 20); + p.setBrush(brush); + + // first 1/4th + //p.drawPie(5, 15, 40, 20, 0, 180 * 16); + + // last 1/4th + //p.drawPie(25, 35, 40, 20, 0, -180 * 16); + + // upper half + //p.drawPie(5, 15, 40, 40, 0, 180 * 16); + + // lower half + pen.setWidth(2); + p.setPen(pen); + p.drawPie(5, 15, 40, 40, 0, -180 * 16); + // draw "tick" lines - p.drawLine(25, 15, 25, 0); // 12 o'clock - p.drawLine(45, 35, 60, 35); // 3 o'clock - p.drawLine(25, 55, 25, 70); // 6 o'clock + //p.drawLine(25, 15, 25, 0); // 12 o'clock + //p.drawLine(45, 35, 60, 35); // 3 o'clock + //p.drawLine(25, 55, 25, 70); // 6 o'clock } void CircularDisplay::setDisplayColor(QColor col) -- cgit v1.2.3