Qt VS Code Extensions Manual Tests: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 235: Line 235:
- In VS code run Check for QML language server update
- In VS code run Check for QML language server update


- ...
- If a new version is available a pop up window offers to download the latest version
 
- If the current version is up to date, a pop up window says so and gives the tag


- Run Qt: Download the most recent QML language server
- Run Qt: Download the most recent QML language server
 
|
- ...
|
 
|+
|
- Does so, even if the most recent version is already installed
|
| discuss this behaviour
|+
|
- Run Qt: Restart QML language server
- Run Qt: Restart QML language server
|
|
| to do
| nothing visible happening
|+
|+
!Qt: Open Qt Settings
!Qt: Open Qt Settings
Line 250: Line 258:
|+
|+
|
|
- In VS code run Qt: Open Qt Settings
- The Settings should open in VS code, with the possibility to switch form User to Workspace
- It should be possible to see the settings related to a given extension using the Extensions menu showing under User or Workspace
- The following settings should be visible:
- Qt-cpp: Do Not Ask For CMake Path (User)
- Qt-core: Additional Qt Paths (User and Workspace)
- Qt-core: Do Not Ask For Default Qt Installation Root (User)
- Qt-core: Do Not Ask For VCPKG (User)
- Qt-core: Open Online Documentation In External Browser (User and Workspace)
- Qt-core: Qt Installation Root (User and Workspace)
- Qt-qml: Do Not Ask For Qmlls Download (User)
- Qt-qml › Qmlls: Additional Import Paths (User and Workspace)
- Qt-qml › Qmlls: Custom Exe Path (User and Workspace)
- Qt-qml › Qmlls: Enabled (User and Workspace)
- Qt-qml › Qmlls: Trace Lsp (User and Workspace)
- Qt-qml › Qmlls: Use Qml Import Path Env Var (User and Workspace)
- Qt-qml › Qmlls: Verbose Output (User and Workspace)
- Qt-ui: Custom Widgets Designer Exe Path (User and Workspace)
|
|
| to do
|  
|+
|+
!Qt: Reset Qt Tools Extension State (For troubleshooting)
!Qt: Reset Qt Tools Extension State (For troubleshooting)

Revision as of 14:18, 26 March 2025


