Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdbusextratypes.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qdbusextratypes.h"
5#include "qdbusutil_p.h"
6
7#ifndef QT_NO_DBUS
8
10
14
15#ifndef QT_NO_DEBUG_STREAM
17{
18 QDebugStateSaver saver(dbg);
19 dbg.nospace() << "QDBusObjectPath(" << path.path() << ')';
20 return dbg;
21}
22#endif
23
24void QDBusObjectPath::doCheck()
25{
26 if (!QDBusUtil::isValidObjectPath(m_path)) {
27 qWarning("QDBusObjectPath: invalid path \"%s\"", qPrintable(m_path));
28 m_path.clear();
29 }
30}
31
32void QDBusSignature::doCheck()
33{
34 if (!QDBusUtil::isValidSignature(m_signature)) {
35 qWarning("QDBusSignature: invalid signature \"%s\"", qPrintable(m_signature));
36 m_signature.clear();
37 } else if (m_signature.isEmpty()) {
38 m_signature.detach(); // we need it to not be null
39 }
40}
41
154QDBusObjectPath::operator QVariant() const { return QVariant::fromValue(*this); }
155
227
228#endif // QT_NO_DBUS
\inmodule QtDBus
\inmodule QtDBus
\inmodule QtDBus
\inmodule QtCore
\inmodule QtCore
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
void clear()
Clears the contents of the string and makes it null.
Definition qstring.h:1252
void detach()
Definition qstring.h:1248
\inmodule QtCore
Definition qvariant.h:65
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Definition qvariant.h:536
bool isValidObjectPath(const QString &path)
Returns true if path is valid object path.
bool isValidSignature(const QString &signature)
Returns true if signature is a valid D-Bus type signature for one or more types.
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE QDebug operator<<(QDebug dbg, const QDBusObjectPath &path)
#define qWarning
Definition qlogging.h:166
#define QT_IMPL_METATYPE_EXTERN(TYPE)
Definition qmetatype.h:1390
GLsizei const GLchar *const * path
#define qPrintable(string)
Definition qstring.h:1531