Toolbox Qt
Loading...
Searching...
No Matches
Toolbox Qt

Custom toolbox containing multiple classes that can be useful when using Qt framework

Remarks
Latest development/pull requests will be committed into main branch.
Each stable release have their dedicated branch:
  • 1.0.x: branch dev/1.0
  • 1.1.x: branch dev/1.1
  • etc...

Table of contents :

1. Library details

1.1. Features

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.
    • Table:
    • tbq::DialogAbout: Allow to easily create an "about" dialog window
    • 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

2. Requirements

2.1. C++ Standards

This library requires at least C++ 17 standard

2.2. Dependencies

Below, list of required dependencies:

Dependencies VCPKG package Comments
Qt / Compatible with Qt6.x
Compatible with Qt5.15.x
Note
Dependency manager VCPKG is not mandatory, this is only a note to be able to list needed packages

3. How to build

3.1. CMake Usage

This library can be use as an embedded library in a subdirectory of your project (like a git submodule for example) :

  1. In the root CMakeLists, add instructions :
    add_subdirectory(toolboxqt) # Or if library is put in a folder "dependencies" : add_subdirectory(dependencies/toolboxqt)
  2. In the application/library CMakeLists, add instructions :
    # Link needed libraries
    target_link_libraries(${PROJECT_NAME} PRIVATE toolboxqt)

3.2. CMake options

This library provide some CMake build options:

  • No CMake options currently available

4. How to use

4.1. Usage

To use a class, simply use the proper include:

#include "toolboxqt/widgets/labelscl.h"

All classes are defined inside namespace tbq (for ToolBoxQt).

4.2. Library version

4.2.1. Compatibility

This library follow semantic versioning for API. ABI is not preserved between versions, so software using this library will have to recompile it to update the version of the library.

4.2.2. Compilation time

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)
// Do stuff for version 2.0.0 or higher
#else
// Do stuff for earlier versions
#endif

4.2.3. Runtime

Since library header used during final application build could differ from the actual library version, it is recommended to use the method:

#include "toolboxqt/toolboxtypes.h"
const QVersionNumber libSemver = tbq::getLibraryVersion();
TOOLBOXQT_EXPORT QVersionNumber getLibraryVersion()
Used to retrieve ToolBoxQt library version.
Definition toolboxtypes.cpp:36

5. Documentation

All classes/methods has been documented with Doxygen utility and automatically generated at online website documentation.

Note
This repository contains two kinds of documentation:
  • Public API: Available via online website documentation or locally via Doxyfile docs/fragments/Doxyfile-public-api.in
  • Internal: Available locally only via docs/fragments/Doxyfile-internal.in

To generate documentation locally, we can use:

doxygen ./docs/fragments/Doxyfile-name
Remarks
You can also load the Doxyfile into Doxywizard (Doxygen GUI) and run generation.

6. License

This library is licensed under MIT license.