uic: Write fully qualified enumerations for cursors/icon pixmaps
Fixes: PYSIDE-2492 Change-Id: Ic2505628b0550654c109cf239b4f2390f03df623 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> (cherry picked from commit b0325c799287a56837d7dd3b9eb40762107302be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0aa3b32ad4
commit
fe6e1c2191
@ -1393,8 +1393,8 @@ void WriteInitialization::writeProperties(const QString &varName,
|
|||||||
case DomProperty::CursorShape:
|
case DomProperty::CursorShape:
|
||||||
if (p->hasAttributeStdset() && !p->attributeStdset())
|
if (p->hasAttributeStdset() && !p->attributeStdset())
|
||||||
varNewName += language::derefPointer + "viewport()"_L1;
|
varNewName += language::derefPointer + "viewport()"_L1;
|
||||||
propertyValue = "QCursor(Qt"_L1 + language::qualifier
|
propertyValue = "QCursor(Qt"_L1 + language::qualifier + "CursorShape"_L1
|
||||||
+ p->elementCursorShape() + u')';
|
+ language::qualifier + p->elementCursorShape() + u')';
|
||||||
break;
|
break;
|
||||||
case DomProperty::Enum:
|
case DomProperty::Enum:
|
||||||
propertyValue = p->elementEnum();
|
propertyValue = p->elementEnum();
|
||||||
@ -1708,8 +1708,9 @@ static void writeIconAddFile(QTextStream &output, const QString &indent,
|
|||||||
{
|
{
|
||||||
output << indent << iconName << ".addFile("
|
output << indent << iconName << ".addFile("
|
||||||
<< language::qstring(fileName, indent) << ", QSize(), QIcon"
|
<< language::qstring(fileName, indent) << ", QSize(), QIcon"
|
||||||
<< language::qualifier << mode << ", QIcon" << language::qualifier
|
<< language::qualifier << "Mode" << language::qualifier << mode
|
||||||
<< state << ')' << language::eol;
|
<< ", QIcon" << language::qualifier << "State" << language::qualifier << state
|
||||||
|
<< ')' << language::eol;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Post 4.4 write resource icon
|
// Post 4.4 write resource icon
|
||||||
@ -1757,7 +1758,8 @@ static void writeIconAddPixmap(QTextStream &output, const QString &indent,
|
|||||||
const char *mode, const char *state)
|
const char *mode, const char *state)
|
||||||
{
|
{
|
||||||
output << indent << iconName << ".addPixmap(" << call << ", QIcon"
|
output << indent << iconName << ".addPixmap(" << call << ", QIcon"
|
||||||
<< language::qualifier << mode << ", QIcon" << language::qualifier
|
<< language::qualifier << "Mode" << language::qualifier << mode
|
||||||
|
<< ", QIcon" << language::qualifier << "State" << language::qualifier
|
||||||
<< state << ')' << language::eol;
|
<< state << ')' << language::eol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
fileicon = new QPushButton(Form);
|
fileicon = new QPushButton(Form);
|
||||||
fileicon->setObjectName("fileicon");
|
fileicon->setObjectName("fileicon");
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
icon.addFile(QString::fromUtf8("image1.png"), QSize(), QIcon::Normal, QIcon::Off);
|
icon.addFile(QString::fromUtf8("image1.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
fileicon->setIcon(icon);
|
fileicon->setIcon(icon);
|
||||||
|
|
||||||
verticalLayout->addWidget(fileicon);
|
verticalLayout->addWidget(fileicon);
|
||||||
@ -50,7 +50,7 @@ public:
|
|||||||
if (QIcon::hasThemeIcon(iconThemeName)) {
|
if (QIcon::hasThemeIcon(iconThemeName)) {
|
||||||
icon1 = QIcon::fromTheme(iconThemeName);
|
icon1 = QIcon::fromTheme(iconThemeName);
|
||||||
} else {
|
} else {
|
||||||
icon1.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Normal, QIcon::Off);
|
icon1.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
}
|
}
|
||||||
fileandthemeicon->setIcon(icon1);
|
fileandthemeicon->setIcon(icon1);
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ public:
|
|||||||
if (QIcon::hasThemeIcon(QIcon::ThemeIcon::EditCopy)) {
|
if (QIcon::hasThemeIcon(QIcon::ThemeIcon::EditCopy)) {
|
||||||
icon4 = QIcon::fromTheme(QIcon::ThemeIcon::EditCopy);
|
icon4 = QIcon::fromTheme(QIcon::ThemeIcon::EditCopy);
|
||||||
} else {
|
} else {
|
||||||
icon4.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Normal, QIcon::Off);
|
icon4.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
}
|
}
|
||||||
fileandthemeenum->setIcon(icon4);
|
fileandthemeenum->setIcon(icon4);
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
upButton->setObjectName("upButton");
|
upButton->setObjectName("upButton");
|
||||||
upButton->setEnabled(false);
|
upButton->setEnabled(false);
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
icon.addFile(QString::fromUtf8(":/images/up.png"), QSize(), QIcon::Normal, QIcon::Off);
|
icon.addFile(QString::fromUtf8(":/images/up.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
upButton->setIcon(icon);
|
upButton->setIcon(icon);
|
||||||
|
|
||||||
hboxLayout->addWidget(upButton);
|
hboxLayout->addWidget(upButton);
|
||||||
@ -64,7 +64,7 @@ public:
|
|||||||
downButton->setObjectName("downButton");
|
downButton->setObjectName("downButton");
|
||||||
downButton->setEnabled(false);
|
downButton->setEnabled(false);
|
||||||
QIcon icon1;
|
QIcon icon1;
|
||||||
icon1.addFile(QString::fromUtf8(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off);
|
icon1.addFile(QString::fromUtf8(":/images/down.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
downButton->setIcon(icon1);
|
downButton->setIcon(icon1);
|
||||||
|
|
||||||
hboxLayout->addWidget(downButton);
|
hboxLayout->addWidget(downButton);
|
||||||
@ -73,7 +73,7 @@ public:
|
|||||||
removeButton->setObjectName("removeButton");
|
removeButton->setObjectName("removeButton");
|
||||||
removeButton->setEnabled(false);
|
removeButton->setEnabled(false);
|
||||||
QIcon icon2;
|
QIcon icon2;
|
||||||
icon2.addFile(QString::fromUtf8(":/images/editdelete.png"), QSize(), QIcon::Normal, QIcon::Off);
|
icon2.addFile(QString::fromUtf8(":/images/editdelete.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
removeButton->setIcon(icon2);
|
removeButton->setIcon(icon2);
|
||||||
|
|
||||||
hboxLayout->addWidget(removeButton);
|
hboxLayout->addWidget(removeButton);
|
||||||
@ -82,7 +82,7 @@ public:
|
|||||||
openFileButton->setObjectName("openFileButton");
|
openFileButton->setObjectName("openFileButton");
|
||||||
openFileButton->setEnabled(true);
|
openFileButton->setEnabled(true);
|
||||||
QIcon icon3;
|
QIcon icon3;
|
||||||
icon3.addFile(QString::fromUtf8(":/images/mac/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off);
|
icon3.addFile(QString::fromUtf8(":/images/mac/fileopen.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
openFileButton->setIcon(icon3);
|
openFileButton->setIcon(icon3);
|
||||||
|
|
||||||
hboxLayout->addWidget(openFileButton);
|
hboxLayout->addWidget(openFileButton);
|
||||||
|
@ -42,10 +42,10 @@ public:
|
|||||||
pushButton = new QPushButton(Form);
|
pushButton = new QPushButton(Form);
|
||||||
pushButton->setObjectName("pushButton");
|
pushButton->setObjectName("pushButton");
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
icon.addPixmap(QPixmap(pixmapFunction("buttonIconNormalOff")), QIcon::Normal, QIcon::Off);
|
icon.addPixmap(QPixmap(pixmapFunction("buttonIconNormalOff")), QIcon::Mode::Normal, QIcon::State::Off);
|
||||||
icon.addPixmap(QPixmap(pixmapFunction("buttonIconNormalOn")), QIcon::Normal, QIcon::On);
|
icon.addPixmap(QPixmap(pixmapFunction("buttonIconNormalOn")), QIcon::Mode::Normal, QIcon::State::On);
|
||||||
icon.addPixmap(QPixmap(pixmapFunction("buttonIconDisabledOff")), QIcon::Disabled, QIcon::Off);
|
icon.addPixmap(QPixmap(pixmapFunction("buttonIconDisabledOff")), QIcon::Mode::Disabled, QIcon::State::Off);
|
||||||
icon.addPixmap(QPixmap(pixmapFunction("buttonIconDisabledOn")), QIcon::Disabled, QIcon::On);
|
icon.addPixmap(QPixmap(pixmapFunction("buttonIconDisabledOn")), QIcon::Mode::Disabled, QIcon::State::On);
|
||||||
pushButton->setIcon(icon);
|
pushButton->setIcon(icon);
|
||||||
|
|
||||||
verticalLayout->addWidget(pushButton);
|
verticalLayout->addWidget(pushButton);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user