Mercurial > octave
comparison libgui/src/workspace-model.cc @ 31560:9d9b31c8458b stable
fix missing translations of workspace header
* workspace-model.cc (headerData): use tr() here again
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sun, 27 Nov 2022 11:27:40 +0100 |
parents | 796f54d4ddbf |
children | ad014fc78bd6 c6d54dd31a7e |
comparison
equal
deleted
inserted
replaced
31559:26f1ef8fa1ce | 31560:9d9b31c8458b |
---|---|
42 namespace octave | 42 namespace octave |
43 { | 43 { |
44 workspace_model::workspace_model (QObject *p) | 44 workspace_model::workspace_model (QObject *p) |
45 : QAbstractTableModel (p) | 45 : QAbstractTableModel (p) |
46 { | 46 { |
47 // The header names. Use tr () again when accessing them since | |
48 // the translator si not yet initialized when this ctor is called | |
47 m_columnNames.append (tr ("Name")); | 49 m_columnNames.append (tr ("Name")); |
48 m_columnNames.append (tr ("Class")); | 50 m_columnNames.append (tr ("Class")); |
49 m_columnNames.append (tr ("Dimension")); | 51 m_columnNames.append (tr ("Dimension")); |
50 m_columnNames.append (tr ("Value")); | 52 m_columnNames.append (tr ("Value")); |
51 m_columnNames.append (tr ("Attribute")); | 53 m_columnNames.append (tr ("Attribute")); |
90 QVariant | 92 QVariant |
91 workspace_model::headerData (int section, Qt::Orientation orientation, | 93 workspace_model::headerData (int section, Qt::Orientation orientation, |
92 int role) const | 94 int role) const |
93 { | 95 { |
94 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) | 96 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) |
95 return m_columnNames[section]; | 97 return tr (m_columnNames[section].toStdString ().data ()); |
96 else | 98 else |
97 return QVariant (); | 99 return QVariant (); |
98 } | 100 } |
99 | 101 |
100 QVariant | 102 QVariant |