Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7e48312
Initial plan
Copilot Sep 17, 2025
6b9ee6b
Initial analysis of QtQMLModel repository
Copilot Sep 17, 2025
60fbab9
Add comprehensive development infrastructure
Copilot Sep 17, 2025
93e3f33
Complete development infrastructure setup with documentation and cleanup
Copilot Sep 17, 2025
827554e
Update documentation to emphasize CMake as primary build system
Copilot Sep 17, 2025
68e30b9
Update CI/CD pipeline to use Qt 6.8 and qtquick module
Copilot Sep 17, 2025
288672e
Change Qt modules from 'qtquick' to 'qtqml'
CMGeorge Sep 17, 2025
70a1a44
Remove qtqml module specification from CI workflow
Copilot Sep 17, 2025
4d72e0c
Add Qt modules to CI configuration
CMGeorge Sep 17, 2025
9f40522
Remove Qt modules from CI workflow
CMGeorge Sep 17, 2025
041cb9a
Update deprecated GitHub Actions to current versions
Copilot Sep 17, 2025
8a31144
Update Qt version from 6.8.0 to 6.7.2 for install-qt-action compatibi…
Copilot Sep 17, 2025
7a0364e
Replace Q_SLOTS with slots to fix cppcheck warnings
Copilot Sep 17, 2025
1455ddf
Fix clang-format violations in Qt Super Macros headers
Copilot Sep 17, 2025
f318803
Configure cppcheck for Qt code analysis with comprehensive Qt macro s…
Copilot Sep 17, 2025
48f3d32
Fix cppcheck command line syntax for Qt macro definitions
Copilot Sep 17, 2025
aecd9bd
ci: make Cppcheck Qt-aware; add runner script; fix/suppress findings …
CMGeorge Sep 17, 2025
8d3c187
style: clang-format headers and tests to satisfy CI formatting check
CMGeorge Sep 17, 2025
8b7edbb
ci(cppcheck): exclude Qt AUTOGEN/moc/qrc generated files; mirror excl…
CMGeorge Sep 17, 2025
aec1edc
ci(cppcheck): suppress Qt AUTOGEN/moc diagnostics to avoid preprocess…
CMGeorge Sep 17, 2025
bac26c8
ci(cppcheck): remove redundant suppressions to avoid unmatchedSuppres…
CMGeorge Sep 17, 2025
7da1180
ci(cppcheck): define Q_MOC_INCLUDE to silence moc preprocessor error …
CMGeorge Sep 17, 2025
fd58d49
ci(cppcheck): explicitly exclude test autogen moc headers causing pre…
CMGeorge Sep 17, 2025
2851601
ci(cppcheck): simplify to use script-only approach without building -…
CMGeorge Sep 17, 2025
83e5808
Fix Qt model bugs and add comprehensive features
CMGeorge Sep 17, 2025
7c7115e
Add comprehensive git hooks for automated quality control
CMGeorge Sep 17, 2025
3f86cd1
Add git hooks documentation to README
CMGeorge Sep 17, 2025
6db4dd3
Fix Windows DLL export/import for Qt MOC symbols
CMGeorge Sep 17, 2025
9e7af57
Fix Windows DLL template linking with explicit instantiation
CMGeorge Sep 17, 2025
3045313
Add iOS and Android builds, exclude Windows temporarily
CMGeorge Sep 17, 2025
d39df14
Fix mobile build configuration for iOS and Android
CMGeorge Sep 17, 2025
bd36bad
fix: configure mobile builds with proper Qt host path and CMake settings
CMGeorge Sep 17, 2025
f063859
Fix desktop Qt architecture for 6.7.2
CMGeorge Sep 17, 2025
349f275
Add debug output for Qt installation paths
CMGeorge Sep 17, 2025
88795e5
Fix Qt6_DIR for Android builds - use Android Qt instead of Desktop Qt
CMGeorge Sep 17, 2025
c57e81c
Fix CI: Remove duplicate Qt installations, upgrade to install-qt-acti…
CMGeorge Sep 17, 2025
4615226
fix: Use conditional Qt Desktop architecture for cross-platform mobil…
CMGeorge Sep 17, 2025
46f0264
Fix iOS QT_HOST_PATH to use correct macos architecture path
CMGeorge Sep 17, 2025
b2508de
Fix QT_HOST_PATH to use correct Linux architecture path gcc_64
CMGeorge Sep 17, 2025
777bd19
Fix iOS build by using static library for iOS platform
CMGeorge Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 100
BreakBeforeBraces: Attach
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: true
AlignTrailingComments: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
33 changes: 33 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Checks: >
clang-diagnostic-*,
clang-analyzer-*,
-clang-analyzer-alpha*,
bugprone-*,
cppcoreguidelines-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-static-cast-downcast,
-modernize-use-trailing-return-type,
-readability-magic-numbers,
-readability-named-parameter,
-bugprone-macro-parentheses

