Akonadi

akqt.h
1/*
2 SPDX-FileCopyrightText: 2019 Daniel Vrátil <dvratil@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <utility>
10
11#include <QString>
12#include <QStringView>
13
14/// Helper integration between Akonadi and Qt
15
16namespace Akonadi
17{
18template<typename DPtr, typename Slot>
19auto akPrivSlot(DPtr &&dptr, Slot &&slot)
20{
21 return [&dptr, &slot](auto &&...args) {
22 (dptr->*slot)(std::forward<decltype(args)>(args)...);
23 };
24}
25
26} // namespace
27
28inline QString operator""_qs(const char16_t *str, std::size_t len)
29{
30 return QString(reinterpret_cast<const QChar *>(str), len);
31}
32
33constexpr QStringView operator""_qsv(const char16_t *str, std::size_t len)
34{
35 return QStringView(str, len);
36}
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.