Skip to content

Commit 2174f11

Browse files
net147Friedemann Kleint
authored and
Friedemann Kleint
committed
Fix usage of deprecated QCoreApplication::translate
Based on qttools/ec87de9b8b6c7f6690f830086da542770537d4f7. Change-Id: I65fc7d5b4b00ece6dde1ec41508868749f08ec0a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
1 parent 7085546 commit 2174f11

File tree

2 files changed

+44
-48
lines changed

2 files changed

+44
-48
lines changed

qtpropertybrowser/src/qtpropertybrowserutils.cpp

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -55,44 +55,44 @@ QT_BEGIN_NAMESPACE
5555

5656
QtCursorDatabase::QtCursorDatabase()
5757
{
58-
appendCursor(Qt::ArrowCursor, QApplication::translate("QtCursorDatabase", "Arrow", 0,
59-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-arrow.png")));
60-
appendCursor(Qt::UpArrowCursor, QApplication::translate("QtCursorDatabase", "Up Arrow", 0,
61-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-uparrow.png")));
62-
appendCursor(Qt::CrossCursor, QApplication::translate("QtCursorDatabase", "Cross", 0,
63-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-cross.png")));
64-
appendCursor(Qt::WaitCursor, QApplication::translate("QtCursorDatabase", "Wait", 0,
65-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-wait.png")));
66-
appendCursor(Qt::IBeamCursor, QApplication::translate("QtCursorDatabase", "IBeam", 0,
67-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-ibeam.png")));
68-
appendCursor(Qt::SizeVerCursor, QApplication::translate("QtCursorDatabase", "Size Vertical", 0,
69-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizev.png")));
70-
appendCursor(Qt::SizeHorCursor, QApplication::translate("QtCursorDatabase", "Size Horizontal", 0,
71-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizeh.png")));
72-
appendCursor(Qt::SizeFDiagCursor, QApplication::translate("QtCursorDatabase", "Size Backslash", 0,
73-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizef.png")));
74-
appendCursor(Qt::SizeBDiagCursor, QApplication::translate("QtCursorDatabase", "Size Slash", 0,
75-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizeb.png")));
76-
appendCursor(Qt::SizeAllCursor, QApplication::translate("QtCursorDatabase", "Size All", 0,
77-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizeall.png")));
78-
appendCursor(Qt::BlankCursor, QApplication::translate("QtCursorDatabase", "Blank", 0,
79-
QApplication::UnicodeUTF8), QIcon());
80-
appendCursor(Qt::SplitVCursor, QApplication::translate("QtCursorDatabase", "Split Vertical", 0,
81-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-vsplit.png")));
82-
appendCursor(Qt::SplitHCursor, QApplication::translate("QtCursorDatabase", "Split Horizontal", 0,
83-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-hsplit.png")));
84-
appendCursor(Qt::PointingHandCursor, QApplication::translate("QtCursorDatabase", "Pointing Hand", 0,
85-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-hand.png")));
86-
appendCursor(Qt::ForbiddenCursor, QApplication::translate("QtCursorDatabase", "Forbidden", 0,
87-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-forbidden.png")));
88-
appendCursor(Qt::OpenHandCursor, QApplication::translate("QtCursorDatabase", "Open Hand", 0,
89-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-openhand.png")));
90-
appendCursor(Qt::ClosedHandCursor, QApplication::translate("QtCursorDatabase", "Closed Hand", 0,
91-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-closedhand.png")));
92-
appendCursor(Qt::WhatsThisCursor, QApplication::translate("QtCursorDatabase", "What's This", 0,
93-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-whatsthis.png")));
94-
appendCursor(Qt::BusyCursor, QApplication::translate("QtCursorDatabase", "Busy", 0,
95-
QApplication::UnicodeUTF8), QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-busy.png")));
58+
appendCursor(Qt::ArrowCursor, QCoreApplication::translate("QtCursorDatabase", "Arrow"),
59+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-arrow.png")));
60+
appendCursor(Qt::UpArrowCursor, QCoreApplication::translate("QtCursorDatabase", "Up Arrow"),
61+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-uparrow.png")));
62+
appendCursor(Qt::CrossCursor, QCoreApplication::translate("QtCursorDatabase", "Cross"),
63+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-cross.png")));
64+
appendCursor(Qt::WaitCursor, QCoreApplication::translate("QtCursorDatabase", "Wait"),
65+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-wait.png")));
66+
appendCursor(Qt::IBeamCursor, QCoreApplication::translate("QtCursorDatabase", "IBeam"),
67+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-ibeam.png")));
68+
appendCursor(Qt::SizeVerCursor, QCoreApplication::translate("QtCursorDatabase", "Size Vertical"),
69+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizev.png")));
70+
appendCursor(Qt::SizeHorCursor, QCoreApplication::translate("QtCursorDatabase", "Size Horizontal"),
71+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizeh.png")));
72+
appendCursor(Qt::SizeFDiagCursor, QCoreApplication::translate("QtCursorDatabase", "Size Backslash"),
73+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizef.png")));
74+
appendCursor(Qt::SizeBDiagCursor, QCoreApplication::translate("QtCursorDatabase", "Size Slash"),
75+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizeb.png")));
76+
appendCursor(Qt::SizeAllCursor, QCoreApplication::translate("QtCursorDatabase", "Size All"),
77+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-sizeall.png")));
78+
appendCursor(Qt::BlankCursor, QCoreApplication::translate("QtCursorDatabase", "Blank"),
79+
QIcon());
80+
appendCursor(Qt::SplitVCursor, QCoreApplication::translate("QtCursorDatabase", "Split Vertical"),
81+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-vsplit.png")));
82+
appendCursor(Qt::SplitHCursor, QCoreApplication::translate("QtCursorDatabase", "Split Horizontal"),
83+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-hsplit.png")));
84+
appendCursor(Qt::PointingHandCursor, QCoreApplication::translate("QtCursorDatabase", "Pointing Hand"),
85+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-hand.png")));
86+
appendCursor(Qt::ForbiddenCursor, QCoreApplication::translate("QtCursorDatabase", "Forbidden"),
87+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-forbidden.png")));
88+
appendCursor(Qt::OpenHandCursor, QCoreApplication::translate("QtCursorDatabase", "Open Hand"),
89+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-openhand.png")));
90+
appendCursor(Qt::ClosedHandCursor, QCoreApplication::translate("QtCursorDatabase", "Closed Hand"),
91+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-closedhand.png")));
92+
appendCursor(Qt::WhatsThisCursor, QCoreApplication::translate("QtCursorDatabase", "What's This"),
93+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-whatsthis.png")));
94+
appendCursor(Qt::BusyCursor, QCoreApplication::translate("QtCursorDatabase", "Busy"),
95+
QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/cursor-busy.png")));
9696
}
9797

9898
void QtCursorDatabase::clear()
@@ -184,11 +184,8 @@ QIcon QtPropertyBrowserUtils::brushValueIcon(const QBrush &b)
184184

185185
QString QtPropertyBrowserUtils::colorValueText(const QColor &c)
186186
{
187-
return QApplication::translate("QtPropertyBrowserUtils", "[%1, %2, %3] (%4)", 0, QApplication::UnicodeUTF8)
188-
.arg(QString::number(c.red()))
189-
.arg(QString::number(c.green()))
190-
.arg(QString::number(c.blue()))
191-
.arg(QString::number(c.alpha()));
187+
return QCoreApplication::translate("QtPropertyBrowserUtils", "[%1, %2, %3] (%4)")
188+
.arg(c.red()).arg(c.green()).arg(c.blue()).arg(c.alpha());
192189
}
193190

194191
QPixmap QtPropertyBrowserUtils::fontValuePixmap(const QFont &font)
@@ -214,9 +211,8 @@ QIcon QtPropertyBrowserUtils::fontValueIcon(const QFont &f)
214211

215212
QString QtPropertyBrowserUtils::fontValueText(const QFont &f)
216213
{
217-
return QApplication::translate("QtPropertyBrowserUtils", "[%1, %2]", 0, QApplication::UnicodeUTF8)
218-
.arg(f.family())
219-
.arg(f.pointSize());
214+
return QCoreApplication::translate("QtPropertyBrowserUtils", "[%1, %2]")
215+
.arg(f.family()).arg(f.pointSize());
220216
}
221217

222218

qtpropertybrowser/src/qttreepropertybrowser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ void QtTreePropertyBrowserPrivate::init(QWidget *parent)
474474

475475
m_treeWidget->setColumnCount(2);
476476
QStringList labels;
477-
labels.append(QApplication::translate("QtTreePropertyBrowser", "Property", 0, QApplication::UnicodeUTF8));
478-
labels.append(QApplication::translate("QtTreePropertyBrowser", "Value", 0, QApplication::UnicodeUTF8));
477+
labels.append(QCoreApplication::translate("QtTreePropertyBrowser", "Property"));
478+
labels.append(QCoreApplication::translate("QtTreePropertyBrowser", "Value"));
479479
m_treeWidget->setHeaderLabels(labels);
480480
m_treeWidget->setAlternatingRowColors(true);
481481
m_treeWidget->setEditTriggers(QAbstractItemView::EditKeyPressed);

0 commit comments

Comments
 (0)