Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. What's wrong with sample codes at Qt tutorial?
Qt 6.11 is out! See what's new in the release blog

What's wrong with sample codes at Qt tutorial?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 670 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Stan HuangS Offline
    Stan HuangS Offline
    Stan Huang
    wrote on last edited by
    #1

    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.html

    My installed Qt version is 5.11. How can I conquer such version issues?

    J.HilkJ 1 Reply Last reply
    0
    • Stan HuangS Stan Huang

      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.html

      My installed Qt version is 5.11. How can I conquer such version issues?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @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:

      https://doc.qt.io/qt-5/gettingstarted.html


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      Stan HuangS 1 Reply Last reply
      2
      • J.HilkJ J.Hilk

        @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:

        https://doc.qt.io/qt-5/gettingstarted.html

        Stan HuangS Offline
        Stan HuangS Offline
        Stan Huang
        wrote on last edited by
        #3

        @J.Hilk I used 'qmlscene hello.qml' and got 'qt.qpa.gl: Unable to disable rotation' response. What does it mean?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved