Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Any good QT and QML examples for newbies?

    General and Desktop
    2
    10
    106
    Loading More Posts
    • 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
      bozz last edited by bozz

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 3
        • B
          bozz last edited by bozz

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • B
              bozz last edited by bozz

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • B
                  bozz last edited by bozz

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

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    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 Reply Quote 2
                    • B
                      bozz last edited by

                      would this show me everything print() shows?

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by

                        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 Reply Quote 1
                        • First post
                          Last post