From c1fa3751453dd9abcb30bb5b64c406a6183ca8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Mon, 25 May 2020 16:59:19 +0300 Subject: [PATCH] add dynamic language change support add "en" ts --- qad/application/aboutwindow.cpp | 1 + qad/application/emainwindow.cpp | 16 + qad/application/emainwindow.h | 1 + qad/application/etabwidget.cpp | 12 + qad/application/etabwidget.h | 1 + qad/application/historyview.cpp | 13 + qad/application/historyview.h | 1 + qad/application/lang/qad_application_en.ts | 105 ++++ qad/application/lang/qad_application_ru.ts | 2 +- qad/application/lang/update.bat | 1 + qad/application/ribbon.cpp | 12 + qad/application/ribbon.h | 1 + qad/blockview/blockeditor.cpp | 21 +- qad/blockview/blockeditor.h | 1 + qad/blockview/drawtools.cpp | 61 +- qad/blockview/drawtools.h | 7 +- qad/blockview/lang/qad_blockview_en.ts | 383 ++++++++++++ qad/blockview/lang/qad_blockview_ru.ts | 74 ++- qad/blockview/lang/update.bat | 1 + qad/graphic/graphic.cpp | 2 +- qad/graphic/graphic_conf.cpp | 2 +- qad/graphic/lang/qad_graphic_en.ts | 387 ++++++++++++ qad/graphic/lang/qad_graphic_ru.ts | 10 +- qad/graphic/lang/update.bat | 1 + qad/sql_table/lang/qad_sql_table_en.ts | 54 ++ qad/sql_table/lang/update.bat | 1 + qad/sql_table/sql_table_widget.cpp | 13 + qad/sql_table/sql_table_widget.h | 1 + qad/widgets/chardialog.cpp | 2 +- qad/widgets/clineedit.cpp | 2 +- qad/widgets/colorbutton.cpp | 20 +- qad/widgets/colorbutton.h | 2 + qad/widgets/ecombobox.cpp | 14 + qad/widgets/ecombobox.h | 2 + qad/widgets/evalspinbox.cpp | 2 +- qad/widgets/lang/qad_widgets_en.ts | 677 +++++++++++++++++++++ qad/widgets/lang/qad_widgets_ru.ts | 198 +++--- qad/widgets/lang/update.bat | 1 + qad/widgets/matrixedit.cpp | 12 + qad/widgets/matrixedit.h | 1 + qad/widgets/qcodeedit.cpp | 13 + qad/widgets/qcodeedit.h | 1 + qad/widgets/qpiconfigwidget.cpp | 26 +- qad/widgets/qpointedit.cpp | 2 +- qad/widgets/qrectedit.cpp | 2 +- qad/widgets/qvariantedit.cpp | 4 +- qad/widgets/shortcuts.cpp | 2 + qglview/globject_editor.cpp | 1 - qglview/material_editor.cpp | 1 - qglview/material_map_editor.cpp | 1 - 50 files changed, 1965 insertions(+), 206 deletions(-) create mode 100644 qad/application/lang/qad_application_en.ts create mode 100644 qad/blockview/lang/qad_blockview_en.ts create mode 100644 qad/graphic/lang/qad_graphic_en.ts create mode 100644 qad/sql_table/lang/qad_sql_table_en.ts create mode 100644 qad/widgets/lang/qad_widgets_en.ts diff --git a/qad/application/aboutwindow.cpp b/qad/application/aboutwindow.cpp index 49d605a..14169de 100644 --- a/qad/application/aboutwindow.cpp +++ b/qad/application/aboutwindow.cpp @@ -154,6 +154,7 @@ void AboutWindow::changeEvent(QEvent *e) { switch (e->type()) { case QEvent::LanguageChange: ui->retranslateUi(this); + setWindowTitle(QApplication::applicationName() + " - " + tr("About")); break; case QEvent::FontChange: case QEvent::Polish: diff --git a/qad/application/emainwindow.cpp b/qad/application/emainwindow.cpp index 9196281..4bd3da6 100644 --- a/qad/application/emainwindow.cpp +++ b/qad/application/emainwindow.cpp @@ -119,6 +119,22 @@ void EMainWindow::timerEvent(QTimerEvent * e) { } +void EMainWindow::changeEvent(QEvent * e) { + QMainWindow::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + action_show_all_tools.setText(tr("Show all")); + action_show_all_docks.setText(tr("Show all")); + action_hide_all_tools.setText(tr("Hide all")); + action_hide_all_docks.setText(tr("Hide all")); + action_clear_recent->setText(tr("Clear recent list")); + break; + default: + break; + } +} + + QMenu * EMainWindow::createPopupMenu() { QMenu * menuPopup = new QMenu; QWidgetAction * wa; diff --git a/qad/application/emainwindow.h b/qad/application/emainwindow.h index abce86f..87faa61 100644 --- a/qad/application/emainwindow.h +++ b/qad/application/emainwindow.h @@ -92,6 +92,7 @@ protected: void closeEvent(QCloseEvent * ); bool eventFilter(QObject * o, QEvent * e); void timerEvent(QTimerEvent * e); + void changeEvent(QEvent * e); QMenu * createPopupMenu(); void addToRecent(const QString & path); void prepareRecent(); diff --git a/qad/application/etabwidget.cpp b/qad/application/etabwidget.cpp index 4da9dc3..437409f 100644 --- a/qad/application/etabwidget.cpp +++ b/qad/application/etabwidget.cpp @@ -91,6 +91,18 @@ bool ETabWidget::eventFilter(QObject * o, QEvent * e) { } +void ETabWidget::changeEvent(QEvent * e) { + QTabWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + retranslate(); + break; + default: + break; + } +} + + void ETabWidget::buttonClicked() { QToolButton * s = qobject_cast(sender()); if (s == 0) return; diff --git a/qad/application/etabwidget.h b/qad/application/etabwidget.h index 3296251..bf0346d 100644 --- a/qad/application/etabwidget.h +++ b/qad/application/etabwidget.h @@ -49,6 +49,7 @@ private: bool eventFilter(QObject * o, QEvent * e); void tabInserted(int) {emit countChanged();} void tabRemoved(int) {emit countChanged();} + void changeEvent(QEvent * e); struct TabButton { TabButton(int r, const QIcon & i, const QString & t) {role = r; icon = i; visible = true; srcToolTip = t; toolTip = QApplication::translate("MainWindow", t.toUtf8(), 0/*, QCoreApplication::UnicodeUTF8*/);} diff --git a/qad/application/historyview.cpp b/qad/application/historyview.cpp index 2e13223..1be0263 100644 --- a/qad/application/historyview.cpp +++ b/qad/application/historyview.cpp @@ -1,4 +1,5 @@ #include "historyview.h" +#include HistoryView::HistoryView(QWidget* parent): QListWidget(parent) { @@ -89,6 +90,18 @@ void HistoryView::checkLimit() { } +void HistoryView::changeEvent(QEvent * e) { + QListWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + actions_[-1].text = tr("History cleared"); + break; + default: + break; + } +} + + void HistoryView::itemClicked(QListWidgetItem * item) { if (!active_) return; if (index == row(item) + 1) return; diff --git a/qad/application/historyview.h b/qad/application/historyview.h index 9634bb6..f46d0a4 100644 --- a/qad/application/historyview.h +++ b/qad/application/historyview.h @@ -65,6 +65,7 @@ private: }; void checkLimit(); + void changeEvent(QEvent * e); QString actionText(int action, int count_); QMap actions_; diff --git a/qad/application/lang/qad_application_en.ts b/qad/application/lang/qad_application_en.ts new file mode 100644 index 0000000..0027b17 --- /dev/null +++ b/qad/application/lang/qad_application_en.ts @@ -0,0 +1,105 @@ + + + + + AboutWindow + + + - About + + + + + Versions + + + + + Build + + + + + Authors + + + + + About Qt... + + + + + OK + + + + + About + + + + + EMainWindow + + + Clear recent list + + + + + + Show all + + + + + + Hide all + + + + + Toolbars + + + + + Docks + + + + + Select file to open + + + + + Select files to open + + + + + Save changes%1? + + + + + in + + + + + Select file to save + + + + + HistoryView + + + History cleared + + + + diff --git a/qad/application/lang/qad_application_ru.ts b/qad/application/lang/qad_application_ru.ts index ea95b5e..eaa3765 100644 --- a/qad/application/lang/qad_application_ru.ts +++ b/qad/application/lang/qad_application_ru.ts @@ -31,7 +31,7 @@ OK - + diff --git a/qad/application/lang/update.bat b/qad/application/lang/update.bat index d67bb8b..34f3eee 100644 --- a/qad/application/lang/update.bat +++ b/qad/application/lang/update.bat @@ -1 +1,2 @@ lupdate ../ -ts qad_application_ru.ts +lupdate ../ -ts qad_application_en.ts diff --git a/qad/application/ribbon.cpp b/qad/application/ribbon.cpp index d8664e1..a17ad7d 100644 --- a/qad/application/ribbon.cpp +++ b/qad/application/ribbon.cpp @@ -49,6 +49,18 @@ void Ribbon::timerEvent(QTimerEvent * e) { } +void Ribbon::changeEvent(QEvent * e) { + QToolBar::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + retranslate(); + break; + default: + break; + } +} + + void Ribbon::_resize() { return; // WARNING for (int i = 0; i < tab->count(); ++i) { diff --git a/qad/application/ribbon.h b/qad/application/ribbon.h index 8d2de58..d189e72 100644 --- a/qad/application/ribbon.h +++ b/qad/application/ribbon.h @@ -54,6 +54,7 @@ public: private: bool eventFilter(QObject * o, QEvent * e); void timerEvent(QTimerEvent * e); + void changeEvent(QEvent *e); void _resize(); void _setIconsSize(); diff --git a/qad/blockview/blockeditor.cpp b/qad/blockview/blockeditor.cpp index f2fa148..0bbdbf3 100644 --- a/qad/blockview/blockeditor.cpp +++ b/qad/blockview/blockeditor.cpp @@ -173,6 +173,17 @@ bool BlockEditor::eventFilter(QObject *o, QEvent *e) { } +void BlockEditor::changeEvent(QEvent * e) { + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: break; + } +} + + void BlockEditor::on_actionRemove_items_triggered() { QList si = ui->blockView->scene()->selectedItems(); foreach (QGraphicsItem * i, si) @@ -342,12 +353,12 @@ QWidget * PinAlignDelegate::createEditor(QWidget * parent, const QStyleOptionVie QString PinAlignDelegate::displayText(const QVariant & value, const QLocale & locale) const { int cv = value.toInt(); switch (cv) { - case Qt::AlignLeft: return "Left"; break; - case Qt::AlignRight: return "Right"; break; - case Qt::AlignTop: return "Top"; break; - case Qt::AlignBottom: return "Bottom"; break; + case Qt::AlignLeft: return tr("Left"); break; + case Qt::AlignRight: return tr("Right"); break; + case Qt::AlignTop: return tr("Top"); break; + case Qt::AlignBottom: return tr("Bottom"); break; } - return "unknown"; + return tr("unknown"); } diff --git a/qad/blockview/blockeditor.h b/qad/blockview/blockeditor.h index e380e48..5342bcb 100644 --- a/qad/blockview/blockeditor.h +++ b/qad/blockview/blockeditor.h @@ -71,6 +71,7 @@ private slots: private: bool eventFilter(QObject * o, QEvent * e); + void changeEvent(QEvent * e); Ui::BlockEditor *ui; QMap pin_tli; diff --git a/qad/blockview/drawtools.cpp b/qad/blockview/drawtools.cpp index 01631ea..0e6abe3 100644 --- a/qad/blockview/drawtools.cpp +++ b/qad/blockview/drawtools.cpp @@ -225,7 +225,7 @@ bool _DTSizeItem::sceneEventFilter(QGraphicsItem * watched, QEvent * event) { -DrawTools::DrawTools(BlockView * parent): QObject(parent), +DrawTools::DrawTools(BlockView * parent): QWidget(parent), actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(this) { widget_props = new QWidget(); ui = new Ui::DrawTools(); @@ -238,9 +238,6 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom( int fh = qMax(QApplication::fontMetrics().size(0, "0").height(), 22); int thick = lineThickness(); QSize sz(fh * 2.5, fh); - QStringList styles; - styles << tr("NoPen") << tr("Solid") << tr("Dash") - << tr("Dot") << tr("Dash-Dot") << tr("Dash-Dot-Dot"); ui->comboLineStyle->setIconSize(sz); for (int i = 0; i < 6; i++) { QPixmap pix(sz); @@ -249,7 +246,7 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom( p.setPen(QPen(Qt::black, thick, (Qt::PenStyle)i)); p.drawLine(0, pix.height() / 2, pix.width(), pix.height() / 2); p.end(); - ui->comboLineStyle->addItem(QIcon(pix), styles[i]); + ui->comboLineStyle->addItem(QIcon(pix), ""); } #ifdef Q_OS_MACOS setAlignCompact(true); @@ -264,22 +261,21 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom( new_item = cur_item = 0; view_ = 0; resize_enabled = true; - text_dlg.setWindowTitle(tr("Edit text")); text_dlg.setLayout(new QBoxLayout(QBoxLayout::TopToBottom)); QDialogButtonBox * bbox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel); connect(bbox, SIGNAL(accepted()), &text_dlg, SLOT(accept())); connect(bbox, SIGNAL(rejected()), &text_dlg, SLOT(reject())); text_dlg.layout()->addWidget(&text_edit); text_dlg.layout()->addWidget(bbox); - actions_Z_up.setText(tr("Bring\nforward")); actions_Z_up.setIcon(QIcon(":/icons/z-up.png")); actions_Z_up.setEnabled(false); - actions_Z_top.setText(tr("Bring\nto front")); actions_Z_top.setIcon(QIcon(":/icons/z-top.png")); actions_Z_top.setEnabled(false); - actions_Z_down.setText(tr("Send\nbackward")); actions_Z_down.setIcon(QIcon(":/icons/z-down.png")); actions_Z_down.setEnabled(false); - actions_Z_bottom.setText(tr("Send\nto back")); actions_Z_bottom.setIcon(QIcon(":/icons/z-bottom.png")); actions_Z_bottom.setEnabled(false); - actions_add << newAction(tr("Draw\nRectangle"), QIcon(":/icons/draw-rectangle.png"), 1) - << newAction(tr("Draw\nEllipse"), QIcon(":/icons/draw-ellipse.png"), 2) - << newAction(tr("Draw\nLine"), QIcon(":/icons/draw-line.png"), 4) - << newAction(tr("Draw\nText"), QIcon(":/icons/draw-text.png"), 0) - << newAction(tr("Draw\nImage"), QIcon(":/icons/view-preview.png"), 3); + actions_Z_up.setIcon(QIcon(":/icons/z-up.png")); actions_Z_up.setEnabled(false); + actions_Z_top.setIcon(QIcon(":/icons/z-top.png")); actions_Z_top.setEnabled(false); + actions_Z_down.setIcon(QIcon(":/icons/z-down.png")); actions_Z_down.setEnabled(false); + actions_Z_bottom.setIcon(QIcon(":/icons/z-bottom.png")); actions_Z_bottom.setEnabled(false); + actions_add << newAction(QIcon(":/icons/draw-rectangle.png"), 1) + << newAction(QIcon(":/icons/draw-ellipse.png"), 2) + << newAction(QIcon(":/icons/draw-line.png"), 4) + << newAction(QIcon(":/icons/draw-text.png"), 0) + << newAction(QIcon(":/icons/view-preview.png"), 3); buttons_align << ui->buttonAlignTL << ui->buttonAlignTC << ui->buttonAlignTR << ui->buttonAlignCL << ui->buttonAlignCC << ui->buttonAlignCR << ui->buttonAlignBL << ui->buttonAlignBC << ui->buttonAlignBR; @@ -321,6 +317,7 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom( connect(&actions_Z_down, SIGNAL(triggered(bool)), this, SLOT(actionZ_triggered())); connect(&actions_Z_bottom, SIGNAL(triggered(bool)), this, SLOT(actionZ_triggered())); setBlockView(parent); + retranslate(); } @@ -331,6 +328,24 @@ DrawTools::~DrawTools() { } +void DrawTools::retranslate() { + QStringList styles; + styles << tr("NoPen") << tr("Solid") << tr("Dash") + << tr("Dot") << tr("Dash-Dot") << tr("Dash-Dot-Dot"); + for (int i = 0; i < styles.size(); i++) ui->comboLineStyle->setItemText(i, styles[i]); + text_dlg.setWindowTitle(tr("Edit text")); + actions_Z_up.setText(tr("Bring\nforward")); + actions_Z_top.setText(tr("Bring\nto front")); + actions_Z_down.setText(tr("Send\nbackward")); + actions_Z_bottom.setText(tr("Send\nto back")); + actions_add[0]->setText(tr("Draw\nRectangle")); + actions_add[1]->setText(tr("Draw\nEllipse")); + actions_add[2]->setText(tr("Draw\nLine")); + actions_add[3]->setText(tr("Draw\nText")); + actions_add[4]->setText(tr("Draw\nImage")); +} + + void DrawTools::setBlockView(BlockView * v) { if (view_) view_->viewport()->removeEventFilter(this); disconnect(this, SLOT(selectionChanged())); @@ -454,6 +469,18 @@ bool DrawTools::eventFilter(QObject * o, QEvent * e) { } +void DrawTools::changeEvent(QEvent * e) { + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + retranslate(); + break; + default: break; + } +} + + QComboBox * DrawTools::textEditCombo() const { return ui->comboText; } @@ -468,8 +495,8 @@ void DrawTools::changeEvent(QEvent * e) { } */ -QAction * DrawTools::newAction(const QString & text, const QIcon & icon, int type) { - QAction * ret = new QAction(icon, text, this); +QAction * DrawTools::newAction(const QIcon & icon, int type) { + QAction * ret = new QAction(icon, QString(), this); ret->setCheckable(true); ret->setData(type); return ret; diff --git a/qad/blockview/drawtools.h b/qad/blockview/drawtools.h index a0f0042..51e8db9 100644 --- a/qad/blockview/drawtools.h +++ b/qad/blockview/drawtools.h @@ -72,7 +72,7 @@ namespace Ui { } -class QAD_EXPORT DrawTools: public QObject +class QAD_EXPORT DrawTools: public QWidget { Q_OBJECT Q_PROPERTY(bool resizeHandlesEnabled READ isResizeHandlesEnabled WRITE setResizeHandlesEnabled) @@ -92,8 +92,9 @@ public: protected: bool eventFilter(QObject * o, QEvent * e); + void changeEvent(QEvent * e); - QAction * newAction(const QString & text, const QIcon & icon, int type); + QAction * newAction(const QIcon & icon, int type); void setToolButtonsEnabled(bool pen, bool brush, bool wid_hei); void blockPropSignals(bool block_); void actionAlignTrigger(bool vert, Qt::AlignmentFlag value); @@ -150,6 +151,8 @@ signals: void itemEdited(QGraphicsItem * item); void itemZChanged(QGraphicsItem * item); +private: + void retranslate(); }; diff --git a/qad/blockview/lang/qad_blockview_en.ts b/qad/blockview/lang/qad_blockview_en.ts new file mode 100644 index 0000000..a8abcb3 --- /dev/null +++ b/qad/blockview/lang/qad_blockview_en.ts @@ -0,0 +1,383 @@ + + + + + BlockBusItem + + + Add point: Ctrl + LeftClick +Remove point\segment: Ctrl + RightClick +New branch: Shift + LeftClick +Remove connection: Shift + RightClick + + + + + BlockEditor + + + Block editor + + + + + Block parameters + + + + + Width: + + + + + Heigth: + + + + + Pins margin: + + + + + Color: + + + + + Pins + + + + + Name + + + + + Bus + + + + + Add + + + + + Clone + + + + + Remove selected + + + + + Remove all + + + + + Save + + + + + + Ctrl+S + + + + + Save as ... + + + + + Load ... + + + + + Ctrl+O + + + + + Clear + + + + + Remove items + + + + + Del + + + + + DrawTools + + + Form + + + + + Font ... + + + + + Text: + + + + + + Edit text ... + + + + + + + Align center left + + + + + Align center + + + + + Align center right + + + + + Align top right + + + + + Align bottom right + + + + + Align bottom center + + + + + Align top left + + + + + Align top center + + + + + Align bottom left + + + + + Width: + + + + + Thickness: + + + + + Height: + + + + + Style: + + + + + Load image ... + + + + + Paste image ... + + + + + Scale: + + + + + Top + + + + + + + + Center + + + + + + Bottom + + + + + + Left + + + + + + Right + + + + + NoPen + + + + + Solid + + + + + Dash + + + + + Dot + + + + + Dash-Dot + + + + + Dash-Dot-Dot + + + + + Edit text + + + + + Bring +forward + + + + + Bring +to front + + + + + Send +backward + + + + + Send +to back + + + + + Draw +Rectangle + + + + + Draw +Ellipse + + + + + Draw +Line + + + + + Draw +Text + + + + + Draw +Image + + + + + Select image + + + + + PinAlignDelegate + + + Left + + + + + Right + + + + + Top + + + + + Bottom + + + + + unknown + + + + diff --git a/qad/blockview/lang/qad_blockview_ru.ts b/qad/blockview/lang/qad_blockview_ru.ts index 4be20eb..9a7ecdc 100644 --- a/qad/blockview/lang/qad_blockview_ru.ts +++ b/qad/blockview/lang/qad_blockview_ru.ts @@ -20,7 +20,7 @@ Remove connection: Shift + RightClick Block editor - + Редактор блока @@ -91,7 +91,7 @@ Remove connection: Shift + RightClick Ctrl+S - + @@ -106,7 +106,7 @@ Remove connection: Shift + RightClick Ctrl+O - + @@ -121,7 +121,7 @@ Remove connection: Shift + RightClick Del - + @@ -214,7 +214,7 @@ Remove connection: Shift + RightClick Высота: - + Style: Стиль: @@ -226,7 +226,7 @@ Remove connection: Shift + RightClick Paste image ... - + Вставить картинку ... @@ -265,107 +265,135 @@ Remove connection: Shift + RightClick Право - + NoPen НетЛинии - + Solid Сплошная - + Dash Штриховая - + Dot Пунктирная - + Dash-Dot ШтрихПунктирная - + Dash-Dot-Dot ШтрихПунктирПунктирная - + Edit text Редактировать текст - + Bring forward Переместить выше - + Bring to front На передний фон - + Send backward Переместить ниже - + Send to back На задний фон - + Draw Rectangle Нарисовать прямоугольник - + Draw Ellipse Нарисовать эллипс - + Draw Line Нарисовать линию - + Draw Text Нарисовать текст - + Draw Image Нарисовать картинку - + Select image Выбрать картинку + + PinAlignDelegate + + + Left + Лево + + + + Right + Право + + + + Top + Верх + + + + Bottom + Низ + + + + unknown + неизвестно + + diff --git a/qad/blockview/lang/update.bat b/qad/blockview/lang/update.bat index c157fce..0ac75d0 100644 --- a/qad/blockview/lang/update.bat +++ b/qad/blockview/lang/update.bat @@ -1 +1,2 @@ lupdate ../ -ts qad_blockview_ru.ts +lupdate ../ -ts qad_blockview_en.ts diff --git a/qad/graphic/graphic.cpp b/qad/graphic/graphic.cpp index 8fd8530..a6ceb83 100644 --- a/qad/graphic/graphic.cpp +++ b/qad/graphic/graphic.cpp @@ -140,11 +140,11 @@ Graphic::~Graphic() { void Graphic::changeEvent(QEvent * e) { + QFrame::changeEvent(e); if (e->type() == QEvent::LanguageChange) { ui->retranslateUi(this); return; } - QFrame::changeEvent(e); } diff --git a/qad/graphic/graphic_conf.cpp b/qad/graphic/graphic_conf.cpp index 265e64f..d497251 100644 --- a/qad/graphic/graphic_conf.cpp +++ b/qad/graphic/graphic_conf.cpp @@ -29,11 +29,11 @@ GraphicConf::GraphicConf(QVector & graphics_, QWidget * parent): QD void GraphicConf::changeEvent(QEvent * e) { + QDialog::changeEvent(e); if (e->type() == QEvent::LanguageChange) { ui->retranslateUi(this); return; } - QDialog::changeEvent(e); } diff --git a/qad/graphic/lang/qad_graphic_en.ts b/qad/graphic/lang/qad_graphic_en.ts new file mode 100644 index 0000000..32f57ad --- /dev/null +++ b/qad/graphic/lang/qad_graphic_en.ts @@ -0,0 +1,387 @@ + + + + + Graphic + + + Autofit + + + + + Grid + + + + + Cursor axis + + + + + Only expand Y + + + + + Only expand X + + + + + Fullscreen + + + + + Border inputs + + + + + Legend + + + + + Pause + + + + + Configure ... + + + + + Save image ... + + + + + Clear + + + + + Close + + + + + Cursor: ( ; ) + + + + + + Cursor: + + + + + Selection + + + + + Size + + + + + + Range + + + + + + Length + + + + + + Cursor + + + + + Save Image + + + + + y(x) + + + + + Check all + + + + + GraphicConf + + + Graphic parameters + + + + + Appearance + + + + + Border inputs + + + + + Antialiasing + + + + + Status bar + + + + + OpenGL + + + + + Legend + + + + + Background color: + + + + + Text color: + + + + + Graphics + + + + + + Color: + + + + + + Style: + + + + + Lines width: + + + + + Points width: + + + + + Fill: + + + + + Grid + + + + + Width: + + + + + Step X: + + + + + Step Y: + + + + + Auto X + + + + + Auto Y + + + + + + 30 + + + + + + 50 + + + + + Margins + + + + + + + + + px + + + + + All: + + + + + Right: + + + + + Left: + + + + + Bottom: + + + + + Top: + + + + + NoPen + + + + + Solid + + + + + Dash + + + + + Dot + + + + + Dash-Dot + + + + + Dash-Dot-Dot + + + + + MainWindow + + + QPICalculator + + + + + Calculator + + + + + Expression + + + + + Result + + + + + Correct + + + + + + 0 + + + + + Variables + + + + + Name + + + + + Value + + + + + + Del + + + + + Graphics + + + + + On + + + + + Function + + + + diff --git a/qad/graphic/lang/qad_graphic_ru.ts b/qad/graphic/lang/qad_graphic_ru.ts index 0faf829..4c1209f 100644 --- a/qad/graphic/lang/qad_graphic_ru.ts +++ b/qad/graphic/lang/qad_graphic_ru.ts @@ -236,13 +236,13 @@ 30 - + 50 - + Auto step @@ -323,7 +323,7 @@ QPICalculator - + Калькулятор @@ -349,7 +349,7 @@ 0 - + @@ -370,7 +370,7 @@ Del - + diff --git a/qad/graphic/lang/update.bat b/qad/graphic/lang/update.bat index 0500d56..3b281f7 100644 --- a/qad/graphic/lang/update.bat +++ b/qad/graphic/lang/update.bat @@ -1 +1,2 @@ lupdate ../ -ts qad_graphic_ru.ts +lupdate ../ -ts qad_graphic_en.ts diff --git a/qad/sql_table/lang/qad_sql_table_en.ts b/qad/sql_table/lang/qad_sql_table_en.ts new file mode 100644 index 0000000..1506e1f --- /dev/null +++ b/qad/sql_table/lang/qad_sql_table_en.ts @@ -0,0 +1,54 @@ + + + + + SQLTableWidget + + + SQLTableWidget + + + + + Table doesn`t exists! + + + + + Add record + + + + + Configure filters + + + + + Clear + + + + + + Operator AND + + + + + + Operator OR + + + + + Remove selected + + + + + Table "%1" doesn`t exists! + + + + diff --git a/qad/sql_table/lang/update.bat b/qad/sql_table/lang/update.bat index ab17807..b0d78e5 100644 --- a/qad/sql_table/lang/update.bat +++ b/qad/sql_table/lang/update.bat @@ -1 +1,2 @@ lupdate ../ -ts qad_sql_table_ru.ts +lupdate ../ -ts qad_sql_table_en.ts diff --git a/qad/sql_table/sql_table_widget.cpp b/qad/sql_table/sql_table_widget.cpp index 7aae643..9503ee6 100644 --- a/qad/sql_table/sql_table_widget.cpp +++ b/qad/sql_table/sql_table_widget.cpp @@ -443,6 +443,19 @@ void SQLTableWidget::timerEvent(QTimerEvent * ) { } +void SQLTableWidget::changeEvent(QEvent * e) { + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + action_del->setText(tr("Remove selected")); + break; + default: + break; + } +} + + void SQLTableWidget::setTableName(const QString & t) { ui->labelEmpty->setText(tr("Table \"%1\" doesn`t exists!").arg(t)); stopTimer(); diff --git a/qad/sql_table/sql_table_widget.h b/qad/sql_table/sql_table_widget.h index 0a858b2..1bf1ced 100644 --- a/qad/sql_table/sql_table_widget.h +++ b/qad/sql_table/sql_table_widget.h @@ -282,6 +282,7 @@ private: bool eventFilter(QObject * o, QEvent * e); void timerEvent(QTimerEvent * ); + void changeEvent(QEvent * e); void stopTimer() {if (timer != 0) killTimer(timer); timer = 0;} bool checkTable(); QStringList getTableColumns(const QString & t); diff --git a/qad/widgets/chardialog.cpp b/qad/widgets/chardialog.cpp index 992564f..5c255c0 100644 --- a/qad/widgets/chardialog.cpp +++ b/qad/widgets/chardialog.cpp @@ -48,6 +48,7 @@ void CharDialog::setCharFont(const QFont & f) { void CharDialog::changeEvent(QEvent * e) { + QDialog::changeEvent(e); if (e->type() == QEvent::LanguageChange) { ui->retranslateUi(this); QStringList cat; @@ -65,7 +66,6 @@ void CharDialog::changeEvent(QEvent * e) { ui->comboCategory->setCurrentIndex(pi); return; } - QDialog::changeEvent(e); } diff --git a/qad/widgets/clineedit.cpp b/qad/widgets/clineedit.cpp index bf0845c..fc2ef3e 100644 --- a/qad/widgets/clineedit.cpp +++ b/qad/widgets/clineedit.cpp @@ -40,11 +40,11 @@ void CLineEdit::resizeEvent(QResizeEvent * e) { void CLineEdit::changeEvent(QEvent * e) { + QLineEdit::changeEvent(e); if (e->type() == QEvent::LanguageChange) { cw->setToolTip(tr("Clear")); return; } - QLineEdit::changeEvent(e); } diff --git a/qad/widgets/colorbutton.cpp b/qad/widgets/colorbutton.cpp index 215a05f..42aac1d 100644 --- a/qad/widgets/colorbutton.cpp +++ b/qad/widgets/colorbutton.cpp @@ -17,10 +17,10 @@ ColorButton::ColorButton(QWidget * parent): QPushButton(parent) { label->setFrameStyle(QFrame::Panel | QFrame::Sunken); label->show(); pal = label->palette(); - menu.addAction(QIcon(":/icons/edit-copy.png"), tr("Copy"), this, SLOT(copy())); - menu.addAction(QIcon(":/icons/edit-paste.png"), tr("Paste"), this, SLOT(paste())); + a_copy = menu.addAction(QIcon(":/icons/edit-copy.png"), tr("Copy"), this, SLOT(copy())); + a_paste = menu.addAction(QIcon(":/icons/edit-paste.png"), tr("Paste"), this, SLOT(paste())); menu.addSeparator(); - menu.addAction(tr("Mix with clipboard"), this, SLOT(mix())); + a_mix = menu.addAction(tr("Mix with clipboard"), this, SLOT(mix())); setAcceptDrops(true); connect(this, SIGNAL(clicked(bool)), this, SLOT(clicked())); } @@ -86,6 +86,20 @@ void ColorButton::dropEvent(QDropEvent * e) { } +void ColorButton::changeEvent(QEvent * e) { + QPushButton::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + a_copy->setText(tr("Copy")); + a_paste->setText(tr("Paste")); + a_mix->setText(tr("Mix with clipboard")); + break; + default: + break; + } +} + + void ColorButton::clicked() { QColor ret = QColorDialog::getColor(color(), this, tr("Choose color"), options); if (!ret.isValid()) return; diff --git a/qad/widgets/colorbutton.h b/qad/widgets/colorbutton.h index 826ba0c..1b73324 100644 --- a/qad/widgets/colorbutton.h +++ b/qad/widgets/colorbutton.h @@ -60,9 +60,11 @@ private: void resizeEvent(QResizeEvent * ); void dragEnterEvent(QDragEnterEvent * e); void dropEvent(QDropEvent * e); + void changeEvent(QEvent *e); QFrame * label; QWidget * back; + QAction * a_copy, * a_paste, * a_mix; QPalette pal; QPoint pp; QMenu menu; diff --git a/qad/widgets/ecombobox.cpp b/qad/widgets/ecombobox.cpp index db2f316..546dfc6 100644 --- a/qad/widgets/ecombobox.cpp +++ b/qad/widgets/ecombobox.cpp @@ -72,6 +72,20 @@ void EComboBox::showPopup() { } +void EComboBox::changeEvent(QEvent * e) { + QComboBox::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: +#if QT_VERSION >= 0x040700 + filter.setPlaceholderText(tr("Filter")); +#endif + break; + default: + break; + } +} + + void EComboBox::filterChanged(const QString & text, bool first) { if (filter.text().isEmpty()) filter.setFont(ifont); else filter.setFont(nfont); diff --git a/qad/widgets/ecombobox.h b/qad/widgets/ecombobox.h index f96ef5e..7f5c6e6 100644 --- a/qad/widgets/ecombobox.h +++ b/qad/widgets/ecombobox.h @@ -39,6 +39,8 @@ public slots: virtual void showPopup(); private: + void changeEvent(QEvent *e); + QTreeView iv; QWidget header; QLabel icon; diff --git a/qad/widgets/evalspinbox.cpp b/qad/widgets/evalspinbox.cpp index 1c0d76a..28324c5 100644 --- a/qad/widgets/evalspinbox.cpp +++ b/qad/widgets/evalspinbox.cpp @@ -88,11 +88,11 @@ void EvalSpinBox::resizeEvent(QResizeEvent * e) { void EvalSpinBox::changeEvent(QEvent * e) { + QAbstractSpinBox::changeEvent(e); if (e->type() == QEvent::LanguageChange) { cw->setToolTip(tr("Clear")); return; } - QAbstractSpinBox::changeEvent(e); } diff --git a/qad/widgets/lang/qad_widgets_en.ts b/qad/widgets/lang/qad_widgets_en.ts new file mode 100644 index 0000000..0bf28b5 --- /dev/null +++ b/qad/widgets/lang/qad_widgets_en.ts @@ -0,0 +1,677 @@ + + + + + CLineEdit + + + + Clear + + + + + CharDialog + + + Choose symbol + + + + + + No Category + + + + + + Mark NonSpacing + + + + + + Mark SpacingCombining + + + + + + Mark Enclosing + + + + + + Number DecimalDigit + + + + + + Number Letter + + + + + + Number Other + + + + + + Separator Space + + + + + + Separator Line + + + + + + Separator Paragraph + + + + + + Other Control + + + + + + Other Format + + + + + + Other Surrogate + + + + + + Other PrivateUse + + + + + + Other NotAssigned + + + + + + Letter Uppercase + + + + + + Letter Lowercase + + + + + + Letter Titlecase + + + + + + Letter Modifier + + + + + + Letter Other + + + + + + Punctuation Connector + + + + + + Punctuation Dash + + + + + + Punctuation Open + + + + + + Punctuation Close + + + + + + Punctuation InitialQuote + + + + + + Punctuation FinalQuote + + + + + + Punctuation Other + + + + + + Symbol Math + + + + + + Symbol Currency + + + + + + Symbol Modifier + + + + + + Symbol Other + + + + + ColorButton + + + + Copy + + + + + + Paste + + + + + + Mix with clipboard + + + + + Choose color + + + + + EComboBox + + + + Filter + + + + + EvalSpinBox + + + + Clear + + + + + MatrixEdit + + + Cols: + + + + + Rows: + + + + + Null + + + + + 0 + + + + + Identity + + + + + I + + + + + PathEdit + + + All files(*) + + + + + + Choose + + + + + Select directory + + + + + Select file + + + + + QCodeEdit + + + Search: + + + + + Case sensitive + + + + + Aa + + + + + Whole words + + + + + W + + + + + Previous + + + + + Next + + + + + Replace: + + + + + Replace + + + + + R + + + + + Replace and search + + + + + Rs + + + + + Replace all + + + + + Ra + + + + + + Press F1 for details + + + + + QPIConfigNewDialog + + + Dialog + + + + + Type + + + + + string + + + + + s + + + + + integer + + + + + n + + + + + float + + + + + f + + + + + string list + + + + + l + + + + + boolean + + + + + b + + + + + color + + + + + c + + + + + rectangle + + + + + r + + + + + area + + + + + a + + + + + point + + + + + p + + + + + vector + + + + + v + + + + + ip + + + + + i + + + + + Name: + + + + + Comment: + + + + + Value: + + + + + QPIConfigWidget + + + Name + + + + + Value + + + + + Type + + + + + Comment + + + + + Add item ... + + + + + Add node ... + + + + + Convert to item + + + + + Convert to node + + + + + Remove + + + + + Expand all + + + + + Collapse all + + + + + QPointEdit + + + + X + + + + + + Y + + + + + QRectEdit + + + + X + + + + + + Y + + + + + + Height + + + + + + Width + + + + + QVariantEdit + + + Invalid value + + + + + ScrollSpinBox + + + Grab and scroll + + + + + Shortcuts + + + + Command + + + + + + Shortcut + + + + + StringListEdit + + + + Add + + + + + + Remove + + + + + + Clear + + + + diff --git a/qad/widgets/lang/qad_widgets_ru.ts b/qad/widgets/lang/qad_widgets_ru.ts index 6af567c..e933d26 100644 --- a/qad/widgets/lang/qad_widgets_ru.ts +++ b/qad/widgets/lang/qad_widgets_ru.ts @@ -5,7 +5,7 @@ CLineEdit - + Clear Сбросить @@ -19,187 +19,187 @@ - + No Category Вне категории - + Mark NonSpacing - + Mark SpacingCombining - + Mark Enclosing - + Number DecimalDigit - + Number Letter - + Number Other - + Separator Space - + Separator Line - + Separator Paragraph - + Other Control - + Other Format - + Other Surrogate - + Other PrivateUse - + Other NotAssigned - + Letter Uppercase - + Letter Lowercase - + Letter Titlecase - + Letter Modifier - + Letter Other - + Punctuation Connector - + Punctuation Dash - + Punctuation Open - + Punctuation Close - + Punctuation InitialQuote - + Punctuation FinalQuote - + Punctuation Other - + Symbol Math - + Symbol Currency - + Symbol Modifier - + Symbol Other @@ -208,21 +208,24 @@ ColorButton + Copy Копировать + Paste Вставить + Mix with clipboard Смешать со скопированным - + Choose color Выбрать цвет @@ -231,6 +234,7 @@ EComboBox + Filter Фильтр @@ -239,7 +243,7 @@ EvalSpinBox - + Clear Очистить @@ -249,12 +253,12 @@ Cols: - + Колонки: Rows: - + Строки: @@ -264,7 +268,7 @@ 0 - + @@ -274,7 +278,7 @@ I - + @@ -286,7 +290,7 @@ - + Choose Выберите @@ -305,6 +309,7 @@ QCodeEdit + Press F1 for details Нажмите F1 для справочной информации @@ -321,7 +326,7 @@ Aa - + Аа @@ -389,7 +394,7 @@ Type - Тип + Тип @@ -504,128 +509,73 @@ Name: - + Имя: Comment: - + Комментарий: Value: - + Значение: QPIConfigWidget - + Name Имя - + Value Значение - + Type Тип - + Comment Описание - - - string - - - - - string list - - - - - integer - - - - - float - - - - - boolean - - - - - color - - - - - rectangle - - - - - area - - - - - point - - - vector - + Add item ... + Добавить поле ... - ip - + Add node ... + Добавить секцию ... - Add item ... - + Convert to item + Преобразовать в значение - Add node ... - + Convert to node + Преобразовать в секцию - Convert to item - - - - - Convert to node - - - - Remove Удалить - + Expand all Свернуть все - + Collapse all Развернуть все @@ -634,13 +584,13 @@ QPointEdit - + X - + Y @@ -649,25 +599,25 @@ QRectEdit - + X - + Y - + Height Высота - + Width Ширина @@ -692,13 +642,13 @@ Shortcuts - + Command Команда - + Shortcut Горячая клавиша @@ -707,19 +657,19 @@ StringListEdit - + Add Добавить - + Remove Удалить - + Clear Очистить diff --git a/qad/widgets/lang/update.bat b/qad/widgets/lang/update.bat index d54631f..e456a60 100644 --- a/qad/widgets/lang/update.bat +++ b/qad/widgets/lang/update.bat @@ -1 +1,2 @@ lupdate ../ -ts qad_widgets_ru.ts +lupdate ../ -ts qad_widgets_en.ts diff --git a/qad/widgets/matrixedit.cpp b/qad/widgets/matrixedit.cpp index bed96f2..da8e502 100644 --- a/qad/widgets/matrixedit.cpp +++ b/qad/widgets/matrixedit.cpp @@ -52,6 +52,18 @@ void MatrixEdit::clear(bool ident) { } +void MatrixEdit::changeEvent(QEvent * e) { + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + + QVector MatrixEdit::vector() const { QVector ret; if (ui->table->columnCount() < 1) return ret; diff --git a/qad/widgets/matrixedit.h b/qad/widgets/matrixedit.h index ed5d08d..53af595 100644 --- a/qad/widgets/matrixedit.h +++ b/qad/widgets/matrixedit.h @@ -46,6 +46,7 @@ public: private: void setVectorMode(bool yes); void clear(bool ident = false); + void changeEvent(QEvent * e); Ui::MatrixEdit * ui; bool ro; diff --git a/qad/widgets/qcodeedit.cpp b/qad/widgets/qcodeedit.cpp index d9ae230..4c72bf4 100644 --- a/qad/widgets/qcodeedit.cpp +++ b/qad/widgets/qcodeedit.cpp @@ -562,6 +562,19 @@ void QCodeEdit::leaveEvent(QEvent * e) { } +void QCodeEdit::changeEvent(QEvent * e) { + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + lbl_help[1]->setText(tr("Press F1 for details")); + break; + default: + break; + } +} + + char antiBracket(char c) { switch (c) { case '(': return ')'; diff --git a/qad/widgets/qcodeedit.h b/qad/widgets/qcodeedit.h index f4bcdfb..6b437c3 100644 --- a/qad/widgets/qcodeedit.h +++ b/qad/widgets/qcodeedit.h @@ -115,6 +115,7 @@ private: void showEvent(QShowEvent * ); void timerEvent(QTimerEvent * ); void leaveEvent(QEvent * ); + void changeEvent(QEvent * e); void highlightBrackets(); void applyExtraSelection(); void nextCompletition(); diff --git a/qad/widgets/qpiconfigwidget.cpp b/qad/widgets/qpiconfigwidget.cpp index 22cabd1..dfb1ad7 100644 --- a/qad/widgets/qpiconfigwidget.cpp +++ b/qad/widgets/qpiconfigwidget.cpp @@ -46,13 +46,11 @@ QPIConfigWidget::QPIConfigWidget(QWidget * parent, QPIConfig * c, bool on): QTre void QPIConfigWidget::changeEvent(QEvent * e) { + QTreeWidget::changeEvent(e); if (e->type() == QEvent::LanguageChange) { translate(); return; } - //for (int i = 0; i < 4; ++i) - // setColumnHidden(i, c_hidden[i]); - QTreeWidget::changeEvent(e); } @@ -342,17 +340,17 @@ void QPIConfigWidget::translate() { if (active) setHeaderLabels(l); types.clear(); s_types.clear(); - addTrEntry("s", tr("string")); - addTrEntry("l", tr("string list")); - addTrEntry("n", tr("integer")); - addTrEntry("f", tr("float")); - addTrEntry("b", tr("boolean")); - addTrEntry("c", tr("color")); - addTrEntry("r", tr("rectangle")); - addTrEntry("a", tr("area")); - addTrEntry("p", tr("point")); - addTrEntry("v", tr("vector")); - addTrEntry("i", tr("ip")); + addTrEntry("s", "string"); + addTrEntry("l", "string list"); + addTrEntry("n", "integer"); + addTrEntry("f", "float"); + addTrEntry("b", "boolean"); + addTrEntry("c", "color"); + addTrEntry("r", "rectangle"); + addTrEntry("a", "area"); + addTrEntry("p", "point"); + addTrEntry("v", "vector"); + addTrEntry("i", "ip"); actionAddItem.setText(tr("Add item ...")); actionAddNode.setText(tr("Add node ...")); actionToItem.setText(tr("Convert to item")); diff --git a/qad/widgets/qpointedit.cpp b/qad/widgets/qpointedit.cpp index ebd0aae..c70dc30 100644 --- a/qad/widgets/qpointedit.cpp +++ b/qad/widgets/qpointedit.cpp @@ -25,10 +25,10 @@ QPointEdit::QPointEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftT void QPointEdit::changeEvent(QEvent * e) { + QWidget::changeEvent(e); if (e->type() == QEvent::LanguageChange) { s_x->setToolTip(tr("X")); s_y->setToolTip(tr("Y")); return; } - QWidget::changeEvent(e); } diff --git a/qad/widgets/qrectedit.cpp b/qad/widgets/qrectedit.cpp index e1387a4..c823398 100644 --- a/qad/widgets/qrectedit.cpp +++ b/qad/widgets/qrectedit.cpp @@ -45,6 +45,7 @@ QRectEdit::QRectEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftToR void QRectEdit::changeEvent(QEvent * e) { + QWidget::changeEvent(e); if (e->type() == QEvent::LanguageChange) { s_x->setToolTip(tr("X")); s_y->setToolTip(tr("Y")); @@ -52,5 +53,4 @@ void QRectEdit::changeEvent(QEvent * e) { s_h->setToolTip(tr("Width")); return; } - QWidget::changeEvent(e); } diff --git a/qad/widgets/qvariantedit.cpp b/qad/widgets/qvariantedit.cpp index 42eebec..b2c01ea 100644 --- a/qad/widgets/qvariantedit.cpp +++ b/qad/widgets/qvariantedit.cpp @@ -81,13 +81,13 @@ StringListEdit::StringListEdit(QWidget * parent): QWidget(parent), lay(QBoxLayou void StringListEdit::changeEvent(QEvent * e) { + QWidget::changeEvent(e); if (e->type() == QEvent::LanguageChange) { butt_add->setToolTip(tr("Add")); butt_del->setToolTip(tr("Remove")); butt_clear->setToolTip(tr("Clear")); return; } - QWidget::changeEvent(e); } @@ -120,11 +120,11 @@ PathEdit::PathEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftToRig void PathEdit::changeEvent(QEvent * e) { + QWidget::changeEvent(e); if (e->type() == QEvent::LanguageChange) { butt_select->setToolTip(tr("Choose") + " ..."); return; } - QWidget::changeEvent(e); } diff --git a/qad/widgets/shortcuts.cpp b/qad/widgets/shortcuts.cpp index 234a637..ccb4ece 100644 --- a/qad/widgets/shortcuts.cpp +++ b/qad/widgets/shortcuts.cpp @@ -49,10 +49,12 @@ Shortcuts::~Shortcuts() { void Shortcuts::changeEvent(QEvent * e) { + QTreeWidget::changeEvent(e); if (e->type() == QEvent::LanguageChange) { QStringList l; l << tr("Command") << tr("Shortcut"); setHeaderLabels(l); + return; } } diff --git a/qglview/globject_editor.cpp b/qglview/globject_editor.cpp index 8e284c3..30263e8 100644 --- a/qglview/globject_editor.cpp +++ b/qglview/globject_editor.cpp @@ -35,7 +35,6 @@ GLObjectEditor::GLObjectEditor(QWidget * parent): QWidget(parent) { void GLObjectEditor::changeEvent(QEvent * e) { - return; QWidget::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: diff --git a/qglview/material_editor.cpp b/qglview/material_editor.cpp index 5c57b21..502a84e 100644 --- a/qglview/material_editor.cpp +++ b/qglview/material_editor.cpp @@ -29,7 +29,6 @@ MaterialEditor::MaterialEditor(QWidget * parent): QWidget(parent) { void MaterialEditor::changeEvent(QEvent * e) { - return; QWidget::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: diff --git a/qglview/material_map_editor.cpp b/qglview/material_map_editor.cpp index fecb6dd..d3e8672 100644 --- a/qglview/material_map_editor.cpp +++ b/qglview/material_map_editor.cpp @@ -28,7 +28,6 @@ MaterialMapEditor::MaterialMapEditor(QWidget * parent): QWidget(parent) { void MaterialMapEditor::changeEvent(QEvent * e) { - return; QWidget::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: