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
pythonwriteimports.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3// Qt-Security score:insignificant reason:build-tool
4
5#ifndef PYTHONWRITEIMPORTS_H
6#define PYTHONWRITEIMPORTS_H
7
8#include <writeincludesbase.h>
9
10#include <QtCore/qhash.h>
11#include <QtCore/qmap.h>
12#include <QtCore/qstringlist.h>
13
15
16namespace Python {
17
19{
20public:
22
23 explicit WriteImports(Uic *uic);
24
25 void acceptUI(DomUI *node) override;
26 void acceptProperty(DomProperty *node) override;
27
28protected:
29 void doAdd(const QString &className, const DomCustomWidget *dcw = nullptr) override;
30
31private:
32 void addPythonCustomWidget(const QString &className, const DomCustomWidget *dcw);
33 bool addQtClass(const QString &className);
34 void addEnumBaseClass(const QString &v);
35 void writeResourceImport(const QString &module);
36 QString resourceAbsolutePath(QString resource) const;
37
38 QHash<QString, QString> m_classToModule;
39 // Module->class (modules sorted)
40
41 ClassesPerModule m_qtClasses;
42 ClassesPerModule m_customWidgets;
43 QStringList m_plainCustomWidgets; // Custom widgets without any module
44};
45
46} // namespace Python
47
48QT_END_NAMESPACE
49
50#endif // PYTHONWRITEIMPORTS_H
void acceptUI(DomUI *node) override
void acceptProperty(DomProperty *node) override
void doAdd(const QString &className, const DomCustomWidget *dcw=nullptr) override
Definition uic.h:31
void acceptUI(DomUI *node) override
void acceptProperty(DomProperty *node) override
static void formatImportClasses(QTextStream &str, QStringList classList)
static void insertClass(const QString &module, const QString &className, WriteImports::ClassesPerModule *c)
static void formatClasses(QTextStream &str, const WriteImports::ClassesPerModule &c, bool useStarImports=false, const QByteArray &modulePrefix={})
static WriteImports::ClassesPerModule defaultClasses()
Combined button and popup list for selecting options.
const QString & asString(const QString &s)
Definition qstring.h:1700
#define qPrintable(string)
Definition qstring.h:1705
#define QStringLiteral(str)
Definition qstring.h:1847