Skip to content

davidhsing/qt-antilla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

「 Antilla 」 Modern UI for Qml

Ant Design component library for Qt Qml

English | 中文

🌈 Gallery Preview

✨ Features

  • 📦 A set of high-quality Qml components out of the box.
  • 🎨 Powerful theme customization system.
  • 💻 Based on Qml, completely cross-platform.
  • 🔧 Highly flexible delegate based component customization.

🌐 Online wiki

🗂️ Precompiled package

Precompiled packages and binary libraries for two platforms, Windows / Linux, have been created.

Please visit Release to download.

🔨 How to Build

  • Clone
git clone --recursive https://github.com/davidhsing/qt-antilla.git
  • Update
git submodule update --remote --recursive
  • Build
# Initialize MSVC Build Tools
"C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64

Debug build

cmake -S . -B build/make/Debug -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DBUILD_ANTILLA_DEFAULT_LOCATION=OFF -DINSTALL_ANTILLA_DEFAULT_LOCATION=OFF -DBUILD_ANTILLA_STATIC_LIBS=OFF
cmake --build build/make/Debug --target all --parallel --config Debug
# cmake --install build/make/Debug --prefix build/install/Debug

Release build

cmake -S . -B build/make/Release -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DBUILD_ANTILLA_DEFAULT_LOCATION=OFF -DINSTALL_ANTILLA_DEFAULT_LOCATION=OFF -DBUILD_ANTILLA_STATIC_LIBS=OFF
cmake --build build/make/Release --target all --parallel --config Release
# cmake --install build/make/Release --prefix build/install/Release

Note

  • The BUILD_ANTILLA_DEFAULT_LOCATION, INSTALL_ANTILLA_DEFAULT_LOCATION, BUILD_ANTILLA_STATIC_LIBS param is Antilla's own definition.

Important

By default, BUILD_ANTILLA_DEFAULT_LOCATION=ON:

  • The headers will be built in the [QtDir]/[QtVersion]/[Kit]/include/Antilla directory.
  • The *.dll/*.so will be built in the [QtDir]/[QtVersion]/[Kit]/bin directory.
  • The *.lib will be built in the [QtDir]/[QtVersion]/[Kit]/lib directory.
  • The qmlplugin will be built in the [QtDir]/[QtVersion]/[Kit]/qml/Antilla directory.
  • The qml directory will be built in the [QtDir]/[QtVersion]/[Kit]/qml/Antilla.
  • The AntillaBasic[d].dll will be installed to [QtDir]/[QtVersion]/[Kit]/bin.
  • Install
cmake --install --prefix <install_dir>

The installation directory structure

──<install_dir>
    ├─include
    │   *.h
    ├─bin
    │   *.dll
    ├─lib
    │   *.lib/so
    └─imports
        └─Antilla/Basic
  • Usage
    • Link the <install_dir>/lib.
    • Include the <install_dir>/include.
    • Copy the <install_dir>/bin/AntillaBasic.[dll/so] to [QtDir]/[QtVersion]/[Kit]/bin.
    • Copy the <install_dir>/imports/Antilla to [QtDir]/[QtVersion]/[Kit]/qml.

📦 Get started

  • Create QtQuick application QtVersion >= 6.7
  • Add the following cmake command to your project CMakeLists.txt
 target_include_directories(<your_target> PRIVATE Antilla/include)
 target_link_directories(<your_target> PRIVATE Antilla/lib)
 target_link_libraries(<your_target> PRIVATE AntillaBasic)
  • Add the following code to your main.cpp
 #include "antpp.h"

 int main(int argc, char *argv[])
 {
     ...
     /*! Set OpenGL, optional */
     QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
     QQuickWindow::setDefaultAlphaBuffer(true);
     ...
     QGuiApplication app(argc, argv);
     QQmlApplicationEngine engine;
     AntApp::initialize(&engine);
     ...
 }
  • Add the following code to your .qml
 import Antilla.Basic
 AntWindow { 
   ...
 }

Alright, you can now enjoy using Antilla.

🚩 Reference

💓 LICENSE

Use MIT LICENSE

🌇 Environment

Windows 11 / Ubuntu 24.04.2, Qt Version >= 6.7

🎉 Star History

Star History Chart

About

Ant Design for QT QML

Resources

License

Stars

Watchers

Forks

Contributors