uic: Add qualification with "self." for Python
Prepend "self." (this) to the name stored in the class Driver's hashes as specifying it is mandatory in Python. Task-number: PYSIDE-797 Change-Id: I1da110b84b2d1131ee6af915f9cc4ba21d7de710 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>bb10
parent
bc8633036c
commit
5b8676578d
|
|
@ -30,6 +30,8 @@
|
|||
#include "uic.h"
|
||||
#include "ui4.h"
|
||||
|
||||
#include <language.h>
|
||||
|
||||
#include <qfileinfo.h>
|
||||
#include <qdebug.h>
|
||||
|
||||
|
|
@ -63,17 +65,21 @@ const DomClass *Driver::findByAttributeName(const DomObjectHash<DomClass> &domHa
|
|||
|
||||
template <class DomClass>
|
||||
QString Driver::findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom,
|
||||
const QString &className)
|
||||
const QString &className, bool isMember)
|
||||
{
|
||||
auto it = domHash->find(dom);
|
||||
if (it == domHash->end())
|
||||
it = domHash->insert(dom, this->unique(dom->attributeName(), className));
|
||||
if (it == domHash->end()) {
|
||||
const QString name = this->unique(dom->attributeName(), className);
|
||||
it = domHash->insert(dom, isMember ? language::self + name : name);
|
||||
}
|
||||
return it.value();
|
||||
}
|
||||
|
||||
QString Driver::findOrInsertWidget(const DomWidget *ui_widget)
|
||||
{
|
||||
return findOrInsert(&m_widgets, ui_widget, ui_widget->attributeClass());
|
||||
// Top level is passed into setupUI(), everything else is a member variable
|
||||
const bool isMember = !m_widgets.isEmpty();
|
||||
return findOrInsert(&m_widgets, ui_widget, ui_widget->attributeClass(), isMember);
|
||||
}
|
||||
|
||||
QString Driver::findOrInsertSpacer(const DomSpacer *ui_spacer)
|
||||
|
|
|
|||
|
|
@ -98,7 +98,8 @@ private:
|
|||
const DomClass *findByAttributeName(const DomObjectHash<DomClass> &domHash,
|
||||
const QString &name) const;
|
||||
template <class DomClass>
|
||||
QString findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom, const QString &className);
|
||||
QString findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom, const QString &className,
|
||||
bool isMember = true);
|
||||
|
||||
Option m_option;
|
||||
QTextStream m_stdout;
|
||||
|
|
|
|||
Loading…
Reference in New Issue