NDEVR
API Documentation
RandomMessageView.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/QCustomStackedWidget.h>
4#include <NDEVR/RandomMessageGenerator.h>
5#include <QLabel>
6namespace NDEVR
7{
8 class TimeSpan;
13 class NDEVR_WIDGETS_API RandomMessageView : public QCustomStackedWidget
14 {
15 Q_OBJECT
16 public:
22 RandomMessageView(const RandomMessageGenerator& generator, QWidget* parent = nullptr);
33 bool event(QEvent* event) override;
38 QLabel* label() const { return m_label; }
39 protected slots:
44 private:
45 QTimer* m_timer;
46 QLabel* m_label;
47 RandomMessageGenerator m_generator;
48 };
49}
QCustomStackedWidget(QWidget *parent=nullptr)
Constructs a stacked widget.
Stores a collection of translated messages and provides random selection from them.
void setMessageGenerator(const RandomMessageGenerator &generator)
Replaces the message generator used to supply random messages.
QLabel * label() const
Returns the label widget used to display the current message.
void setMessageDuration(TimeSpan span)
Sets the duration each message is displayed before cycling to the next.
void showNewMessageSlot()
Slot that selects and displays a new random message.
RandomMessageView(const RandomMessageGenerator &generator, QWidget *parent=nullptr)
Constructs a random message view using the given generator.
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
The primary namespace for the NDEVR SDK.