https://github.com/danieloneill/qmlfontselector
A font selector written in QML and C++ (Component) for Qt6
https://github.com/danieloneill/qmlfontselector
Last synced: 5 months ago
JSON representation
A font selector written in QML and C++ (Component) for Qt6
- Host: GitHub
- URL: https://github.com/danieloneill/qmlfontselector
- Owner: danieloneill
- License: gpl-3.0
- Created: 2022-09-19T22:01:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-19T23:10:32.000Z (almost 4 years ago)
- Last Synced: 2025-04-06T04:17:49.843Z (over 1 year ago)
- Language: QML
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QmlFontSelector
A font selector written in QML and C++ (Component) for Qt6
## Building
The component itself should be built from a shadow directory.
```
~/code/QmlFontSelector$ mkdir build
~/code/QmlFontSelector$ cd build
~/code/QmlFontSelector/build$ qmake ..
Info: creating stash file /home/user/code/QmlFontSelector/build/.qmake.stash
~/code/QmlFontSelector/build$ make -j4
....
~/code/QmlFontSelector/build$ sudo make install
```
## Trying
Once the component is installed, you can actually see the control itself by just loading it in the `qml` utility:
```
~/code/QmlFontSelector$ qml qml/FontSelector.qml
```
The result should look something like:

## Embedding
The `FontSelector.qml` file in the qml directory is the actual control, and can be included from anywhere within (or without) your Qt Quick project as long as the component is installed.
It may be desired to compile the component into your C++/Qt Quick project, and it can be done by completing the following steps:
* Add `fontselector.cpp` to your SOURCES
* Add `fontselector.h` to your HEADERS
* #include "fontselector.h" where your QQmlApplicationEngine is instantiated
* Register the component with something akin to: `qmlRegisterType("com.canapos.FontFunctions", 1, 0, "FontFunctions");`
Now the FontSelector control should be able to instantiate and be used in your own code.