Skip to content

Commit

Permalink
Merge pull request #152 from oblivioncth/dev
Browse files Browse the repository at this point in the history
Merge to master for v0.6
  • Loading branch information
oblivioncth authored Jan 27, 2025
2 parents 583fd74 + aa74341 commit b5fdb9d
Show file tree
Hide file tree
Showing 70 changed files with 8,617 additions and 415 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ cmake_minimum_required(VERSION 3.23.0...3.26.0)
# avoided and only used for hotfixes. DON'T USE TRAILING
# ZEROS IN VERSIONS
project(Qx
VERSION 0.5.8
VERSION 0.6
LANGUAGES CXX
DESCRIPTION "Qt Extensions Library"
)

# Get helper scripts
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchOBCMake.cmake)
fetch_ob_cmake("v0.3.7")
fetch_ob_cmake("v0.3.8")

# Initialize project according to standard rules
include(OB/Project)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ This project makes use of the CMake build system generator for both compilation

It is based on Qt 6.

[![Dev Builds](https://github.com/oblivioncth/Qx/actions/workflows/push-reaction.yml/badge.svg?branch=dev)](https://github.com/oblivioncth/Qx/actions/workflows/push-reaction.yml)
[![Dev Builds](https://github.com/oblivioncth/Qx/actions/workflows/build-project.yml/badge.svg?branch=dev)](https://github.com/oblivioncth/Qx/actions/workflows/build-project.yml)

## Documentation:
Detailed documentation of this library, facilitated by Doxygen, is available at: https://oblivioncth.github.io/Qx/

### Highlights:

- [Bindable Properties](https://oblivioncth.github.io/Qx/properties.html)
- [Declarative JSON](https://oblivioncth.github.io/Qx/declarativejson.html)
- [Qx::ApplicationLogger](https://oblivioncth.github.io/Qx/classQx_1_1ApplicationLogger.html)
- [Qx::AsyncDownloadManager](https://oblivioncth.github.io/Qx/classQx_1_1AsyncDownloadManager.html)/[Qx::SyncDownloadManager](https://oblivioncth.github.io/Qx/classQx_1_1SyncDownloadManager.html)
- [Qx::Base85](https://oblivioncth.github.io/Qx/classQx_1_1Base85.html)
- [Qx::Cumulation< K, V >](https://oblivioncth.github.io/Qx/classQx_1_1Cumulation.html)
- [Qx::Table< T >](https://oblivioncth.github.io/Qx/classQx_1_1Table.html)/[Qx::DsvTable](https://oblivioncth.github.io/Qx/classQx_1_1DsvTable.html)
- [Qx::Error](https://oblivioncth.github.io/Qx/classQx_1_1Error.html)
- [Qx::GroupedProgressManager](https://oblivioncth.github.io/Qx/classQx_1_1GroupedProgressManager.html)
- [Qx::Json](https://oblivioncth.github.io/Qx/qx-json_8h.html)
- [Qx::SetOnce< T >](https://oblivioncth.github.io/Qx/classQx_1_1SetOnce.html)
- [Qx::TaskbarButton](https://oblivioncth.github.io/Qx/classQx_1_1TaskbarButton.html)
- [qx-common-io.h](https://oblivioncth.github.io/Qx/qx-common-io_8h.html)
Expand Down
5 changes: 4 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ set(DOXYGEN_PREDEFINED
"QX_DECLARE_ERROR_ADAPTATION(Adaptable, Adapter)="
)

set(DOXYGEN_EXCLUDE_SYMBOLS
"_QxPrivate"
)

# Setup documentation
ob_standard_documentation(${DOC_TARGET_NAME}
DOXY_VER 1.9.4
PROJ_NAME "${PROJECT_NAME}"
QT_PREFIX "${Qt_PREFIX_PATH}"
QT_MODULES
qtconcurrent
qtcore
Expand Down
4 changes: 2 additions & 2 deletions doc/cmake/file_templates/mainpage.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ The requirements for building from Git are the same as for using Qx, with the ob

If newer to working with Qt, it is easiest to build from within Qt creator as it handles a large portion of environment setup, including adding Qt to CMake's package search list, automatically. Simply make sure that a kit is configured in Qt Creator that uses a compatible version of Qt, open the CMakeLists.txt file as a project, and build with the desired configuration.

The CMake project is designed to be used with multi-configuration generators such as Visual Studio or Ninja Multi-Config (recommended), and may require some tweaking to work with single configuration generators.

If you only need a subset of Qx's components, the **QX_COMPONENTS** cache variable can be set to a semicolon or whitespace separated list of components. Only these components and their required dependencies will be configured, which can save on build time.

The `ninja` generator is recommended.

### CMake Options:

- `QX_DOCS` - Set to `ON` in order to generate the documentation target (OFF)
Expand Down
7 changes: 7 additions & 0 deletions doc/general/majorfeatures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Major Features {#majorfeatures}
===============================

This page catalogues the most significant features of Qx, which generally form a complete/comprehensive system that can be evaluated independently from the rest of the library.

- @subpage properties "Bindable Properties System"
- @subpage declarativejson "Declarative JSON"
22 changes: 22 additions & 0 deletions lib/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ qx_add_component("Core"
qx-algorithm.h
qx-array.h
qx-base85.h
qx-bimap.h
qx-bitarray.h
qx-bytearray.h
qx-char.h
Expand All @@ -13,6 +14,7 @@ qx_add_component("Core"
qx-dsvtable.h
qx-error.h
qx-exclusiveaccess.h
qx-flatmultiset.h
qx-freeindextracker.h
qx-genericerror.h
qx-global.h
Expand All @@ -22,17 +24,22 @@ qx_add_component("Core"
qx-iostream.h
qx-json.h
qx-list.h
qx-lopmap.h
qx-processbider.h
qx-progressgroup.h
qx-property.h
qx-table.h
qx-threadsafesingleton.h
qx-versionnumber.h
qx-regularexpression.h
qx-setonce.h
qx-string.h
qx-system.h
qx-systemerror.h
qx-systemsignalwatcher.h
qx-traverser.h
__private/qx-internalerror.h
__private/qx-property_detail.h
IMPLEMENTATION
qx-abstracterror.cpp
qx-algorithm.cpp
Expand All @@ -55,6 +62,8 @@ qx_add_component("Core"
qx-processbider.cpp
qx-processbider_p.h
qx-progressgroup.cpp
qx-property_p.h
qx-property.cpp
qx-versionnumber.cpp
qx-string.cpp
qx-system.cpp
Expand All @@ -66,25 +75,38 @@ qx_add_component("Core"
qx-systemerror.cpp
qx-systemerror_linux.cpp
qx-systemerror_win.cpp
qx-systemsignalwatcher.cpp
qx-systemsignalwatcher_p.h
__private/qx-generalworkerthread.h
__private/qx-generalworkerthread.cpp
__private/qx-internalerror.cpp
__private/qx-processwaiter.h
__private/qx-processwaiter.cpp
__private/qx-processwaiter_win.h
__private/qx-processwaiter_win.cpp
__private/qx-processwaiter_linux.h
__private/qx-processwaiter_linux.cpp
__private/qx-signaldaemon.h
__private/qx-signaldaemon_win.h
__private/qx-signaldaemon_win.cpp
__private/qx-signaldaemon_linux.h
__private/qx-signaldaemon_linux.cpp
DOC_ONLY
qx-bimap.dox
qx-regularexpression.dox
qx-bytearray.dox
qx-exclusiveaccess.dox
qx-flatmultiset.dox
qx-index.dox
qx-iostream.dox
qx-list.dox
qx-lopmap.dox
qx-traverser.dox
qx-cumulation.dox
qx-array.dox
qx-setonce.dox
qx-table.dox
qx-threadsafesingleton.dox
LINKS
PUBLIC
${Qt}::Core
Expand Down
71 changes: 71 additions & 0 deletions lib/core/doc/general/declarativejson.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Qx Declarative JSON {#declarativejson}
======================================

Qx features a highly flexible, simple to use, declarative mechanism for parsing/serializing JSON data into user structs and other types.

For example, the following JSON data:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.json}
{
"title": "Sample JSON Data",
"info": {
"rating": 10,
"cool": true
},
"reviews": [
"Wicked!",
"Awesome!",
"Fantastic!"
]
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

can easily be parsed into a corresponding set of C++ data structures like so:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
#include <qx/core/qx-json.h>
struct Info
{
int rating;
bool cool;
QX_JSON_STRUCT(rating, cool);
};
struct MyJson
{
QString title;
Info info;
QList<QString> reviews;
QX_JSON_STRUCT(title, info, reviews);
};
int main()
{
QFile jsonFile("data.json");
MyJson myJsonDoc;
// Parse into custom structures
Qx::JsonError je = Qx::parseJson(myJsonDoc, jsonFile);
Q_ASSERT(!je.isValid());
...
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Likewise, the structure can be serialized back out into textual JSON data with:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
int main()
{
...
// Serialize to JSON
je = Qx::serializeJson(jsonFile, myJsonDoc);
Q_ASSERT(!je.isValid());
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This system is accessed through the qx-json.h header, predominantly with QX_JSON_STRUCT().
Loading

0 comments on commit b5fdb9d

Please sign in to comment.