CopperSpice is a set of individual libraries which can be used to develop cross platform software applications in C++. It is a totally open source project released under the LGPL V2.1 license and was initially derived from the Qt framework. Over the last several years CopperSpice has completely diverged, with a goal of providing a first class GUI library to unite the C++ community.
Our motivation for developing CopperSpice was to change the fundamental design and turn the existing framework into a set of libraries for C++ developers. We are accomplishing this by leveraging modern C++ functionality, new technology, and modern tooling.
You can use CopperSpice with any existing tool chain such as GCC, MinGW, clang, or MSVC. A C++ program using the CopperSpice libraries can be developed using any editor such as VI, emacs, or Diamond and built using CMake from a shell command line. For an integrated environment Visual Studio or QtCreator can be used for development, building, testing, and deployment.
Links for Quick Reference
Libraries
CopperSpice consists of the following libraries which can be linked into any existing C++ application.
- CsCore
- Date/Time, Containers (QVector, QList, QMap, QHash, QStack, etc), File System, JSON, Strings (UTF-8, UTF-16)
- CsGui
- File Dialogs, Menus, Widgets (QCheckbox, QPushbutton, QLineEdit, etc), Printing
- CsMultimedia
- Audio, Camera, Video
- CsNetwork
- TCP, HTTP, FTP, IPv4, IPv6, DNS lookups, SSL, URL support
- CsOpenGL
- Rendering Context, Shader
- CsSql
- SQLite, PostgreSQL, MySQL, etc
- CsSvg
- Renderer, Widget
- CsVulkan
- Vulkan Instance, Vulkan Surface, Vulkan Devices
- CsWebKit
- Web View, Web Page
- CsXml
- DOM, Reader
- CsXmlPatterns
- Schema, Xml Query
There are also open source BSD licensed libraries which are used by CopperSpice and available as stand alone libraries for anyone developing a C++ application. Documentation for these libraries can be found on our website.
- CsLibGuarded
- CsPointer
- CsSignal
- CsString
System Requirements
To use the CopperSpice libraries a C++20 compiler and a C++20 standard library are required. CopperSpice CMake build files are provided with the source distribution.
For additional information about building from source, refer to our CopperSpice Overview Documentation or our KitchenSink demo application for sample CMake project files.
Building
The CopperSpice libraries are built using the CMake build system.
Benefits of CopperSpice
Reflection / Meta Object Compiler
- The Meta-Object Compiler is no longer required for generating reflection meta data in CopperSpice
- Since moc is no longer required it was completely removed
- All functionality originally provided by moc was replaced with compile time templates
- CopperSpice automatically generates meta data for processing Signals/Slots and Introspection
- Removal of moc simplifies the build process
- A template class can inherit from QObject with no restrictions on data types
- Complex data types can be used as signal or slot arguments, for example this is valid code in Copperspice
QMap<QString, int>
Extensive use of modern C++ functionality
- templates, variadic templates, variadic variable templates
- lambda expressions
- expression SFINAE
- move semantics, rvalue references
- override, noexcept
- constexpr, constexpr if
- decltype, type traits, tuple
- threading model
- strongly typed enums
- requires clause, constraints
- three-way comparison
Reimplemented all container classes
-
Composition is used to wrap the C++ standard library containers
-
QVector, QList, QStringList, QLinkedList, QSet, QStack, QQueue
-
QMap, QHash, QMultiMap, QMultiHash
-
Supports both the STL and Qt API
-
Implement QMultiHash and QMultiMap as separate classes from QHash and QMap
-
Reverse iterators
-
Removed copy on write semantics
-
Added QFlatMap
-
Ordered map which stores elements in contiguous memory as a sorted vector of pairs
-
Similar API to QMap
Key Enhancements
-
CopperSpice includes a majority of the Qt 5 classes
-
Improved CsNetwork support for OpenSSL
-
Support for TLS and SPDY added
-
Add support for SHA-2 and SHA-3
-
Reimplemented atomic support (QAtomicInt, QAtomicPointer) wrapping the C++ standard library functionality
-
Enhanced CopperSpice to use the STL algorithms rather than hand rolled algorithms
-
Removed support for obsolete platforms
-
QLocale classes refactored to use UTF-8 string classes
-
Update codec classes to use UTF-8 string classes
-
High DPI support
-
Moved to Unicode 15, added support for new Harfbuzz for text shaping
-
Improved platform specific support
-
Redesign plugin system
-
QVariant redesign, removed unions in favor of type safe C++ constructs
-
Guard all debug output with CS_SHOW_DEBUG_* macros to easily enable/disable output
Integration of CsPointer
-
Improved compatibility with the standard library Smart Pointers
-
Add QSharedArrayPointer and QScopedArrayPointer
Integration of CsSignal
-
Improved thread aware Signal/Slot delivery
-
Increased efficiency while maintaining the full Signal/Slot API
-
Deadlocks in Signal/Slot processing have been eliminated
Integration of CsString
-
Use accurate storage to properly represent Unicode strings
-
Added new QString8 (UTF-8) and QString16 (UTF-16) classes
-
QString is synonymous with QString8
-
Moved various formatting methods to the new QStringParser class
-
Redesign QRegularExpression using iterators to handle UTF-8 and UTF-16
-
Add QStringView class which works correctly with the CopperSpice QString classes
-
Remove string surrogate checking since it is not required with UTF-8 / UTF-16 encoding
-
Added support for char8_t
-
Additional Items
-
All CopperSpice libraries are built using CMake
-
Extensive use of the Catch Unit Test System
-
Release binary distribution of MinGW 10, MinGW 11, MinGW 12, MinGW 13, and MinGW 14
-
Redesign CMake build files to locate system versions of CsLibGuarded, CsPointer, CsSignal, and CsString instead of using the default bundled version
Migrating to CopperSpice
PepperMill is a translation utility and is run one time on your Qt header files to migrate to CopperSpice. This utility will convert your application header files to standard C++ and alter the source to use CopperSpice syntax. This mostly affects signals, slots, properties, enums, and flags.
We have made the process of converting to CopperSpice simple and straight forward. Simply convert your application header files one time using the PepperMill utility and then modify your build files to use CMake.
For sample build files you can refer to the KitchenSink demo application or the build files used in the DoxyPress project.
For more information refer to PepperMill and Migration Notes.
API Documentation
Full class documentation is available on the CopperSpice website or our downloaded page.
On line: CopperSpice API Documentation
Download: CopperSpice API Documentation
Presentations / YouTube
Our channel contains over 75 videos about C++ programming, rendering 3D Graphics, the CopperSpice libraries, and documenting with DoxyPress. Please subscribe to our YouTube channel so you will be notified when new videos are uploaded.
https://www.youtube.com/copperspice
Presentations
Links to technical presentations recorded at CppNow, CppCon, and Meeting C++. There are also several slide decks from talks given at multiple C++ user groups in the United States, Amsterdam, Munich, and London.
www.copperspice.com/presentations.html
License
The CopperSpice libraries are released under the LGPL V2.1 license. The open source libraries CsPaint, CsSignal, CsString, and CsLibGuarded are released under the BSD license. For more information refer to the LICENSE files provided with each project.