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. How do I run a program in QT creator?
Forum Updated to NodeBB v4.3 + New Features

How do I run a program in QT creator?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 2 Posters 1.1k Views
  • 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.
  • D Offline
    D Offline
    DavidIT
    wrote on last edited by
    #1

    Installed the QT creator program Now, first of all, I'm just trying to run the first code through QML: main.qml:

    import QtQuick 2.12
    import QtQuick.Window 2.12
    Window {
        id: root
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
        Tile {
            width: root.width / 4
            height: root.height / 4
        }
    }
    

    Tile.qml:

    import QtQuick 2.0 Rectangle { id: root color: "lightgreen" radius: 10 border.color: "black" border.width: 1 Text { id: _firstText anchors.centerIn: root text: "1" font { pointSize: Math.min(root.width, root.height) / 3 bold: true } } }
    

    Gives the following error:

    Project ERROR: Unknown module(s) in QT: quick
    

    And the second code through the console application: main.cpp:

    #include <iostream>
    using namespace std;
    int main() {
        cout << "Hello wolrd" << endl;
        return 0;
    }
    

    Gives the following error:

    13:23:56: Starting /home/IK@rt.ru/Рабочий стол/Hello/git/Cpp/Test2/build-Test-Desktop-Debug/Test ...
    13:23:56: An unknown error in the process occurred.
    13:23:56: Cannot start the terminal emulator "xterm", change the setting in the Environment options.
    13:23:56: /home/IK@rt.ru/Рабочий стол/Hello/git/Cpp/Test2/build-Test-Desktop-Debug/Test exited with code -1
    

    What to do? everything was running great on windows

    jsulmJ 1 Reply Last reply
    0
    • D DavidIT

      Installed the QT creator program Now, first of all, I'm just trying to run the first code through QML: main.qml:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      Window {
          id: root
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
          Tile {
              width: root.width / 4
              height: root.height / 4
          }
      }
      

      Tile.qml:

      import QtQuick 2.0 Rectangle { id: root color: "lightgreen" radius: 10 border.color: "black" border.width: 1 Text { id: _firstText anchors.centerIn: root text: "1" font { pointSize: Math.min(root.width, root.height) / 3 bold: true } } }
      

      Gives the following error:

      Project ERROR: Unknown module(s) in QT: quick
      

      And the second code through the console application: main.cpp:

      #include <iostream>
      using namespace std;
      int main() {
          cout << "Hello wolrd" << endl;
          return 0;
      }
      

      Gives the following error:

      13:23:56: Starting /home/IK@rt.ru/Рабочий стол/Hello/git/Cpp/Test2/build-Test-Desktop-Debug/Test ...
      13:23:56: An unknown error in the process occurred.
      13:23:56: Cannot start the terminal emulator "xterm", change the setting in the Environment options.
      13:23:56: /home/IK@rt.ru/Рабочий стол/Hello/git/Cpp/Test2/build-Test-Desktop-Debug/Test exited with code -1
      

      What to do? everything was running great on windows

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @DavidIT said in How do I run a program in QT creator?:

      Installed the QT creator program

      Did you also install Qt? If so how and which modules?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • jsulmJ jsulm

        @DavidIT said in How do I run a program in QT creator?:

        Installed the QT creator program

        Did you also install Qt? If so how and which modules?

        D Offline
        D Offline
        DavidIT
        wrote on last edited by
        #3

        @jsulm said in How do I run a program in QT creator?:

        Did you also install Qt? If so how and which modules?

        I have so far installed only this command in Linux RED hat 8.

        dnf install qt-creator
        

        I haven't installed any modules yet. And if necessary, which modules should be installed?

        jsulmJ 1 Reply Last reply
        0
        • D DavidIT

          @jsulm said in How do I run a program in QT creator?:

          Did you also install Qt? If so how and which modules?

          I have so far installed only this command in Linux RED hat 8.

          dnf install qt-creator
          

          I haven't installed any modules yet. And if necessary, which modules should be installed?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @DavidIT QtCreator is just an IDE.
          If you want to use Qt you have to install it first.
          Which modules to install depends on what you need and how Qt is packaged by your Linux distribution.
          From your code you at least need QtQuick module.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DavidIT
            wrote on last edited by
            #5

            @jsulm said in How do I run a program in QT creator?:

            QtQuick

            On the command line, he writes that qt5-qtquickcontrols is already installed

            jsulmJ 1 Reply Last reply
            0
            • D DavidIT

              @jsulm said in How do I run a program in QT creator?:

              QtQuick

              On the command line, he writes that qt5-qtquickcontrols is already installed

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @DavidIT Please check what other Qt packages your Linux distribution provides.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DavidIT
                wrote on last edited by
                #7

                @jsulm said in How do I run a program in QT creator?:

                Please check what other Qt packages your Linux distribution provides.

                dnf list | grep qtquick

                qt5-qtquickcontrols.x86_64 5.15.1-1.el7 @base
                kqtquickcharts.i686 19.12.1-1.el7 base
                kqtquickcharts.x86_64 19.12.1-1.el7 base
                qt5-qtquick1.i686 5.7.1-2.2bc722agit.el7 base
                qt5-qtquick1.x86_64 5.7.1-2.2bc722agit.el7 base
                qt5-qtquick1-devel.i686 5.7.1-2.2bc722agit.el7 base
                qt5-qtquick1-devel.x86_64 5.7.1-2.2bc722agit.el7 base
                qt5-qtquick1-examples.i686 5.7.1-2.2bc722agit.el7 base
                qt5-qtquick1-examples.x86_64 5.7.1-2.2bc722agit.el7 base
                qt5-qtquickcontrols.i686 5.15.1-1.el7 base
                qt5-qtquickcontrols-doc.noarch 5.9.2-2.el7 base
                qt5-qtquickcontrols-examples.i686 5.15.1-1.el7 base
                qt5-qtquickcontrols-examples.x86_64 5.15.1-1.el7 base
                qt5-qtquickcontrols2.i686 5.15.1-1.el7 base
                qt5-qtquickcontrols2.x86_64 5.15.1-1.el7 base
                qt5-qtquickcontrols2-devel.i686 5.15.1-1.el7 base
                qt5-qtquickcontrols2-devel.x86_64 5.15.1-1.el7 base
                qt5-qtquickcontrols2-doc.noarch 5.9.2-2.el7 base
                qt5-qtquickcontrols2-examples.i686 5.15.1-1.el7 base
                qt5-qtquickcontrols2-examples.x86_64 5.15.1-1.el7 base

                jsulmJ 1 Reply Last reply
                0
                • D DavidIT

                  @jsulm said in How do I run a program in QT creator?:

                  Please check what other Qt packages your Linux distribution provides.

                  dnf list | grep qtquick

                  qt5-qtquickcontrols.x86_64 5.15.1-1.el7 @base
                  kqtquickcharts.i686 19.12.1-1.el7 base
                  kqtquickcharts.x86_64 19.12.1-1.el7 base
                  qt5-qtquick1.i686 5.7.1-2.2bc722agit.el7 base
                  qt5-qtquick1.x86_64 5.7.1-2.2bc722agit.el7 base
                  qt5-qtquick1-devel.i686 5.7.1-2.2bc722agit.el7 base
                  qt5-qtquick1-devel.x86_64 5.7.1-2.2bc722agit.el7 base
                  qt5-qtquick1-examples.i686 5.7.1-2.2bc722agit.el7 base
                  qt5-qtquick1-examples.x86_64 5.7.1-2.2bc722agit.el7 base
                  qt5-qtquickcontrols.i686 5.15.1-1.el7 base
                  qt5-qtquickcontrols-doc.noarch 5.9.2-2.el7 base
                  qt5-qtquickcontrols-examples.i686 5.15.1-1.el7 base
                  qt5-qtquickcontrols-examples.x86_64 5.15.1-1.el7 base
                  qt5-qtquickcontrols2.i686 5.15.1-1.el7 base
                  qt5-qtquickcontrols2.x86_64 5.15.1-1.el7 base
                  qt5-qtquickcontrols2-devel.i686 5.15.1-1.el7 base
                  qt5-qtquickcontrols2-devel.x86_64 5.15.1-1.el7 base
                  qt5-qtquickcontrols2-doc.noarch 5.9.2-2.el7 base
                  qt5-qtquickcontrols2-examples.i686 5.15.1-1.el7 base
                  qt5-qtquickcontrols2-examples.x86_64 5.15.1-1.el7 base

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @DavidIT said in How do I run a program in QT creator?:

                  qt5-qtquick1

                  I guess this one and the corresponding devel package.
                  Maybe you also should install qt5-qtquickcontrols2 and the corresponding devel package?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DavidIT
                    wrote on last edited by
                    #9

                    @DavidIT said in How do I run a program in QT creator?:

                    qt5-qtquickcontrols2.

                    Installed what you wrote. it helped, thank you

                    1 Reply Last reply
                    1

                    • Login

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