aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_gui/coreview/value.h')
-rw-r--r--qtmips_gui/coreview/value.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/qtmips_gui/coreview/value.h b/qtmips_gui/coreview/value.h
new file mode 100644
index 0000000..c454024
--- /dev/null
+++ b/qtmips_gui/coreview/value.h
@@ -0,0 +1,30 @@
+#ifndef VALUE_H
+#define VALUE_H
+
+#include <QGraphicsObject>
+#include <QPainter>
+
+namespace coreview {
+
+class Value : public QGraphicsObject {
+ Q_OBJECT
+public:
+ Value(bool vertical = false, unsigned width = 8, unsigned init_val = 0); // width is for number of character to be shown from number
+
+ QRectF boundingRect() const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+
+public slots:
+ void value_update(std::uint32_t);
+
+protected:
+ std::uint32_t val;
+
+private:
+ unsigned wid;
+ bool vertical;
+};
+
+}
+
+#endif // VALUE_H