Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

qmlls popup when opening project that contains QML files #324

Open
AndreiMiculita opened this issue Apr 15, 2024 · 7 comments
Open

qmlls popup when opening project that contains QML files #324

AndreiMiculita opened this issue Apr 15, 2024 · 7 comments

Comments

@AndreiMiculita
Copy link

AndreiMiculita commented Apr 15, 2024

Describe the Bug
When opening a project that contains QML files (in a certain subfolder) in VS Code I get an error popup detailing the usage of qmlls.

To Reproduce Steps to reproduce the behavior:

  1. Install Qt 6.7.0 using aqtinstall
    pip install -U pip
    pip install aqtinstall
    mkdir ~/Qt && cd ~/Qt
    aqt install-qt windows desktop 6.7.0 win64_msvc2019_64
  2. Install VS Code
  3. Open a project that, in one of its folders, contains QML files.

Screenshots If applicable, add screenshots to help explain your problem.

image

This can be dismissed by pressing "OK" but it's inconvenient. Would be nice to know the cause at least.

Environment (please complete the following information)

  • OS: Microsoft Windows Pro 11
  • Visual Studio Code version: 1.88.1 (user setup)
  • PySide version: 6.6.2
  • Python version: 3.11.9

Extension Configurations None configured, all left default

@AndreiMiculita AndreiMiculita changed the title bug qmlls popup when opening project that contains QML files Apr 17, 2024
@RokeJulianLockhart
Copy link

#324 (comment)

@AndreiMiculita, using https://marketplace.visualstudio.com/_apis/public/gallery/publishers/seanwu/vsextensions/vscode-qt-for-python/7.6.0/vspackage on code-insiders-1.89.0-1713939362.el8.src.rpm on https://download.fedoraproject.org/pub/fedora/linux/releases/40/Spins/x86_64/iso/Fedora-KDE-Live-x86_64-40-1.14.iso, I don't even get that:

Command failed: /usr/bin/python3 /home/RokeJulianLockhart/.vscode-insiders/extensions/seanwu.vscode-qt-for-python-7.6.0/python/scripts/qmlls.py --help

@SaurabhAnsys
Copy link

I am also getting the same issue. it's inconvenient.

@nofkclue
Copy link

Same here! With every start of vscode (or the extensions of it) it pops up...

@2296399626
Copy link

Me too, waiting fo solution

@cozimus
Copy link

cozimus commented Jun 21, 2024

Here having the same issue

@jtc42
Copy link

jtc42 commented Aug 9, 2024

I've been looking into this and it's extremely strange. It looks initially like the stdout from running qmlls is being pushed to an info window, my first guess was by this extension. However I cannot find anything in this extension code that would cause it to launch a modal information popup. It superficially looks a bit like if you were to call showInformationMessage with modal set to true, but there's nothing like that in this code.

This would suggest that it may actually be qmlls itself creating a popup instead of using stdout, but I can't get it to behave that way outside of this extension; it always just outputs to stdout rather than creating a popup window.

This is all just a long way of saying I still don't know if this is a problem with the extension or qmlls itself. If anyone else has any clues then please let me know.

Edit: On further inspection I'm reasonably confident now that the popup we're seeing is actually being created by qmlls.exe, rather than this extension. It seems to only be an issue on Windows though, and it's not totally clear to me yet under what conditions stdout gets pushed as this kind of popup, or more importantly how to stop it.

Workaround: It seems to be that if qmlls is launched without explicitly redirecting stdout and stderr, on Windows it falls back to creating a dialog box to show the output.

A slightly gnarly workaround is to edit your working environment's Lib\site-packages\PySide6\scripts\pyside_tool.py, and change line 60:

returncode = subprocess.call(cmd)

to

returncode = subprocess.call(cmd, stdout=sys.stdout, stderr=sys.stderr)

By explicitly attaching to stdout, the popup is suppressed. For this to be fixed permanently will require a change from Qt. I've raised the issue at https://bugreports.qt.io/browse/PYSIDE-2838

@schlamar
Copy link

If I understand this correctly, the extension is executing qmlls --help to check if qmlls is available. Running an executable to check for existence is in general a bad practice. There are better ways to do this, for example using shutil.which

>>> import shutil
>>> import PySide6 
>>> from pathlib import Path
>>> shutil.which("qmlls", path=Path(PySide6.__file__).parent)
'xxx\\.venv\\lib\\site-packages\\PySide6\\qmlls.EXE'

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

No branches or pull requests

8 participants