WarningsAsErrors: false

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.VariableCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberPrefix
value: m_
- key: readability-identifier-naming.ProtectedMemberPrefix
value: m_
- key: readability-identifier-naming.MacroCase
value: UPPER_CASE
214 changes: 214 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
name: CI

on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
qt-version: [6.7.2]
build-type: [Release, Debug]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ../Qt
key: ${{ runner.os }}-Qt-${{ matrix.qt-version }}

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
cache: true

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}

- name: Build
run: cmake --build build --config ${{ matrix.build-type }}

- name: Test
working-directory: build
run: ctest --output-on-failure --build-config ${{ matrix.build-type }}

build-mobile:
strategy:
matrix:
include:
- platform: ios
os: macos-latest
qt-target: ios
qt-arch: ''
cmake-args: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0
- platform: android-arm64
os: ubuntu-latest
qt-target: android
qt-arch: android_arm64_v8a
cmake-args: -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-24
- platform: android-x86_64
os: ubuntu-latest
qt-target: android
qt-arch: android_x86_64
cmake-args: -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DANDROID_PLATFORM=android-24

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Setup Android NDK (Android only)
if: startsWith(matrix.platform, 'android')
uses: nttld/setup-ndk@v1
with:
ndk-version: r25c

- name: Cache Qt
id: cache-qt
uses: actions/cache@v4
with:
path: ../Qt
key: ${{ runner.os }}-Qt-6.7.2-${{ matrix.qt-target }}-${{ matrix.qt-arch }}

- name: Install Qt Desktop (for cross-compilation)
if: matrix.qt-target != 'desktop'
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
target: desktop
arch: ${{ runner.os == 'macOS' && 'clang_64' || 'linux_gcc_64' }}
cache: true
dir: ${{ github.workspace }}/Qt-Desktop
install-deps: 'true'

- name: Install Qt for Mobile
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'
target: ${{ matrix.qt-target }}
arch: ${{ matrix.qt-arch }}
dir: ${{ github.workspace }}/Qt
cache: true
install-deps: 'true'

- name: Configure CMake for ${{ matrix.platform }}
run: |
# Set QT_HOST_PATH for cross-compilation and ensure correct Qt6_DIR
if [[ "${{ matrix.platform }}" == android* ]] || [[ "${{ matrix.platform }}" == "ios" ]]; then
if [[ "${{ runner.os }}" == "macOS" ]]; then
export QT_HOST_PATH="${{ github.workspace }}/Qt-Desktop/Qt/6.7.2/macos"
else
export QT_HOST_PATH="${{ github.workspace }}/Qt-Desktop/Qt/6.7.2/gcc_64"
fi
# For Android builds, use the Android Qt installation
if [[ "${{ matrix.platform }}" == android* ]]; then
export Qt6_DIR="${{ github.workspace }}/Qt/6.7.2/${{ matrix.qt-arch }}"
else
export Qt6_DIR="${{ github.workspace }}/Qt/6.7.2/${{ matrix.qt-target }}"
fi
echo "Using QT_HOST_PATH: $QT_HOST_PATH"
echo "Qt6_DIR for mobile build: $Qt6_DIR"

