#pragma once #include #include #include #include namespace scar { struct VideoStream { QString streamId; QString username; QLabel* videoLabel; }; class VideoGridWidget : public QWidget { Q_OBJECT public: explicit VideoGridWidget(QWidget* parent = nullptr); void addStream(const QString& streamId, const QString& username); void removeStream(const QString& streamId); void updateFrame(const QString& streamId, const QPixmap& frame); void clear(); int streamCount() const { return streams_.size(); } private: void updateGridLayout(); int calculateColumns(int streamCount); QGridLayout* gridLayout_; QLabel* placeholderLabel_; std::vector streams_; static constexpr int MAX_STREAMS = 256; }; } // namespace scar