Qt で 16 進数の文字列を int 型に変換する

方法

QString::toInt() を使う。 第 2 引数を省略すると 10 進数に変換されるので注意する。

サンプル

コード
qDebug() << QString("0x7F").toInt(0, 16);
出力
127