uic: updates from running generate_ui

(as of qttools:9ed1cfb27d7354cbc1020563569b8f65a3311303)

Change-Id: I2f539d2a20428cf167c04ea9f5881b1f5d58beb0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Marc Mutz 2015-10-14 19:29:24 +02:00
parent 61be975574
commit 361a4c1994
2 changed files with 125 additions and 1 deletions

View File

@ -8776,6 +8776,8 @@ void DomSlots::setElementSlot(const QStringList& a)
void DomPropertySpecifications::clear(bool clear_all)
{
qDeleteAll(m_tooltip);
m_tooltip.clear();
qDeleteAll(m_stringpropertyspecification);
m_stringpropertyspecification.clear();
@ -8793,6 +8795,8 @@ DomPropertySpecifications::DomPropertySpecifications()
DomPropertySpecifications::~DomPropertySpecifications()
{
qDeleteAll(m_tooltip);
m_tooltip.clear();
qDeleteAll(m_stringpropertyspecification);
m_stringpropertyspecification.clear();
}
@ -8804,6 +8808,12 @@ void DomPropertySpecifications::read(QXmlStreamReader &reader)
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
const QString tag = reader.name().toString().toLower();
if (tag == QLatin1String("tooltip")) {
DomPropertyToolTip *v = new DomPropertyToolTip();
v->read(reader);
m_tooltip.append(v);
continue;
}
if (tag == QLatin1String("stringpropertyspecification")) {
DomStringPropertySpecification *v = new DomStringPropertySpecification();
v->read(reader);
@ -8830,6 +8840,10 @@ void DomPropertySpecifications::write(QXmlStreamWriter &writer, const QString &t
{
writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertyspecifications") : tagName.toLower());
for (int i = 0; i < m_tooltip.size(); ++i) {
DomPropertyToolTip* v = m_tooltip[i];
v->write(writer, QStringLiteral("tooltip"));
}
for (int i = 0; i < m_stringpropertyspecification.size(); ++i) {
DomStringPropertySpecification* v = m_stringpropertyspecification[i];
v->write(writer, QStringLiteral("stringpropertyspecification"));
@ -8840,12 +8854,84 @@ void DomPropertySpecifications::write(QXmlStreamWriter &writer, const QString &t
writer.writeEndElement();
}
void DomPropertySpecifications::setElementTooltip(const QList<DomPropertyToolTip*>& a)
{
m_children |= Tooltip;
m_tooltip = a;
}
void DomPropertySpecifications::setElementStringpropertyspecification(const QList<DomStringPropertySpecification*>& a)
{
m_children |= Stringpropertyspecification;
m_stringpropertyspecification = a;
}
void DomPropertyToolTip::clear(bool clear_all)
{
if (clear_all) {
m_text.clear();
m_has_attr_name = false;
}
m_children = 0;
}
DomPropertyToolTip::DomPropertyToolTip()
{
m_children = 0;
m_has_attr_name = false;
}
DomPropertyToolTip::~DomPropertyToolTip()
{
}
void DomPropertyToolTip::read(QXmlStreamReader &reader)
{
foreach (const QXmlStreamAttribute &attribute, reader.attributes()) {
QStringRef name = attribute.name();
if (name == QLatin1String("name")) {
setAttributeName(attribute.value().toString());
continue;
}
reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString());
}
for (bool finished = false; !finished && !reader.hasError();) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement : {
const QString tag = reader.name().toString().toLower();
reader.raiseError(QStringLiteral("Unexpected element ") + tag);
}
break;
case QXmlStreamReader::EndElement :
finished = true;
break;
case QXmlStreamReader::Characters :
if (!reader.isWhitespace())
m_text.append(reader.text().toString());
break;
default :
break;
}
}
}
void DomPropertyToolTip::write(QXmlStreamWriter &writer, const QString &tagName) const
{
writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertytooltip") : tagName.toLower());
if (hasAttributeName())
writer.writeAttribute(QStringLiteral("name"), attributeName());
if (!m_text.isEmpty())
writer.writeCharacters(m_text);
writer.writeEndElement();
}
void DomStringPropertySpecification::clear(bool clear_all)
{

View File

@ -144,6 +144,7 @@ class DomWidgetData;
class DomDesignerData;
class DomSlots;
class DomPropertySpecifications;
class DomPropertyToolTip;
class DomStringPropertySpecification;
/*******************************************************************************
@ -3541,6 +3542,9 @@ public:
// attribute accessors
// child element accessors
inline QList<DomPropertyToolTip*> elementTooltip() const { return m_tooltip; }
void setElementTooltip(const QList<DomPropertyToolTip*>& a);
inline QList<DomStringPropertySpecification*> elementStringpropertyspecification() const { return m_stringpropertyspecification; }
void setElementStringpropertyspecification(const QList<DomStringPropertySpecification*>& a);
@ -3551,15 +3555,49 @@ private:
// attribute data
// child element data
uint m_children;
QList<DomPropertyToolTip*> m_tooltip;
QList<DomStringPropertySpecification*> m_stringpropertyspecification;
enum Child {
Stringpropertyspecification = 1
Tooltip = 1,
Stringpropertyspecification = 2
};
DomPropertySpecifications(const DomPropertySpecifications &other);
void operator = (const DomPropertySpecifications&other);
};
class QDESIGNER_UILIB_EXPORT DomPropertyToolTip {
public:
DomPropertyToolTip();
~DomPropertyToolTip();
void read(QXmlStreamReader &reader);
void write(QXmlStreamWriter &writer, const QString &tagName = QString()) const;
inline QString text() const { return m_text; }
inline void setText(const QString &s) { m_text = s; }
// attribute accessors
inline bool hasAttributeName() const { return m_has_attr_name; }
inline QString attributeName() const { return m_attr_name; }
inline void setAttributeName(const QString& a) { m_attr_name = a; m_has_attr_name = true; }
inline void clearAttributeName() { m_has_attr_name = false; }
// child element accessors
private:
QString m_text;
void clear(bool clear_all = true);
// attribute data
QString m_attr_name;
bool m_has_attr_name;
// child element data
uint m_children;
DomPropertyToolTip(const DomPropertyToolTip &other);
void operator = (const DomPropertyToolTip&other);
};
class QDESIGNER_UILIB_EXPORT DomStringPropertySpecification {
public:
DomStringPropertySpecification();