Solved What's wrong with sample codes at Qt tutorial?
-
Taking sample programs from tutorials to build is my constant way to learn a new language. I got some trouble when learning Qt from tutorials in such way. For example, I got 'no such 'unknown type name --- QPushButton at sample program in https://doc.qt.io/archives/qt-4.8/gettingstartedqt.html
Another case, the first line, 'import QtQuick 1.0' was rejected when I used command:
qmlscene hello.qml
, where hello.qml is as in https://doc.qt.io/archives/qt-4.8/qml-tutorial1.htmlMy installed Qt version is 5.11. How can I conquer such version issues?
-
@Stan-Huang
there have been major changes between Qt4 and Qt5 so not everything will be 1:1 possible in qt5 as it was in qt4. But it's usually easy enough to adjust qt4 code in a reasonable time frame.for your case, simply use the qt5 equivalent of the pages for example:
-