uic: change the first parameter of pixCall to Q1LSV

While working on QTBUG-98434 some improvements for the pre-existing
code were found during the code review.

The first parameter is the base of the QString created by the
function but it is not needed as an actual QString, it is just
appended to. Change the type from QString to QL1SV.


Task-number: QTBUG-103100
Change-Id: I8042a921628e84d951dcfd2fd12154bf74dd5162
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This commit is contained in:
Mate Barany 2022-09-02 17:42:58 +02:00
parent 6295396c64
commit a1e7c6421c
2 changed files with 11 additions and 11 deletions

View File

@ -2047,7 +2047,8 @@ QString WriteInitialization::iconCall(const DomProperty *icon)
QString WriteInitialization::pixCall(const DomProperty *p) const
{
QString type, s;
QLatin1StringView type;
QString s;
switch (p->kind()) {
case DomProperty::IconSet:
type = "QIcon"_L1;
@ -2066,23 +2067,22 @@ QString WriteInitialization::pixCall(const DomProperty *p) const
return pixCall(type, s);
}
QString WriteInitialization::pixCall(const QString &t, const QString &text) const
QString WriteInitialization::pixCall(QLatin1StringView t, const QString &text) const
{
QString type = t;
if (text.isEmpty()) {
type += "()"_L1;
return type;
}
if (text.isEmpty())
return t % "()"_L1;
QTextStream str(&type);
QString result;
QTextStream str(&result);
str << t;
str << '(';
QString pixFunc = m_uic->pixmapFunction();
const QString pixFunc = m_uic->pixmapFunction();
if (pixFunc.isEmpty())
str << language::qstring(text, m_dindent);
else
str << pixFunc << '(' << language::charliteral(text, m_dindent) << ')';
str << ')';
return type;
return result;
}
void WriteInitialization::initializeComboBox(DomWidget *w)

View File

@ -119,7 +119,7 @@ private:
QString iconCall(const DomProperty *prop);
QString pixCall(const DomProperty *prop) const;
QString pixCall(const QString &type, const QString &text) const;
QString pixCall(QLatin1StringView type, const QString &text) const;
QString trCall(const QString &str, const QString &comment = QString(), const QString &id = QString()) const;
QString trCall(DomString *str, const QString &defaultString = QString()) const;
QString noTrCall(DomString *str, const QString &defaultString = QString()) const;