Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with built-in QScintilla editor on Ubuntu 24.04 (PyQt6 related) #1721

Open
willend opened this issue Oct 2, 2024 · 1 comment
Open

Comments

@willend
Copy link
Contributor

willend commented Oct 2, 2024

On Ubuntu 24.04.1, the m[c/x]gui built-in editor fails due to missing scintilla dependencies and missing Qt6-transition code.

At e.g. File->New one yields

mcgui 
loading system configuration
Traceback (most recent call last):
  File "/usr/share/mcstas/tools/Python/mcgui/mcgui.py", line 896, in handleNewInstrument
    self.view.showCodeEditorWindow(new_instr)
  File "/usr/share/mcstas/tools/Python/mcgui/viewclasses.py", line 63, in showCodeEditorWindow
    self.ew.initCodeEditor(instr)
  File "/usr/share/mcstas/tools/Python/mcgui/viewclasses.py", line 427, in initCodeEditor
    self.__scintilla.setText(open(instr, encoding='utf-8', errors='ignore').read())
    ^^^^^^^^^^^^^^^^
AttributeError: 'McCodeEditorWindow' object has no attribute '_McCodeEditorWindow__scintilla'. Did you mean: '_McCodeEditorWindow__initScintilla'?

Best workaround for now:

  • sudo apt install gedit
  • Let the editor crash as above, after which "Edit" means gedit
  • Use the html form in the component mcdoc pages "Generate" to define component instances
    (You may have to replace \n manually by a line-break after pasting to gedit...)

If you prefer to use another editor than gedit, then please:

  • install said editor
  • mcrun --write-user-config to generate a local user config
  • edit that mccode_config.json and replace gedit by wanted editor
@willend
Copy link
Contributor Author

willend commented Oct 2, 2024

  • or use conda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant