Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquicktemplatesutils.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 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// Qt-Security score:significant reason:default
4
6
7#include <QtQuickTemplates2/private/qquickcontrol_p.h>
8#include <QtQuickTemplates2/private/qquicktextarea_p.h>
9#include <QtQuickTemplates2/private/qquicktextfield_p.h>
10
12
13namespace QQuickTemplatesUtils {
14
15/*!
16 \internal
17
18 Returns \c true if \a item is a \c QQuickControl or similar interactive
19 type that should be a QQuickControl-subclass but cannot due to existing
20 inheritance; e.g. \c QQuickTextField or \c QQuickTextArea.
21
22 \c QQuickPopup is not considered a controls type for this function due to
23 the original use cases that resulted in this being factored out.
24
25 \c QQuickLabel is not interactive.
26*/
27bool isInteractiveControlType(const QQuickItem *item)
28{
29 return qobject_cast<const QQuickControl *>(item)
30 || qobject_cast<const QQuickTextField *>(item)
31 || qobject_cast<const QQuickTextArea *>(item);
32}
33
34} // namespace QQuickTemplatesUtils
35
36QT_END_NAMESPACE
bool isInteractiveControlType(const QQuickItem *item)