Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
159 changes: 13 additions & 146 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,152 +1,19 @@
cmake_minimum_required(VERSION 3.16)
set( RONIA_KIT_LIB "RoniaKit" CACHE INTERNAL "RoniaKit")
set( QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} )

#The Library name
project(RoniaKit VERSION 1.0 LANGUAGES CXX)
file( GLOB_RECURSE RONIA_KIT_QML_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "qml/*.qml" )

# ##################################################################################################
# Project Settings
# ##################################################################################################
qt_add_library( ${RONIA_KIT_LIB} STATIC )


set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set (QML_IMPORT_PATH ${CMAKE_CURRENT_SOURCE_DIR})


#message(${QML_IMPORT_PATH})
#Turns on default settings for development of RoniaKit
set(DEVELOPER_DEFAULTS ON)

option(BUILD_TESTING "Build tests" ${DEVELOPER_DEFAULTS})
option(BUILD_EXAMPLES "Build Examples" ${DEVELOPER_DEFAULTS})
option(BUILD_SHARED_LIBS "Build as shared library" ON)
option(BUILD_DEBUG_POSTFIX_D "Append d suffix to debug libraries" OFF)

# ##################################################################################################
# Dependencies
# ##################################################################################################
# Find the Qt libraries
find_package(Qt6 REQUIRED COMPONENTS Quick Core5Compat)

if (NOT (Qt6_FOUND OR Qt5_FOUND))
message(FATAL_ERRROR "Qt libraries were not found.")
endif()


if (Qt6_FOUND)
set(Qt Qt)
else()
set(Qt Qt5)
endif()


# ##################################################################################################
# Project Files
# ##################################################################################################
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)

# Library Definition
qt_add_library(RoniaKit STATIC)

# Extra QML File properties
set_source_files_properties(
PROPERTIES
QT_QML_SINGLETON_TYPE True
)

