ui: optimized widget signals for selecting clips/nodes

Decent performance optimization when working with the UI.
This commit is contained in:
itsmattkc
2020-08-01 02:12:20 +10:00
parent fb05594b50
commit 2afa5a42c7
25 changed files with 491 additions and 351 deletions
+2 -61
View File
@@ -29,7 +29,8 @@ NodePanel::NodePanel(QWidget *parent) :
node_view_ = new NodeView(this);
// Connect node view signals to this panel
connect(node_view_, SIGNAL(SelectionChanged(QList<Node*>)), this, SIGNAL(SelectionChanged(QList<Node*>)));
connect(node_view_, &NodeView::NodesSelected, this, &NodePanel::NodesSelected);
connect(node_view_, &NodeView::NodesDeselected, this, &NodePanel::NodesDeselected);
// Set it as the main widget of this panel
SetWidgetWithPadding(node_view_);
@@ -38,64 +39,4 @@ NodePanel::NodePanel(QWidget *parent) :
Retranslate();
}
void NodePanel::SetGraph(NodeGraph *graph)
{
node_view_->SetGraph(graph);
}
void NodePanel::SelectAll()
{
node_view_->SelectAll();
}
void NodePanel::DeselectAll()
{
node_view_->DeselectAll();
}
void NodePanel::DeleteSelected()
{
node_view_->DeleteSelected();
}
void NodePanel::CutSelected()
{
node_view_->CopySelected(true);
}
void NodePanel::CopySelected()
{
node_view_->CopySelected(false);
}
void NodePanel::Paste()
{
node_view_->Paste();
}
void NodePanel::Duplicate()
{
node_view_->Duplicate();
}
void NodePanel::Select(const QList<Node *> &nodes)
{
node_view_->Select(nodes);
}
void NodePanel::SelectWithDependencies(const QList<Node *> &nodes)
{
node_view_->SelectWithDependencies(nodes);
}
void NodePanel::SelectBlocks(const QList<Block *> &nodes)
{
node_view_->SelectBlocks(nodes);
}
void NodePanel::Retranslate()
{
SetTitle(tr("Node Editor"));
}
OLIVE_NAMESPACE_EXIT
+59 -16
View File
@@ -35,34 +35,77 @@ class NodePanel : public PanelWidget
public:
NodePanel(QWidget* parent);
void SetGraph(NodeGraph* graph);
void SetGraph(NodeGraph *graph)
{
node_view_->SetGraph(graph);
}
virtual void SelectAll() override;
virtual void DeselectAll() override;
virtual void SelectAll() override
{
node_view_->SelectAll();
}
virtual void DeleteSelected() override;
virtual void DeselectAll() override
{
node_view_->DeselectAll();
}
virtual void CutSelected() override;
virtual void CopySelected() override;
virtual void DeleteSelected() override
{
node_view_->DeleteSelected();
}
virtual void Paste() override;
virtual void CutSelected() override
{
node_view_->CopySelected(true);
}
virtual void Duplicate() override;
virtual void CopySelected() override
{
node_view_->CopySelected(false);
}
virtual void Paste() override
{
node_view_->Paste();
}
virtual void Duplicate() override
{
node_view_->Duplicate();
}
public slots:
void Select(const QList<Node*>& nodes);
void SelectWithDependencies(const QList<Node*>& nodes);
void Select(const QList<Node*>& nodes)
{
node_view_->Select(nodes);
}
void SelectBlocks(const QList<Block*>& nodes);
void SelectWithDependencies(const QList<Node*>& nodes)
{
node_view_->SelectWithDependencies(nodes);
}
void SelectBlocks(const QList<Block*>& nodes)
{
node_view_->SelectBlocks(nodes);
}
void DeselectBlocks(const QList<Block*>& nodes)
{
node_view_->DeselectBlocks(nodes);
}
signals:
/**
* @brief Wrapper for NodeView::SelectionChanged()
*/
void SelectionChanged(QList<Node*> selected_nodes);
void NodesSelected(const QList<Node*>& nodes);
void NodesDeselected(const QList<Node*>& nodes);
private:
virtual void Retranslate() override;
virtual void Retranslate() override
{
SetTitle(tr("Node Editor"));
}
NodeView* node_view_;