Basic Usage of ElaWidgetTools in Qt
Introduce basic usage of ElaWidgetTools.
ElaWidgetTools introduction
A FluentUI-style component library based on Qt Widgets. It also provides common integration features beyond just components. The main branch supports all Qt 5.12+ versions (Qt 5.15+ on Linux). Recommended versions are Qt 6.4.3 and Qt 6.6.2.
Use in your project
Build the DLL
Clone it and open with Qt Creator. The project is CMake, so open CMakeLists.txt.

Choose a Qt version that matches your project and build in Release mode.
You will get elawidgettools.dll and elawidgettools.lib in the root directory.
Add to your project
Create lib and include folders in your project.

Put elawidgettools.dll and elawidgettools.lib into lib.
Copy files from ElaWidgetTools-main\src\include into include.
Now open your project’s CMakeLists.
First include the include folder:
1 | |
Then add the qrc file in add_executable:
1 | |
Finally, link the library in target_link_libraries:
1 | |
Done. A complete CMakeLists example (for reference only):
1 | |
You can modify main.cpp like this to test:
1 | |
If everything is fine, you should see this window:

Use in your project
Window changes
In your .h file, after adding headers, change:
1 | |
to:
1 | |
Pick ElaWidget or ElaWindow depending on your needs.
Also update your .cpp to use Ela:
1 | |
Then initialize in main.cpp:
1 | |
Using controls
Besides creating controls in .cpp, some controls (with inheritance) can be “Promoted” in the UI designer. That said, it is not recommended.
