CopperSpice is derived from the Qt framework. One of the first tasks we accomplished was to redesign the Core library and remove the Meta Object Compiler. Everything moc provided has been retained in CopperSpice, it is the implementation of reflection which we changed drastically.
In order to build the main Core library, moc had to be built first. In order to build moc, you needed QMake and the Core library. This required a bootstrap process. The past solution was to build Core in a special "bootstrap" configuration by disabling a large portion of the library with a large number of #ifdefs. Then the bootstrap library was used to build QMake, then moc was built. After this process was completed, then the real Core library was compiled.
This legacy bootstrap dance is not required in CopperSpice where CsCore is just a normal library.
Removing moc resulted in several benefits for CopperSpice. QMake is no longer required and developers can build CopperSpice with GCC or Clang using either the AutoTools or CMake build systems.
Improvements in CopperSpice
Listed below are some of the gains in CopperSpice with the improved meta data and reflection system.
- The bootstrap library is not required and all code related to it was removed
- A templated class can inherit from QObject
- Data types which contain a comma can be used without restrictions
- For example: QMap<QString, bool>
- This affects Signal/Slots, Properties, and QMetaMethod
- QMap can be used as a data type for a Signal or a Slot parameter
- CopperSpice uses a new standalone Signal/Slot library
- Improved static type checking in Signals and Slots
- Deadlocks in Signal/Slot processing have been eliminated
- Typdefs in Signal/Slot parameters are recognized as the defined type, not the alias name
Moving to CopperSpice
CopperSpice requires C++11 and takes advantage of templates, variadic templates, SFINAE, constexpr, tuples, type traits, decltype, and the power of modern C++. It is our aim to encourage other developers working on CopperSpice to leverage C++11 features to improve functionality.
Our PepperMill utility will convert your application header files to standard C++ header files. This will allow your existing Qt code to run with no other code modifications. The step is done only one time.