Skip to content

Commit

Permalink
Qt5: 'static QString Gui::TaskView::TaskWatcherCommands::trUtf8(const…
Browse files Browse the repository at this point in the history
… char*, const char*, int)' is deprecated [-Wdeprecated-declarations]
  • Loading branch information
wwmayer committed Jun 12, 2020
1 parent da6cb8a commit 84a164b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/Gui/ComboView.cpp
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/DockWindowManager.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/PropertyView.cpp
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/Gui/ReportView.cpp
Expand Up @@ -70,15 +70,15 @@ 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());

// 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());
Expand All @@ -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; i<tabWidget->count();i++)
tabWidget->setTabText(i, tabWidget->widget(i)->windowTitle());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/TaskView/TaskWatcher.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/ToolBoxManager.cpp
Expand Up @@ -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<ToolBarItem*> subitems = (*item)->getItems();
Expand Down Expand Up @@ -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());
}
}

0 comments on commit 84a164b

Please sign in to comment.