Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Any good QT and QML examples for newbies?
Forum Updated to NodeBB v4.3 + New Features

Any good QT and QML examples for newbies?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 2 Posters 494 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.
  • B Offline
    B Offline
    bozz
    wrote on 4 Dec 2019, 15:04 last edited by bozz 12 Apr 2019, 16:38
    #1

    Hello everyone,

    I am looking to make a QT and QML app with the following structure.
    The app will run two CLI apps in the background. I have the c++ code for both apps.

    I want to have two buttons that trigger the apps.
    I want one input box that can pass a variable to the CLI app.

    I want some text boxes that store the latest output the CLI apps return.

    Are there any good examples for complete beginners that illustrate this?
    I basically want to be able to tie up some buttons to some CLI code, in both QML and QT.

    Thank you if you can help at all

    Edit: perhaps there could be a main c++ "app" that handles the other c++ code?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 Dec 2019, 19:31 last edited by
      #2

      Hi,

      No there's no example that does exactly what you describe. However the QML book is very good source to get started.

      Then take a look at the C++ integration part and QProcess.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • B Offline
        B Offline
        bozz
        wrote on 4 Dec 2019, 22:51 last edited by bozz 12 Apr 2019, 22:52
        #3

        Thank you for the quick reply. I will do more reading into it. Thank you!

        To be more specific, my c++ "apps" are quite simple.
        One app for instance takes a command line text argument, validates the text and prints out the result at the end.

        I use "int main(int argc, char *argv[])"

        It is all very basic. I would like to have some of these basic apps run side by side in the background. Is that a big issue? Will I need to consider things like threadings and timing of the code execution?

        Also, a very big question is debugging. Can I have the "c++ apps" open in terminal output windows next to the GUI while I am developing?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Dec 2019, 23:04 last edited by
          #4

          I thought you wanted to execute these apps from within your Qt Quick based app. Is it not the case ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bozz
            wrote on 4 Dec 2019, 23:24 last edited by bozz 12 Apr 2019, 23:27
            #5

            Well yes. I want to integrate the apps and execute them from within the qt GUI.

            Edit: I am going to read up on it more. I was just thinking there might be a very newbie friendly way to do that.

            Is there an obvious way to debug an app to see what is happening "in the background"? Can I have my c++ app run in the terminal window beside the GUI just to see if everything is working as it should? The rest I will figure out myself.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 4 Dec 2019, 23:29 last edited by
              #6

              Ok, but what kind of window do you want them to open since they are console application ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bozz
                wrote on 5 Dec 2019, 07:03 last edited by bozz 12 May 2019, 07:03
                #7

                I would like to see a console next to the gui, but only during debugging

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 5 Dec 2019, 13:47 last edited by
                  #8

                  If it's only to see what your application is outputting, then you can connect the standard output and error related signals of QProcess and show the content of these two channels on a text edit control for example.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  2
                  • B Offline
                    B Offline
                    bozz
                    wrote on 5 Dec 2019, 13:57 last edited by
                    #9

                    would this show me everything print() shows?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 5 Dec 2019, 19:59 last edited by
                      #10

                      That's the goal of reading stdout

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1

                      3/10

                      4 Dec 2019, 22:51

                      topic:navigator.unread, 7
                      • Login

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