# Debug: List what's actually installed
echo "=== Debug: Qt Desktop contents ==="
find "${{ github.workspace }}/Qt-Desktop" -maxdepth 4 -type d 2>/dev/null || true
echo "=== Debug: Qt Mobile contents ==="
find "${{ github.workspace }}/Qt" -maxdepth 4 -type d 2>/dev/null || true
fi

cmake -B build-${{ matrix.platform }} \
-DCMAKE_BUILD_TYPE=Release \
-DQt6_DIR="$Qt6_DIR/lib/cmake/Qt6" \
${QT_HOST_PATH:+-DQT_HOST_PATH="$QT_HOST_PATH"} \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \
${{ matrix.cmake-args }} \
-DBUILD_TESTING=OFF

- name: Build for ${{ matrix.platform }}
run: cmake --build build-${{ matrix.platform }} --config Release

code-quality:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.7.2'

- name: Install tools
run: |
sudo apt-get update
sudo apt-get install -y clang-format clang-tidy cppcheck doxygen

- name: Check formatting
run: |
find src/ -name "*.cpp" -o -name "*.h" | xargs clang-format --dry-run --Werror

- name: Static analysis
run: |
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
run-clang-tidy -p build src/

- name: Cppcheck
run: |
set -e
echo "Running cppcheck using repository script (no build needed)"
chmod +x scripts/cppcheck.sh
./scripts/cppcheck.sh

- name: Generate documentation
run: |
doxygen docs/Doxyfile

- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/html/

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, build-mobile, code-quality]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.7.2'

- name: Build Release
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

- name: Package
run: |
cd build
cpack

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: build/*.tar.gz
draft: false
prerelease: false
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ src/qqmlmodels/QQmlModels_resource.rc
src/qqmlmodels/QQmlModelsd_resource.rc
build_5_14_2
build_5_15
build/
CMakeFiles/
CMakeCache.txt
docs/html/
docs/latex/
*.log
.DS_Store
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"files.associations": {
"array": "cpp",
"string": "cpp",
"string_view": "cpp"
}
}
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Comprehensive CMake build system with proper installation and packaging
- GitHub Actions CI/CD pipeline for automated testing and releases
- Complete test suite with unit tests for all major components
- Doxygen documentation generation
- Code quality tools (clang-format, clang-tidy, cppcheck)
- Development scripts for building, testing, and maintenance
- Detailed README with usage examples and development guidelines
- Professional project structure with proper export headers

### Changed
- Migrated to modern CMake as primary build system (QMake files preserved as legacy)
- Updated CMakeLists.txt to support Qt6 and proper library installation
- **Updated CI/CD pipeline to use Qt 6.7.2 (compatible with install-qt-action)**
- Improved .gitignore to exclude build artifacts
- Enhanced project structure for better maintainability

### Fixed
- Qt6 compatibility issues
- Build system improvements for cross-platform support
- Header include paths and export definitions
- **Updated deprecated GitHub Actions (upload-artifact@v3 to v4, cache@v3 to v4)**
- **Replaced Q_SLOTS with slots to fix cppcheck unknown macro warnings**
- **Configured cppcheck to properly recognize Qt keywords and macros**
- **Fixed cppcheck command line syntax (-D instead of --define=)**

## [1.0.0] - Previous Release

### Added
- QQmlObjectListModel for exposing C++ object lists to QML
- QQmlVariantListModel for dynamic variant lists in QML
- Qt Super Macros for property declarations
- Basic QMake build system
- GitLab CI configuration

### Features
- Template-based QQmlObjectListModel with type safety
- Dynamic QQmlVariantListModel with variant support
- Comprehensive property macros (writable, readonly, constant)
- Cross-platform compatibility
- QML integration ready
Loading