qt_add_qml_module(RoniaKit
URI "RoniaKit"
VERSION 1.0

QML_FILES
resources/Components/Gauges/HalfDial.qml
resources/Components/Gauges/Thermometer.qml
resources/Components/Gauges/RoniaControl.qml
resources/Components/Gauges/CircularGauge.qml
resources/Components/Gauges/RangeControl.qml
resources/Components/Gauges/FuelGauge.qml
resources/Components/Gauges/LevelGauge.qml
resources/Components/Gauges/CircularBasicGauge.qml
resources/Components/Gauges/Style/CircularGaugeStyle.qml
resources/Components/Gauges/Style/RoniaControlStyle.qml
resources/Components/Gauges/Style/FuelGaugeStyle.qml
resources/Components/Gauges/Style/LevelGaugeStyle.qml
resources/Components/Gauges/Style/CircularBasicGaugeStyle.qml
resources/Components/Gauges/Extra/CircularModernGauge1.qml
resources/Components/Gauges/Extra/Style/CircularModernGauge1Style.qml
resources/Components/Gauges/Extra/CircularSpeedGauge.qml
resources/Components/Gauges/Extra/Style/CircularSpeedGaugeStyle.qml
resources/Components/Gauges/Extra/CircularAnalogGauge.qml
resources/Components/Gauges/Extra/Style/CircularAnalogGaugeStyle.qml
resources/Components/Gauges/Extra/CircularModernGauge2.qml
resources/Components/Gauges/Extra/Style/CircularModernGauge2Style.qml

SOURCES

qt_add_qml_module( ${RONIA_KIT_LIB}
URI RoniaKit
RESOURCE_PREFIX /
QML_FILES ${RONIA_KIT_QML_FILES}
RESOURCES
resources/Fonts/Font\ Awesome\ 6\ Pro-Regular-400.otf
resources/Fonts/Font\ Awesome\ 6\ Pro-Solid-900.otf
resources/Fonts/FontsFree-Net-DS-DIGI-1.ttf
resources/Images/gauge/Modern/back.png
resources/Images/gauge/Modern/knob.png
resources/Images/gauge/needle.png
resources/Images/gauge/knob.png
resources/Images/gauge/Speed/backOn.png
resources/Images/gauge/Speed/backOff.png
resources/Images/gauge/Speed/needle-on.png
resources/Images/gauge/AnalougeGauge/backScreen.svg
resources/Images/gauge/AnalougeGauge/innerRing.svg
resources/Images/gauge/AnalougeGauge/middleRing.svg
resources/Images/gauge/AnalougeGauge/outerRing.svg
resources/Images/gauge/AnalougeGauge/topScreen.svg
resources/Images/gauge/Modern/blueLight.png
resources/Images/gauge/Modern/blueNeedle.png
resources/Images/gauge/redNeedle2.png
resources/Images/gauge/redNeedle3.png
resources/Images/gauge/Fuel/back.png
resources/Images/gauge/Fuel/fuel-station-red.png
resources/Images/gauge/Fuel/fuel-station-yellow.png
resources/Images/gauge/Fuel/fuel-station-green.png
assets/fonts/fontAwesome6-Pro-Regular-400.otf
assets/fonts/fontAwesome6-Pro-Solid-900.otf
assets/fonts/fontsFree-Net-DS-DIGI-1.ttf
NO_PLUGIN
)

#Add a library to the project using the specified source file
#add_library(RoniaKit::RoniaKit ALIAS RoniaKit)

target_include_directories(RoniaKit
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/resources>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Source>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/RoniaKit>
)

#Definitions of preprocessor macros
target_compile_definitions(RoniaKit
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)

target_link_libraries(RoniaKit PRIVATE Qt6::Quick Qt6::Core5Compat)

set_target_properties(RoniaKit PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)

install(TARGETS RoniaKit
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

set(QML_IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY} CACHE STRING "QtCreator QML Modules Lookup")

if(${BUILD_EXAMPLES})
add_subdirectory(examples)
endif()

if(BUILD_TESTING)
# add_subdirectory(test)
endif()
add_subdirectory(modules/Gauges)
49 changes: 49 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy toward other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery, and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all community spaces, both physical and online, and it also applies when an individual is officially representing the community in public spaces.

Examples of representing a community include using an official community email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the community leaders at [admin@roniasoft.se](mailto:admin@roniasoft.se). All complaints will be reviewed and investigated promptly and in confidence.

In cases where inappropriate behavior has occurred, the community leaders will work with the individuals involved to resolve the situation in a constructive and respectful manner.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at [http://contributor-covenant.org/version/2/0/](http://contributor-covenant.org/version/2/0/).

For answers to common questions about this code of conduct, see [Contributor Covenant FAQ](http://contributor-covenant.org/faq/).
147 changes: 147 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Contributing to RoniaKit

Thank you for your interest in contributing to RoniaKit! 🎉
This document provides guidelines to help ensure a smooth contribution process.

---

## 🚀 Getting Started

### 1️⃣ Fork & Clone the Repository
1. Fork the repository on GitHub.
2. Clone your fork to your local machine:
```sh
git clone https://github.com/your-username/RoniaKit.git
cd RoniaKit
```
3. Add the upstream repository:
```sh
git remote add upstream https://github.com/Roniasoft/RoniaKit.git
```
4. Fetch the latest changes:
```sh
git pull upstream main
```

### 2️⃣ Setting Up the Development Environment

#### Prerequisites
- **Qt**: Install the latest stable version from [Qt official site](https://www.qt.io/download).
- **C++ Compiler**: Ensure you have a modern compiler (GCC, Clang, MSVC).
- **CMake**: Required for building the project (`sudo apt install cmake` or use the official installer).
- **Qt Creator (Optional)**: Recommended for development.

#### Build Instructions
1. Navigate to the project folder and create a build directory:
```sh
mkdir build && cd build
```
2. Configure the project:
```sh
cmake .. -DCMAKE_BUILD_TYPE=Debug
```
3. Build the project:
```sh
cmake --build .
```

---

## 🖥️ Code Conventions

### 📝 C++ Guidelines
- **Follow C++17 or later.**
- Use **4 spaces** for indentation (no tabs).
- Class names: `PascalCase` (e.g., `MainWindow`).
- Member variables: `m_camelCase` (e.g., `m_userName`).
- Constants: `UPPER_CASE_WITH_UNDERSCORES`.
- Header guards or `#pragma once` to prevent multiple inclusions.

### 📜 QML Guidelines
- Use **camelCase** for variables and `PascalCase` for components.
- Bindings should be concise and efficient.
- Prefer **property aliases** over directly exposing child components.
- Organize QML files into folders (e.g., `Controls/`, `Pages/`, `Components/`).

### 🎨 Qt & UI Guidelines
- Use **Qt’s signal/slot mechanism** for event handling.
- Keep UI logic separate from backend logic.
- Use `Q_PROPERTY` and `Q_INVOKABLE` for exposing C++ to QML.
- Place UI-related `.qml` files inside a `qml/` directory.

---

## 📦 Git Commit & Branching Strategy

### ✅ Commit Message Format
Follow this convention:
```
[type]: Short description (max 50 chars)

[Optional: Detailed description]
```
#### **Commit Types**
- `feat:` New feature.
- `fix:` Bug fix.
- `docs:` Documentation updates.
- `style:` Code style changes (no functional changes).
- `refactor:` Code restructuring (no feature changes).
- `test:` Adding/modifying tests.

**Example Commit:**
```sh
git commit -m "feat: add CircularGauge QML component"
```

### 🌱 Branching Strategy
- **`main`** → Production-ready code.
- **`develop`** → Ongoing development.
- **Feature branches:** `feature/your-feature`
- **Bugfix branches:** `fix/issue-number`

---

## 🐛 Reporting Issues

If you find a bug:
1. Check the [issue tracker](https://github.com/Roniasoft/RoniaKit/issues) to avoid duplicates.
2. Create a new issue with:
- **Environment**: Qt version, OS, compiler.
- **Steps to reproduce**.
- **Expected vs. actual behavior**.
- **Screenshots (if applicable)**.

---

## 🔥 Submitting a Pull Request

### ✅ Steps to Submit a PR
1. Create a new branch:
```sh
git checkout -b feature/new-feature
```
2. Implement changes and commit with proper messages.
3. Push to your fork:
```sh
git push origin feature/new-feature
```
4. Create a pull request (PR) on GitHub.
5. Wait for review and approval.

### 🔹 PR Requirements
- The code must follow **coding conventions**.
- PR title should be **clear & concise**.
- Include a description of changes.
- Link the issue (if applicable): `Closes #123`
- At least **one reviewer must approve** before merging.

---

## ❤️ Code of Conduct
By contributing, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md).

---

## 🎉 Thank You!
Your contributions help improve RoniaKit. We appreciate your support! 🚀

Loading