Changeset View
Changeset View
Standalone View
Standalone View
src/models/charactersmodel.cpp
Context not available. | |||||
28 | 28 | | |||
---|---|---|---|---|---|
29 | CharactersModel::CharactersModel(QObject *parent) : | 29 | CharactersModel::CharactersModel(QObject *parent) : | ||
30 | QAbstractTableModel(parent), | 30 | QAbstractTableModel(parent), | ||
31 | m_keyboardLayout(0), | 31 | m_keyboardLayout(nullptr), | ||
32 | m_keyIndex(-1), | 32 | m_keyIndex(-1), | ||
33 | m_key(0), | 33 | m_key(nullptr), | ||
34 | m_undoStack(0), | 34 | m_undoStack(nullptr), | ||
35 | m_signalMapper(new QSignalMapper(this)) | 35 | m_signalMapper(new QSignalMapper(this)) | ||
36 | { | 36 | { | ||
37 | connect(m_signalMapper, SIGNAL(mapped(int)), SLOT(emitCharacterChanged(int))); | 37 | connect(m_signalMapper, SIGNAL(mapped(int)), SLOT(emitCharacterChanged(int))); | ||
Context not available. | |||||
62 | if (!m_keyboardLayout) | 62 | if (!m_keyboardLayout) | ||
63 | return; | 63 | return; | ||
64 | 64 | | |||
65 | Key* key = 0; | 65 | Key* key = nullptr; | ||
66 | 66 | | |||
67 | if (keyIndex != -1) | 67 | if (keyIndex != -1) | ||
68 | { | 68 | { | ||
Context not available. | |||||
168 | return false; | 168 | return false; | ||
169 | 169 | | |||
170 | KeyChar* keyChar = m_key->keyChar(index.row()); | 170 | KeyChar* keyChar = m_key->keyChar(index.row()); | ||
171 | QUndoCommand* cmd = 0; | 171 | QUndoCommand* cmd = nullptr; | ||
172 | 172 | | |||
173 | switch (index.column()) | 173 | switch (index.column()) | ||
174 | { | 174 | { | ||
Context not available. | |||||
279 | case Qt::DisplayRole: | 279 | case Qt::DisplayRole: | ||
280 | case Qt::EditRole: | 280 | case Qt::EditRole: | ||
281 | return keyChar->value(); | 281 | return keyChar->value(); | ||
282 | return keyChar->value(); | | |||
283 | default: | 282 | default: | ||
284 | return QVariant(); | 283 | return QVariant(); | ||
285 | } | 284 | } | ||
Context not available. | |||||
315 | case KeyChar::Hidden: | 314 | case KeyChar::Hidden: | ||
316 | return i18n("Hidden"); | 315 | return i18n("Hidden"); | ||
317 | } | 316 | } | ||
317 | return QVariant(); | ||||
318 | case Qt::EditRole: | 318 | case Qt::EditRole: | ||
319 | return QVariant(keyChar->position()); | 319 | return QVariant(keyChar->position()); | ||
320 | default: | 320 | default: | ||
Context not available. |