Advertisement
Guest User

Untitled

a guest
May 23rd, 2020
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     QHash<QChar, QString> hash = { { L'а', ".-" }, { L'б', "-..." }, { L'в', ".--" } };
  2.     QString plainText = "абв";
  3.     QString convertedText;
  4.  
  5.     for (QChar ch : plainText)
  6.     {
  7.         convertedText += hash.find(ch).value();
  8.         // convertedText += hash[ch]; // лучше так
  9.     }
  10.  
  11.     qDebug() << convertedText;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement