Show error message to user using QMessageBox.
(self, message: str)
| 176 | |
| 177 | |
| 178 | def _show_error(self, message: str): |
| 179 | """Show error message to user using QMessageBox.""" |
| 180 | try: |
| 181 | from PySide6.QtWidgets import QMessageBox |
| 182 | |
| 183 | # Try to get the main window as parent |
| 184 | parent = None |
| 185 | if hasattr(self.node_graph, 'views') and self.node_graph.views(): |
| 186 | parent = self.node_graph.views()[0].window() |
| 187 | |
| 188 | msg = QMessageBox(parent) |
| 189 | msg.setWindowTitle("Group Creation Error") |
| 190 | msg.setText(message) |
| 191 | msg.setIcon(QMessageBox.Critical) |
| 192 | msg.exec() |
| 193 | except Exception: |
| 194 | # Fallback to print if QMessageBox fails |
| 195 | print(f"Error: {message}") |
| 196 | |
| 197 | def get_memory_usage(self) -> int: |
| 198 | """Estimate memory usage of this command.""" |