Pre-requisit Result Annotation
Have VS code installed (https://code.visualstudio.com/docs/setup/setup-overview)
Have a Qt installation (https://account.qt.io/s/downloads)
Remove any Qt related setting in VS Code User settings.json (Preferences: Open User Settings (JSON))
Testing Result Annotation
Qt VS code extension packages

- In VS code, go to Extensions

- Type "Qt Pack" in the Search Extensions in Marketplace

- The result should show at the top:

- Qt Extension Pack, with 4 extensions
- Qt C++ Extension Pack, with 7 extensions
- Qt WebAssembly Extension Pack, with 9 entensions

- Select Qt Extension Pack, check that the extensions are

 Qt Core, Qt C++, Qt Qml, Qt UI

- Select Qt C++ Extension Pack, check that the extensions are

 Qt Core, Qt C++, Qt Qml, Qt UI, 
 CMake Tools (from microsoft), C/C++ (from microsoft)

- Select Qt WebAssembly Extension Pack, check that the extensions are

 Qt Core, Qt C++, Qt Qml, Qt UI,
 CMake Tools (from microsoft), C/C++ (from microsoft)
 CMake, Live Preview, Qt WebAssembly Extension Pack (from microsoft)
Installation of the Qt VS-code Extentions

- In VS code, go to Extensions

- Search for Qt Pack

- Select Qt WebAssembly Extension Pack

- Click install

- Select each Qt extension and make sure the latest version is displayed (1.2.1)

Finding Qt Installation

- In VS code command palette -(shift+command+P) on MacOS or (shift+ctrl+P) on Windows/Linux- search for Qt register

- Two option should appear:

 - Qt: Register Qt Installation
 - Qt: Register Qt Installation (by qtpaths or qmake)

- Try both commands

- Run Preferences: Open User Settings (JSON)

- Check that the path to the selected Qt installation has been added under qt-core.qtInstallationRoot

modify when following suggestions have been implemented

https://bugreports.qt.io/browse/VSCODEEXT-156

https://bugreports.qt.io/browse/VSCODEEXT-157

https://bugreports.qt.io/browse/VSCODEEXT-158

Opening, building, running a Qt project

- Get the projet from https://code.qt.io/cgit/qt-labs/vscodeext.git/tree/doc/tutorials/AddressBook

- Open the AddressBook folder in VS code

- From command palette run Qt: Set the recommended Qt Extensions settings

- A .vscode folder should be created with a settings.json file

- A "No active kit" button should appear in the bottom status bar

- Click on adddialog.ui, a button with "Open this file with Qt Widgets Designer" should appear.

- Click on "Open this file with Qt Widgets Designer" a pop up window should appear asking to select a CMake kit

- Click on "Select CMake Kit" and select a Qt- kit

- The selected kit should now show in place of the "No active kit"

- Click again on "Open this file with Qt Widgets Designer", adddialog.ui should now open in Qt Widgets Designer

- In VS code, select addressbook.ui, click on "Open this file with Qt Widgets Designer", it should open

- Build the AddressBook

- Execute it

Debugging the AddressBook Qt Project

- Following: opening, building and running the AddressBook project

- Make sure a Qt Kit is selected

- Remove .vscode/launch.json if present

- Click on the debugger icon

- Click on "create a launch.json file"

- Select C++ (GDB/LLDB) in the selection window popping up

- In the launch.json file click on "Add Configuration" if the option are not already open

- Select a Qt configuration

- Go to addressbook.cpp and place a breaking point at line 29 (item->setData(Qt::UserRole, email);)

- Start the debugger

- In the AddressBook window click on the "Add" button

- Enter a Name and an Email then click "OK"

- In VS code check that the name and email variable have the entered values

- Finish debugging and close the AddressBook window

Qt: Scan for Qt Kits

- In VS code, open CMake: Edit User-Local CMake Kits

- Remove all the Qt related kits

- Run Qt: Scan for Qt Kits

- Make sure the Qt kits reappeared in the cmake-tools-kits.json

- Make sure the generated kits are compatible with the registered Qt version

- Make sure the generated kits are compatible with the machine OS

Qt: Open Widget Designer

- Run the command in the palette

- One possibility appears corresponding to the selected kit

discuss this behaviour

- In case of "No active kit", the previously available Qt Widget designer version still appears

discuss this behaviour
Qt: Documentation commands

- In VS code run Qt: Documentation: Open Homepage

- A browser to https://doc.qt.io should now be open in VS code

- Run Qt: Documentation: Search

- In the dialog box type Qt related key words and check that the related documentation page opens

could be more specific here

- Go to adddialog.cpp and click on QWidget - Run Qt: Documentation: Search for current word - Page https://doc.qt.io/qt-6/qwidget.html should now be open in the browser

QML language server related commands

- In VS code run Check for QML language server update

- If a new version is available a pop up window offers to download the latest version

- If the current version is up to date, a pop up window says so and gives the tag

- Run Qt: Download the most recent QML language server

- Does so, even if the most recent version is already installed

discuss this behaviour

- Run Qt: Restart QML language server

nothing visible happening
Qt: Open Qt Settings

- In VS code run Qt: Open Qt Settings

- The Settings should open in VS code, with the possibility to switch form User to Workspace

- It should be possible to see the settings related to a given extension using the Extensions menu showing under User or Workspace

- The following settings should be visible:

- Qt-cpp: Do Not Ask For CMake Path (User)
- Qt-core: Additional Qt Paths (User and Workspace)
- Qt-core: Do Not Ask For Default Qt Installation Root (User)
- Qt-core: Do Not Ask For VCPKG (User)
- Qt-core: Open Online Documentation In External Browser (User and Workspace)
- Qt-core: Qt Installation Root (User and Workspace)
- Qt-qml: Do Not Ask For Qmlls Download (User)
- Qt-qml › Qmlls: Additional Import Paths (User and Workspace)
- Qt-qml › Qmlls: Custom Exe Path (User and Workspace)
- Qt-qml › Qmlls: Enabled (User and Workspace)
- Qt-qml › Qmlls: Trace Lsp (User and Workspace)
- Qt-qml › Qmlls: Use Qml Import Path Env Var (User and Workspace)
- Qt-qml › Qmlls: Verbose Output (User and Workspace)
- Qt-ui: Custom Widgets Designer Exe Path (User and Workspace)
Qt: Reset Qt Tools Extension State (For troubleshooting)
to do