From 499584f856f320787bb0d72f095bde3ab0c69742 Mon Sep 17 00:00:00 2001 From: unai_71 Date: Tue, 10 Mar 2026 18:33:34 +0000 Subject: [PATCH] plan: define MainWindow Qt widget interface --- include/MainWindow.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/MainWindow.hpp diff --git a/include/MainWindow.hpp b/include/MainWindow.hpp new file mode 100644 index 0000000..77cde2f --- /dev/null +++ b/include/MainWindow.hpp @@ -0,0 +1,32 @@ +#pragma once +// MainWindow.hpp +// SPDX-License-Identifier: GPL-3.0-only +// Author: Unai Blazquez + +#include +#include +#include +#include + +/// @brief Minimal GUI window that displays the last integer received +/// from the ConsumerThread. Never blocks — values arrive via +/// Qt's queued signal/slot mechanism. +class MainWindow : public QWidget +{ + Q_OBJECT + + public: + explicit MainWindow(QWidget* parent = nullptr); + + /// @brief Returns the current text shown in the value label (for testing). + QString lastDisplayedText() const; + + public slots: + /// @brief Slot connected to ConsumerThread::valueReceived. + /// Updates the label with the new value. + void onValueReceived(int value); + + private: + QLabel* m_title_label; + QLabel* m_value_label; +};