ui: optimized widget signals for selecting clips/nodes
Decent performance optimization when working with the UI.
This commit is contained in:
@@ -61,18 +61,19 @@ public:
|
||||
void Select(const QList<Node*>& nodes);
|
||||
void SelectWithDependencies(QList<Node *> nodes);
|
||||
|
||||
void SelectBlocks(const QList<Block*>& blocks);
|
||||
|
||||
void CopySelected(bool cut);
|
||||
void Paste();
|
||||
|
||||
void Duplicate();
|
||||
|
||||
void SelectBlocks(const QList<Block*>& blocks);
|
||||
|
||||
void DeselectBlocks(const QList<Block*>& blocks);
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when the selected nodes have changed
|
||||
*/
|
||||
void SelectionChanged(QList<Node*> selected_nodes);
|
||||
void NodesSelected(const QList<Node*>& nodes);
|
||||
|
||||
void NodesDeselected(const QList<Node*>& nodes);
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||
@@ -83,6 +84,8 @@ protected:
|
||||
|
||||
virtual void wheelEvent(QWheelEvent* event) override;
|
||||
|
||||
//virtual void scrollContentsBy(int dx, int dy) override;
|
||||
|
||||
private:
|
||||
void PlaceNode(NodeViewItem* n, const QPointF& pos);
|
||||
|
||||
@@ -97,7 +100,6 @@ private:
|
||||
void MoveAttachedNodesToCursor(const QPoint &p);
|
||||
|
||||
void ConnectSelectionChangedSignal();
|
||||
void ReconnectSelectionChangedSignal();
|
||||
void DisconnectSelectionChangedSignal();
|
||||
|
||||
void UpdateBlockFilter();
|
||||
@@ -105,6 +107,8 @@ private:
|
||||
void AssociateNodeWithSelectedBlocks(Node* n);
|
||||
void DisassociateNode(Node* n, bool remove_from_map);
|
||||
|
||||
void SelectBlocksInternal();
|
||||
|
||||
NodeGraph* graph_;
|
||||
|
||||
struct AttachedItem {
|
||||
@@ -119,6 +123,8 @@ private:
|
||||
|
||||
NodeViewScene scene_;
|
||||
|
||||
QList<Node*> selected_nodes_;
|
||||
|
||||
QList<Block*> selected_blocks_;
|
||||
|
||||
QHash<Node*, QList<Block*> > association_map_;
|
||||
|
||||
Reference in New Issue
Block a user