QR code creator and scanner for desktop and wasm
-
Hello everyone,
I want to point your attention to a Qt QrCode library I have put together.
https://github.com/EddyTheCo/Esterv.Utils.QrCodeThis library in principle should work for major desktop platforms and wasm.
The most interesting thing(at least for me) is the decoder that also works for wasm. It uses OpenCV.
You can see an example of the use in https://eddytheco.github.io/DLockersClient/
I will try to create more documentation on how to use it in the future.
-
Creating a QR code creator and scanner for desktop and WebAssembly (Wasm) involves using programming languages and libraries that support both environments. Below, I'll provide a basic example using HTML, JavaScript, and a popular library called jsQR for QR code scanning. For QR code creation, we can use the qrcode-generator library.
-
@Mesrine said in QR code creator and scanner for desktop and wasm:
I am a real newbee and am stuck. I used github to obtain https://github.com/EddyTheCo/Esterv.Utils.QrCode. It put the files on my computer just fine. But I don't know how to build the library. Using git bash, I tried just "cmake ." and it tried to find VS 22. I have VS 19 installed. How can I tell cmake to use VS 19?
Further, after I have built the library, how do I tell my Qt project where it is?
Thanks for you help.
-
@Dougf9 said in QR code creator and scanner for desktop and wasm:
How can I tell cmake to use VS 19?
By openning the preconfigured VS19 command line (in your Windows menu).
"Further, after I have built the library, how do I tell my Qt project where it is?" - do you use qmake or cmake?
-
@Dougf9 said in QR code creator and scanner for desktop and wasm:
what is a preconfigured VS19 command line?
The terminal (cmd.exe) Visual Studio provides.
"I tried both CLI's for VS19" - what do you mean by that? If you use preconfigured terminal from Visual Studio it should find the compiler. How did you call cmake?
-
@Dougf9 Thanks for your interest. The last time I checked the library compiled for Windows in the GitHub runners.
1- If you want to compile the library after you download the source code from github, go inside the project root folder and do
cmake --workflow --preset default-develop
.
Or use a IDE with CMake Presets support.2- You can also download the releases for Windows here.
how do I tell my Qt project where it is
->
To consume the project target as explained here
Add this to your CMake/Qt project
include(FetchContent) FetchContent_Declare( EstervQrCode GIT_REPOSITORY https://github.com/EddyTheCo/Esterv.Utils.QrCode.git GIT_TAG v2.0.0 FIND_PACKAGE_ARGS 2.0 COMPONENTS QrDec QrGen QtQrDec QtQrGen CONFIG ) FetchContent_MakeAvailable(EstervQrCode) target_link_libraries(YOUR_PROJECT_TARGET PRIVATE Esterv::QrGen Esterv::QtQrGen Esterv::QrDec Esterv::QtQrDec)
This will try to find the library on your system using
find_package
. If it is not found, it will download the source from Git Hub and compile the library when you build your project. So you do not need to manually download the library or compile it.
The library can be found byfind_package
in the build directory from step 1 or from the place you installed the releases in step 2.Then you can use the QML types or the C++ API that in somehow is explained here
I appreciate any feedback from Windows developers.