GUI Milestone 1

This commit is contained in:
Joey Yakimowich-Payne 2026-01-29 22:12:23 -07:00
commit f46f9542b4
7 changed files with 593 additions and 19 deletions

29
gui/GraphEditorWidget.cpp Normal file
View file

@ -0,0 +1,29 @@
#include "GraphEditorWidget.h"
#include "WarpGraphModel.h"
#include <QtNodes/BasicGraphicsScene>
#include <QtNodes/GraphicsView>
#include <QTimer>
#include <QVBoxLayout>
GraphEditorWidget::GraphEditorWidget(warppipe::Client *client,
QWidget *parent)
: QWidget(parent), m_client(client) {
m_model = new WarpGraphModel(client, this);
m_scene = new QtNodes::BasicGraphicsScene(*m_model, this);
m_view = new QtNodes::GraphicsView(m_scene);
auto *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(m_view);
m_model->refreshFromClient();
m_refreshTimer = new QTimer(this);
connect(m_refreshTimer, &QTimer::timeout, this,
&GraphEditorWidget::onRefreshTimer);
m_refreshTimer->start(500);
}
void GraphEditorWidget::onRefreshTimer() { m_model->refreshFromClient(); }