@@ -36,6 +36,7 @@ DataFlowGraphicsScene(DataFlowGraphModel& graphModel,
3636 QObject* parent)
3737 : BasicGraphicsScene(graphModel, parent)
3838 , _graphModel(graphModel)
39+ , _sortFlag(true )
3940{
4041 connect (&_graphModel, &DataFlowGraphModel::inPortDataWasSet,
4142 [this ](NodeId const nodeId, PortType const , PortIndex const )
@@ -120,9 +121,11 @@ createSceneMenu(QPointF const scenePos)
120121 childItem->setText (0 , assoc.first );
121122 }
122123
123- treeView->sortByColumn (0 , Qt::AscendingOrder);
124124 treeView->expandAll ();
125125
126+ if (_sortFlag)
127+ treeView->sortByColumn (0 , Qt::AscendingOrder);
128+
126129 connect (treeView, &QTreeWidget::itemClicked,
127130 [this ,
128131 modelMenu,
@@ -148,6 +151,10 @@ createSceneMenu(QPointF const scenePos)
148151 auto modelName = (*it)->text (0 );
149152 const bool match = (modelName.contains (text, Qt::CaseInsensitive));
150153 (*it)->setHidden (!match);
154+ // if (match)
155+ // {
156+ // treeView->scrollToItem(*it);
157+ // }
151158
152159 ++it;
153160 }
@@ -162,6 +169,13 @@ createSceneMenu(QPointF const scenePos)
162169 return modelMenu;
163170}
164171
172+ void
173+ DataFlowGraphicsScene::
174+ sortSceneMenu (bool sort)
175+ {
176+ _sortFlag = sort;
177+ }
178+
165179
166180void
167181DataFlowGraphicsScene::
0 commit comments