title: Qt/C++ Convert QString to Decimal
body: <p>How Can I convert QString to decimal ?</p>
  
  <p>In C# code it look like that:</p>
  
  <pre><code>public static decimal ConvertToDecimal(string tekst, bool upperOnly)
  {
  decimal num = 0m;
  decimal num2 = 1m;
  string text = upperOnly ? "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" : "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234";
  int i = tekst.Length - 1;
  while (i &gt;= 0)
  {
      num += text.IndexOf(tekst[i]) * num2;
      i--;
      num2 *= text.Length;
  }
  return num;
  }
  </code></pre>