qtチュートリアル
ぼちぼちQtを覚えていこうと思う。しかしQtチュートリアル(日本語)の最初のサンプルコードをビルドした所いきなり以下のエラーを食らった。
error: 'class QApplication' has no member named 'setMainWidget'
調べてみるとQApplication::setMainWidget()はQt3系の関数でQt4系では撤廃されたそうだ。チュートリアルのしょっぱなからバージョン互換性の罠があるとはQt恐るべし。
- Porting to Qt 4: Qt4系のコード体系の変更点が記載されている。
- Qt-interest Archive: 今回のエラーの件についてのメモ
- Qt4.3 Tutorial: 本家のチュートリアル。こちらを参照すべし
I tried to build the first code of Qt but I got an above error. There is a version dependency in the first code in the tutorial. I haven't thought that there is such a change in a frequently used code.