Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QHash<QChar, QString> hash = { { L'а', ".-" }, { L'б', "-..." }, { L'в', ".--" } };
- QString plainText = "абв";
- QString convertedText;
- for (QChar ch : plainText)
- {
- convertedText += hash.find(ch).value();
- // convertedText += hash[ch]; // лучше так
- }
- qDebug() << convertedText;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement