KDToolBox

KDAB's collection of miscellaneous useful C++ classes and stuff

185
26
C++

KDToolBox

KDAB’s collection of miscellaneous useful C++ classes and stuff.

Tools List

Generic Tools

C++ Tools

  • future-backports
    Backports of future C++ library components to C++11:
    • k20::erase/k20::erase_if - C++20’s uniform container erasure
  • DuplicateTracker
    A helper class to keep track of “seen” elements, e.g. to avoid processing duplicate elements
    in a collection. It transparently uses std::pmr::monotonic_buffer_resource to improve
    its memory usage (compared to a ‘plain’ set implementation).
  • toContainer
    Helper functions to convert a container to another container, using a convenient pipeline style.
  • propagate_const
    A backport of propagate_const from the C++ Extensions for Library Fundamentals version 3.

Qt Tools

  • Ui Watchdog
    A header-only tool to break the program when the main-thread event loop is blocked for more
    than 300ms.
  • Qml Stacktrace Helper
    A function for retrieving a QML backtrace with gdb.
  • Qml PropertySelector
    A QML Item to easily set property values based on a combination of conditions
  • Model/View ModelIterator
    A set of (template) classes to allow iteratating over QAbstractItemModels using std algorithms
  • Model/View SortProxyModel
    A QSortFilterProxyModel replacement that just does sorting, but properly signals moves due to sorts.
  • Model/View UpdateableModel
    A template class to make defining a model that sends proper update signals easy
  • Model/View Table to List Proxy
    A proxy model flattening a table model into a list model (mainly for Qt Quick 2).
  • Functional Sort/Filter Proxy
    A QSortFilterProxyModel convenience subclass that allows to set filtering/sorting functions,
    removing the need for subclassing.
  • TabWindow widget
    A tab widget that allows extracting a tab to a new window, like modern web browsers.
  • EventFilter
    A way for “connecting” a QEvent to lambda with two lines of code.
  • MessageHandler
    An API to help you intercept the output going through qDebug()/qWarning()/etc.
  • QStringTokenizer
    A universal, safe, zero-allocation string splitter.
  • Signal/Slot Connection Throttlers
    An implementation of throttler/debouncer classes for signal/slot connections.
  • Single Shot Connect
    A header only version of QObject::connect, that establishes a single shot connection.
  • Qt Hasher
    A header-only hasher object for using Qt types together with unordered_map, unordered_set, etc.
  • NotifyGuard
    A RAII guard object to make sure object notification signals are properly emitted.
  • asan_assert_fail_qt
    Intercept Q_ASSERT failures with ASAN and print a backtrace.
  • KDSqlDatabaseTransaction
    A RAII wrapper for database transactions when using the Qt SQL APIs.
  • pointer_cast
    Tools to ease migrating from QSharedPointer to std::shared_ptr.
  • qt_fmt
    Convenience for printing Qt classes through libfmt.
  • cmake-project
    A replacement for qmake -project, generating a ready-to-use CMakeLists.txt.
  • includemocs
    A script to add inclusion of moc files to all .cpp files in the project.
  • qt6_natvis
    Natvis file for Qt6 debugging with Visual Studio and VS Code, with a test project.
  • KDStlContainerAdaptor
    Classes to ease the transition from Qt containers to the C++ Standard Library containers.

Other Code Snippets

Squish Tools

  • kdrunsquish.py
    Runs squish tests in parallel via the Qt offscreen QPA.

Licensing

KDToolBox is © Klarälvdalens Datakonsult AB (KDAB) and is made available
under the terms of the MIT license.

Contact KDAB at [email protected] if you need different licensing options.

Licensing Exceptions

The qt6_natvis project is available under
the terms of the The Qt Company GPL Exception for GPL3 license.

For the “Other code snippets”, which are hosted outside of this repo, please consult
their own license.

Get Involved

KDAB will happily accept external contributions.

Please submit your contributions or issue reports from our GitHub space at
https://github.com/KDAB/KDToolBox.

About KDAB

KDToolBox is supported and maintained by Klarälvdalens Datakonsult AB (KDAB).

The KDAB Group is the global No.1 software consultancy for Qt, C++ and
OpenGL applications across desktop, embedded and mobile platforms.

The KDAB Group provides consulting and mentoring for developing Qt applications
from scratch and in porting from all popular and legacy frameworks to Qt.
We continue to help develop parts of Qt and are one of the major contributors
to the Qt Project. We can give advanced or standard trainings anywhere
around the globe on Qt as well as C++, OpenGL, 3D and more.

Please visit https://www.kdab.com to meet the people who write code like this.

Stay up-to-date with KDAB product announcements: