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