1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef CUSTOMWIDGETSINFO_H
5#define CUSTOMWIDGETSINFO_H
6
7#include "treewalker.h"
8#include <qstringlist.h>
9#include <qmap.h>
10
11QT_BEGIN_NAMESPACE
12
13class Driver;
14class DomScript;
15
16class CustomWidgetsInfo : public TreeWalker
17{
18public:
19 CustomWidgetsInfo();
20
21 void acceptUI(DomUI *node) override;
22
23 void acceptCustomWidgets(DomCustomWidgets *node) override;
24 void acceptCustomWidget(DomCustomWidget *node) override;
25
26 inline DomCustomWidget *customWidget(const QString &name) const
27 { return m_customWidgets.value(key: name); }
28
29 QString customWidgetAddPageMethod(const QString &name) const;
30 QString simpleContainerAddPageMethod(const QString &name) const;
31
32 QString realClassName(const QString &className) const;
33
34 bool extends(const QString &className, QAnyStringView baseClassName) const;
35 bool extendsOneOf(const QString &className, const QStringList &baseClassNames) const;
36
37 bool isCustomWidgetContainer(const QString &className) const;
38
39 bool isAmbiguousSignal(const QString &className,
40 const QString &signalSignature) const;
41
42private:
43 using NameCustomWidgetMap = QMap<QString, DomCustomWidget*>;
44 NameCustomWidgetMap m_customWidgets;
45};
46
47QT_END_NAMESPACE
48
49#endif // CUSTOMWIDGETSINFO_H
50

source code of qtbase/src/tools/uic/customwidgetsinfo.h