Custom toolbox containing multiple classes that can be useful when using Qt framework
Table of contents :
- 1. Requirements
- 1.1. C++ Standards
- 1.2. Dependencies
- 2. How to build
- 3. How to use
- 3.1. Available utilities
- 3.2. Library version
- 4. Documentation
- 5. License
1. Requirements
1.1. C++ Standards
This library requires at least C++ 11 standard
1.2. Dependencies
Below, list of required dependencies:
Dependencies | VCPKG package | Comments |
Qt | / | Library built with Qt framework and compatible with series 5.15.x and 6.x |
Dependency manager VCPKG is not mandatory, this is only a note to be able to list needed packages
2. How to build
This library can be use as an embedded library in a subdirectory of your project (like a git submodule for example) :
- In the root CMakeLists, add instructions :
add_subdirectory(toolboxqt) # Or if library is put in a folder "deps" : add_subdirectory(deps/toolboxqt)
- In the application/library CMakeLists, add instructions :
# Link needed libraries
target_link_libraries(${PROJECT_NAME} PRIVATE toolboxqt)
3. How to use
3.1. Available utilities
Library is separated according to Qt modules, current modules and classes are (for each classes, more details can be found in their own documentation):
- containers:
- core:
- qml:
- tbq::QmlHelper: Class containing multiple helpful methods that can be used in QML
- widgets:
- Buttons:
- tbq::BtnAbstractWordWrap: Virtual class which define an interface allowing to properly wrap text of a button
- tbq::BtnTool: Inherit from QToolButton and BtnAbstractWordWrap
- tbq::BtnPush: Inherit from QPushButton and BtnAbstractWordWrap. Also add double-click event support.
- tbq::FileChooser: Used to choose a file from user-space
- tbq::LabelScl: Custom class which inherit from QLabel class and properly scale image or animations to the label size.
- tbq::WidgetHelper: Group multiple methods that are simple enough to not have to create an inherited object
To use a class, simply use the proper include:
#include "toolboxqt/widgets/labelscl.h"
All classes are defined inside namespace tbq
(for ToolBoxQt).
3.2. Library version
In order to easily check at compilation time library version (to manage compatibility between multiple versions for example), macro TOOLBOXQT_VERSION_ENCODE
(defined inside toolboxqt_global.h file) can be used:
#if TOOLBOXQT_VERSION >= TOOLBOXQT_VERSION_ENCODE(2,0,0)
#else
#endif
4. Documentation
All classes has been documented with Doxygen utility and automatically generated at online website documentation
To generate documentation locally, we can use:
# Run documentation generation
doxygen ./Doxyfile
# Under Windows OS, maybe doxygen is not added to the $PATH
"C:\Program Files\doxygen\bin\doxygen.exe" ./Doxyfile
Note: You can also load the Doxyfile into Doxywizard (Doxygen GUI) and run generation.
5. License
This library is licensed under MIT license.