nodeview: made an "infinite scroller"

Set scene rect to huge and hid the scrollbars. The node view should be
scrolled with middle click or the hand tool.
This commit is contained in:
itsmattkc
2020-06-16 16:31:16 +10:00
parent 62c23e8ed1
commit e979ce4d7a
+4 -1
View File
@@ -53,7 +53,10 @@ NodeView::NodeView(QWidget *parent) :
SetFlowDirection(NodeViewCommon::kTopToBottom);
scene_.setSceneRect(-100, -100, 200, 200);
// Set massive scene rect and hide the scrollbars to create an "infinite space" effect
scene_.setSceneRect(-1000000, -1000000, 2000000, 2000000);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
NodeView::~NodeView()