QtWidgets.qApp is appication instance, to obtain application instance in pyqt6 you can call QtWidgets.QApplication.instance() method, but it's not necessary since all instance methods exposed in QtWidgets.QApplication as static methods (QtWidgets.QApplication implements singleton pattern), so to quit you can call QtWidgets.QApplication.quit() which does the same as QtWidgets.QApplication.instance().quit() does.
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyqt6-sip
Failed to build pyqt6-sip
ERROR: Could not build wheels for pyqt6-sip, which is required to install pyproject.toml-based projects
It works fine here, but there are two differences, I use regular python, not vscode, and I use the repo package for pyqt6 not one from the AUR. Why are you using an AUR build of pyqt6? When did you last rebuild it? Do you get completion options if you run the same code in the python interpreter from a terminal?
PyQt6 and qtpy is needed for the refnx GUI. The pyqt6 and qtpy packagesare currently available from PyPI and can be installed aspip install pyqt6 qtpy. However, pyqt6 is not currently available viaconda-forge. You can use conda to install most of the refnx dependencies, butyou will need to use pip to install pyqt6.
df19127ead