From 84a164ba30ad774cc53b549832a4fc1a232681ed Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 8 Jun 2020 12:49:57 +0200 Subject: [PATCH] Qt5: 'static QString Gui::TaskView::TaskWatcherCommands::trUtf8(const char*, const char*, int)' is deprecated [-Wdeprecated-declarations] --- src/Gui/ComboView.cpp | 12 ++++++------ src/Gui/DockWindowManager.cpp | 2 +- src/Gui/PropertyView.cpp | 4 ++-- src/Gui/ReportView.cpp | 8 ++++---- src/Gui/TaskView/TaskWatcher.cpp | 2 +- src/Gui/ToolBoxManager.cpp | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Gui/ComboView.cpp b/src/Gui/ComboView.cpp index 3a2d9bac4a38..17c54f7a001d 100644 --- a/src/Gui/ComboView.cpp +++ b/src/Gui/ComboView.cpp @@ -73,16 +73,16 @@ ComboView::ComboView(bool showModel, Gui::Document* pcDocument, QWidget *parent) // property view prop = new PropertyView(this); splitter->addWidget(prop); - modelIndex = tabs->addTab(splitter,trUtf8("Model")); + modelIndex = tabs->addTab(splitter,tr("Model")); } // task panel taskPanel = new Gui::TaskView::TaskView(this); - taskIndex = tabs->addTab(taskPanel, trUtf8("Tasks")); + taskIndex = tabs->addTab(taskPanel, tr("Tasks")); // task panel //projectView = new Gui::ProjectWidget(this); - //tabs->addTab(projectView, trUtf8("Project")); + //tabs->addTab(projectView, tr("Project")); } ComboView::~ComboView() @@ -137,9 +137,9 @@ void ComboView::showTaskView() void ComboView::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { - tabs->setTabText(modelIndex, trUtf8("Model")); - tabs->setTabText(taskIndex, trUtf8("Tasks")); - //tabs->setTabText(2, trUtf8("Project")); + tabs->setTabText(modelIndex, tr("Model")); + tabs->setTabText(taskIndex, tr("Tasks")); + //tabs->setTabText(2, tr("Project")); } DockWindow::changeEvent(e); diff --git a/src/Gui/DockWindowManager.cpp b/src/Gui/DockWindowManager.cpp index 1ddc4ef5c4ef..a3b5db25abcc 100644 --- a/src/Gui/DockWindowManager.cpp +++ b/src/Gui/DockWindowManager.cpp @@ -154,7 +154,7 @@ QDockWidget* DockWindowManager::addDockWindow(const char* name, QWidget* widget, // set object name and window title needed for i18n stuff dw->setObjectName(QLatin1String(name)); - dw->setWindowTitle(QDockWidget::trUtf8(name)); + dw->setWindowTitle(QDockWidget::tr(name)); dw->setFeatures(QDockWidget::AllDockWidgetFeatures); d->_dockedWindows.push_back(dw); diff --git a/src/Gui/PropertyView.cpp b/src/Gui/PropertyView.cpp index 0e00d7bf1681..ac338f12ae5d 100644 --- a/src/Gui/PropertyView.cpp +++ b/src/Gui/PropertyView.cpp @@ -542,8 +542,8 @@ void PropertyView::tabChanged(int index) void PropertyView::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { - tabs->setTabText(0, trUtf8("View")); - tabs->setTabText(1, trUtf8("Data")); + tabs->setTabText(0, tr("View")); + tabs->setTabText(1, tr("Data")); } QWidget::changeEvent(e); diff --git a/src/Gui/ReportView.cpp b/src/Gui/ReportView.cpp index d073f551ac01..207074f7825c 100644 --- a/src/Gui/ReportView.cpp +++ b/src/Gui/ReportView.cpp @@ -70,7 +70,7 @@ ReportView::ReportView( QWidget* parent ) // create the output window tabOutput = new ReportOutput(); - tabOutput->setWindowTitle(trUtf8("Output")); + tabOutput->setWindowTitle(tr("Output")); tabOutput->setWindowIcon(BitmapFactory().pixmap("MacroEditor")); int output = tabWidget->addTab(tabOutput, tabOutput->windowTitle()); tabWidget->setTabIcon(output, tabOutput->windowIcon()); @@ -78,7 +78,7 @@ ReportView::ReportView( QWidget* parent ) // create the python console tabPython = new PythonConsole(); tabPython->setWordWrapMode(QTextOption::NoWrap); - tabPython->setWindowTitle(trUtf8("Python console")); + tabPython->setWindowTitle(tr("Python console")); tabPython->setWindowIcon(BitmapFactory().iconFromTheme("applications-python")); int python = tabWidget->addTab(tabPython, tabPython->windowTitle()); tabWidget->setTabIcon(python, tabPython->windowIcon()); @@ -102,8 +102,8 @@ void ReportView::changeEvent(QEvent *e) { QWidget::changeEvent(e); if (e->type() == QEvent::LanguageChange) { - tabOutput->setWindowTitle(trUtf8("Output")); - tabPython->setWindowTitle(trUtf8("Python console")); + tabOutput->setWindowTitle(tr("Output")); + tabPython->setWindowTitle(tr("Python console")); for (int i=0; icount();i++) tabWidget->setTabText(i, tabWidget->widget(i)->windowTitle()); } diff --git a/src/Gui/TaskView/TaskWatcher.cpp b/src/Gui/TaskView/TaskWatcher.cpp index d521ec892f1e..8785208a4241 100644 --- a/src/Gui/TaskView/TaskWatcher.cpp +++ b/src/Gui/TaskView/TaskWatcher.cpp @@ -89,7 +89,7 @@ TaskWatcherCommands::TaskWatcherCommands(const char* Filter,const char* commands if (commands) { CommandManager &mgr = Gui::Application::Instance->commandManager(); Gui::TaskView::TaskBox *tb = new Gui::TaskView::TaskBox - (BitmapFactory().pixmap(pixmap), trUtf8(name), true, 0); + (BitmapFactory().pixmap(pixmap), tr(name), true, 0); for (const char** i=commands;*i;i++) { Command *c = mgr.getCommandByName(*i); diff --git a/src/Gui/ToolBoxManager.cpp b/src/Gui/ToolBoxManager.cpp index a4cfb165bc35..78cd1c858889 100644 --- a/src/Gui/ToolBoxManager.cpp +++ b/src/Gui/ToolBoxManager.cpp @@ -90,7 +90,7 @@ void ToolBoxManager::setup( ToolBarItem* toolBar ) const bar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); std::string toolbarName = (*item)->command(); bar->setObjectName(QString::fromLatin1((*item)->command().c_str())); - bar->setWindowTitle(QObject::trUtf8(toolbarName.c_str())); // i18n + bar->setWindowTitle(QObject::tr(toolbarName.c_str())); // i18n _toolBox->addItem( bar, bar->windowTitle() ); QList subitems = (*item)->getItems(); @@ -129,7 +129,7 @@ void ToolBoxManager::retranslate() const // get always the first item widget QWidget* w = _toolBox->widget(i); QByteArray toolbarName = w->objectName().toUtf8(); - w->setWindowTitle(QObject::trUtf8(toolbarName.constData())); + w->setWindowTitle(QObject::tr(toolbarName.constData())); _toolBox->setItemText(i, w->windowTitle()); } }