A header-only LINQ-style query library for Qt, designed for QList<T>, providing a clean, fluent, expressive C#-style querying API in modern C++17.
- Header-only, single include
- Qt-friendly (
QList<T>) - C++17 compatible
- LINQ-like fluent API
- Stable ordering for all operations
- Automatic multi-strategy
distinct() - Polymorphic filtering (
ofType<T>()) - Range-based iteration
- Optional-safe first element APIs
- QtTest unit tests
- Benchmark suite with huge datasets
#include <qtlinq/qtlinq.h>
QList<int> xs{1,2,3,4,5,6};
auto result =
qlinq::from(xs)
.where([](int x){ return x % 2 == 0; })
.select([](int x){ return x * 10; })
.toList();
// → { 20, 40, 60 }where(pred)select(func)selectMany(func)take(n)skip(n)reverse()distinct()
orderBy(key)orderByDescending(key)
first()first(pred)firstOrDefault()firstOrDefault(pred)
any(pred)all(pred)count()/count(value)min()/max()min(selector)/max(selector)minBy(selector)/maxBy(selector)sum(selector)aggregate(seed, func)
ofType<U>()
target_include_directories(your_target PRIVATE path/to/qtlinq/include)Pull requests and issues are welcome.
Open an issue before large changes.
Project uses GPLv3 License.