Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 1.49 KB

README.md

File metadata and controls

56 lines (36 loc) · 1.49 KB

Glean.js - C++ Qt/QML app sample

This sample contains a Qt/QML app that will initialize Glean.js when opened.

The app will display a button that when clicked should trigger Glean.js events.

Requirement

How to run this sample

  1. Build Glean.js for Qt. Inside the glean/ folder, run:
npm run build:qt
  1. Within this sample directory, copy the Glean.js library:
cp -r ../../glean/dist/qt/org/ src/App/org/
  1. Install glean_parser, we suggest doing this inside a virtual environment:
python3 -m venv .venv # Create a virtualenv
source .venv/bin/activate # Activate it
pip3 install -r requirements.txt # Install glean_parser
  1. Generate metrics and pings files:

Note: The version number below should match the last released version number (minus the trailing .0). If the version numbers are different you will run into issues with QML code compilation. To resolve these errors you have to adjust the versions manually in the QML files

glean_parser translate src/App/metrics.yaml src/App/pings.yaml -f javascript -o src/App/generated \
--option platform=qt --option version="1.1"
  1. Build the app:
qmake -r # Configure both the app and the tests
make # Build moth the app and the tests

Note: How to run the app will depend on the platform targeted during build.

  1. (EXTRA) Run tests:
make check