| 1159 | |
| 1160 | |
| 1161 | void MainWindow::refreshNodesLayout(QtNodes::PortLayout new_layout) |
| 1162 | { |
| 1163 | if( new_layout != _current_layout) |
| 1164 | { |
| 1165 | QString icon_name = ( new_layout == QtNodes::PortLayout::Horizontal ) ? |
| 1166 | ":/icons/BT-horizontal.png" : |
| 1167 | ":/icons/BT-vertical.png"; |
| 1168 | QIcon icon; |
| 1169 | icon.addFile(icon_name, QSize(), QIcon::Normal, QIcon::Off); |
| 1170 | ui->toolButtonLayout->setIcon(icon); |
| 1171 | ui->toolButtonLayout->update(); |
| 1172 | } |
| 1173 | |
| 1174 | bool refreshed = false; |
| 1175 | { |
| 1176 | const QSignalBlocker blocker( currentTabInfo() ); |
| 1177 | for(auto& tab: _tab_info) |
| 1178 | { |
| 1179 | auto scene = tab.second->scene(); |
| 1180 | if( scene->layout() != new_layout ) |
| 1181 | { |
| 1182 | auto abstract_tree = BuildTreeFromScene( scene ); |
| 1183 | scene->setLayout( new_layout ); |
| 1184 | NodeReorder( *scene, abstract_tree ); |
| 1185 | refreshed = true; |
| 1186 | } |
| 1187 | } |
| 1188 | on_toolButtonCenterView_pressed(); |
| 1189 | } |
| 1190 | _current_layout = new_layout; |
| 1191 | if(refreshed) |
| 1192 | { |
| 1193 | onPushUndo(); |
| 1194 | } |
| 1195 | } |
| 1196 | |
| 1197 | void MainWindow::refreshExpandedSubtrees() |
| 1198 | { |
nothing calls this directly
no test coverage detected