update
This commit is contained in:
parent
bc304b325e
commit
f9fbba72db
|
@ -1,4 +1,22 @@
|
||||||
#include "BehaviorEditor.h"
|
#include "BehaviorEditor.h"
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QGraphicsSceneDragDropEvent>
|
||||||
|
#include <QMimeData>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QSplitter>
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QVariant>
|
||||||
|
#include <QDrag>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QStyleOptionGraphicsItem>
|
||||||
|
#include <QStandardItem>
|
||||||
|
|
||||||
|
uint qHash(const std::shared_ptr<LogicalNode> data, uint seed) noexcept
|
||||||
|
{
|
||||||
|
return qHash((void*)data.get(), seed);
|
||||||
|
}
|
||||||
|
|
||||||
NodePresent::NodePresent(BehaviorsPresent* pwidget, QVector<double>& columns_set, std::shared_ptr<LogicalNode> bind)
|
NodePresent::NodePresent(BehaviorsPresent* pwidget, QVector<double>& columns_set, std::shared_ptr<LogicalNode> bind)
|
||||||
: _widget_p(pwidget), _columns_width_seqs(columns_set), _node_bind(bind) {
|
: _widget_p(pwidget), _columns_width_seqs(columns_set), _node_bind(bind) {
|
||||||
|
@ -19,7 +37,6 @@ QRectF NodePresent::contentMeasure() const
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
AcceptType NodePresent::testAccept(const QPointF& local_pos, const QString& kind_str) const
|
AcceptType NodePresent::testAccept(const QPointF& local_pos, const QString& kind_str) const
|
||||||
{
|
{
|
||||||
auto outline = this->boundingRect();
|
auto outline = this->boundingRect();
|
||||||
|
@ -71,8 +88,6 @@ AcceptType NodePresent::testAccept(const QPointF& local_pos, const QString& kind
|
||||||
return AcceptType::NONE;
|
return AcceptType::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QGraphicsSceneDragDropEvent>
|
|
||||||
#include <QMimeData>
|
|
||||||
void NodePresent::dragEnterEvent(QGraphicsSceneDragDropEvent* e)
|
void NodePresent::dragEnterEvent(QGraphicsSceneDragDropEvent* e)
|
||||||
{
|
{
|
||||||
QGraphicsItem::dragEnterEvent(e);
|
QGraphicsItem::dragEnterEvent(e);
|
||||||
|
@ -88,7 +103,6 @@ void NodePresent::dragLeaveEvent(QGraphicsSceneDragDropEvent* event)
|
||||||
this->update();
|
this->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QApplication>
|
|
||||||
void NodePresent::dragMoveEvent(QGraphicsSceneDragDropEvent* e)
|
void NodePresent::dragMoveEvent(QGraphicsSceneDragDropEvent* e)
|
||||||
{
|
{
|
||||||
QGraphicsItem::dragMoveEvent(e);
|
QGraphicsItem::dragMoveEvent(e);
|
||||||
|
@ -147,7 +161,6 @@ void NodePresent::dropEvent(QGraphicsSceneDragDropEvent* e)
|
||||||
this->update();
|
this->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QRectF NodePresent::boundingRect() const
|
QRectF NodePresent::boundingRect() const
|
||||||
{
|
{
|
||||||
auto rect = contentMeasure();
|
auto rect = contentMeasure();
|
||||||
|
@ -162,7 +175,6 @@ QRectF NodePresent::boundingRect() const
|
||||||
return rect + QMargins(0, 0, 30, 30);
|
return rect + QMargins(0, 0, 30, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QStyleOptionGraphicsItem>
|
|
||||||
void NodePresent::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
void NodePresent::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
|
@ -387,16 +399,6 @@ QPointF BehaviorsPresent::nodeRelayout(QHash<std::shared_ptr<LogicalNode>, std::
|
||||||
return origin_offset + QPointF(0, node_outline.height());
|
return origin_offset + QPointF(0, node_outline.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint qHash(const std::shared_ptr<LogicalNode> data, uint seed) noexcept
|
|
||||||
{
|
|
||||||
return qHash((void*)data.get(), seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <QSplitter>
|
|
||||||
#include <QMenuBar>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QFileDialog>
|
|
||||||
|
|
||||||
void BehaviorEditor::open_behavior_map()
|
void BehaviorEditor::open_behavior_map()
|
||||||
{
|
{
|
||||||
auto url = QFileDialog::getOpenFileUrl(this, u8"´ò¿ªÐÐΪÊ÷Îļþ", QUrl(), "*.behw");
|
auto url = QFileDialog::getOpenFileUrl(this, u8"´ò¿ªÐÐΪÊ÷Îļþ", QUrl(), "*.behw");
|
||||||
|
@ -446,7 +448,6 @@ BehaviorEditor::BehaviorEditor(QWidget* parent /*= nullptr*/)
|
||||||
nodeTypesViewInit(_type_model);
|
nodeTypesViewInit(_type_model);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QStandardItem>
|
|
||||||
void BehaviorEditor::nodeTypesViewInit(QStandardItemModel* m)
|
void BehaviorEditor::nodeTypesViewInit(QStandardItemModel* m)
|
||||||
{
|
{
|
||||||
auto types = this->_global_kernal->nodeTypes();
|
auto types = this->_global_kernal->nodeTypes();
|
||||||
|
@ -467,9 +468,6 @@ NodeTypesView::NodeTypesView(QWidget* parent /*= nullptr*/)
|
||||||
this->setSelectionMode(QAbstractItemView::SingleSelection);
|
this->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QVariant>
|
|
||||||
#include <QDrag>
|
|
||||||
#include <QPainter>
|
|
||||||
void NodeTypesView::startDrag(Qt::DropActions supported)
|
void NodeTypesView::startDrag(Qt::DropActions supported)
|
||||||
{
|
{
|
||||||
auto selected = this->selectedIndexes();
|
auto selected = this->selectedIndexes();
|
||||||
|
|
Loading…
Reference in New Issue