Something went wrong. Try again.
The agentic engineering control plane for the posthuman future
Something went wrong. Try again.
1.2 kB · 54 lines
C++
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#include "PaneDragController.h"
using namespace Qt::Literals::StringLiterals;
PaneDragController::PaneDragController(QObject* parent) : QObject(parent){}
AppModel* PaneDragController::model() const{ return m_model;}
void PaneDragController::setModel(AppModel* model){ if (m_model == model) { return; } m_model = model; emit modelChanged();}
QString PaneDragController::classifyZone(const qreal nx, const qreal ny){ if (nx < 1.0 / 3.0) { return u"left"_s; } if (nx > 2.0 / 3.0) { return u"right"_s; } if (ny < 1.0 / 3.0) { return u"up"_s; } if (ny > 2.0 / 3.0) { return u"down"_s; } return u"center"_s;}
void PaneDragController::executeDrop(const QString& draggedPaneId, const QString& targetPaneId, const QString& zone) const{ if (m_model == nullptr || draggedPaneId.isEmpty() || targetPaneId.isEmpty() || zone.isEmpty()) { return; } if (zone == u"center"_s) { m_model->swapPanes(draggedPaneId, targetPaneId); } else { m_model->movePaneBeside(draggedPaneId, targetPaneId, zone); }}