summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/uic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/uic/uic.cpp')
-rw-r--r--src/tools/uic/uic.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp
index 9c61ae4778..fb0a37d21d 100644
--- a/src/tools/uic/uic.cpp
+++ b/src/tools/uic/uic.cpp
@@ -38,9 +38,10 @@ bool Uic::printDependencies()
QString fileName = opt.inputFile;
QFile f;
- if (fileName.isEmpty())
- f.open(stdin, QIODevice::ReadOnly);
- else {
+ if (fileName.isEmpty()) {
+ if (!f.open(stdin, QIODevice::ReadOnly))
+ return false;
+ } else {
f.setFileName(fileName);
if (!f.open(QIODevice::ReadOnly))
return false;
@@ -146,7 +147,7 @@ void Uic::writeCopyrightHeaderPython(const DomUI *ui) const
static double versionFromUiAttribute(QXmlStreamReader &reader)
{
const QXmlStreamAttributes attributes = reader.attributes();
- const QString versionAttribute = "version"_L1;
+ const auto versionAttribute = "version"_L1;
if (!attributes.hasAttribute(versionAttribute))
return 4.0;
const QStringView version = attributes.value(versionAttribute);
@@ -157,7 +158,7 @@ DomUI *Uic::parseUiFile(QXmlStreamReader &reader)
{
DomUI *ui = nullptr;
- const QString uiElement = "ui"_L1;
+ const auto uiElement = "ui"_L1;
while (!reader.atEnd()) {
if (reader.readNext() == QXmlStreamReader::StartElement) {
if (reader.name().compare(uiElement, Qt::CaseInsensitive) == 0
@@ -291,9 +292,9 @@ void Uic::writeHeaderProtectionEnd()
bool Uic::isButton(const QString &className) const
{
static const QStringList buttons = {
- "QRadioButton"_L1, "QToolButton"_L1,
- "QCheckBox"_L1, "QPushButton"_L1,
- "QCommandLinkButton"_L1
+ u"QRadioButton"_s, u"QToolButton"_s,
+ u"QCheckBox"_s, u"QPushButton"_s,
+ u"QCommandLinkButton"_s
};
return customWidgetsInfo()->extendsOneOf(className, buttons);
}
@@ -301,10 +302,10 @@ bool Uic::isButton(const QString &className) const
bool Uic::isContainer(const QString &className) const
{
static const QStringList containers = {
- "QStackedWidget"_L1, "QToolBox"_L1,
- "QTabWidget"_L1, "QScrollArea"_L1,
- "QMdiArea"_L1, "QWizard"_L1,
- "QDockWidget"_L1
+ u"QStackedWidget"_s, u"QToolBox"_s,
+ u"QTabWidget"_s, u"QScrollArea"_s,
+ u"QMdiArea"_s, u"QWizard"_s,
+ u"QDockWidget"_s
};
return customWidgetsInfo()->extendsOneOf(className, containers);
@@ -313,7 +314,7 @@ bool Uic::isContainer(const QString &className) const
bool Uic::isMenu(const QString &className) const
{
static const QStringList menus = {
- "QMenu"_L1, "QPopupMenu"_L1
+ u"QMenu"_s, u"QPopupMenu"_s
};
return customWidgetsInfo()->extendsOneOf(className, menus);
}