Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to send args to Qt Application from Qt Creator
QtWS25 Last Chance

How to send args to Qt Application from Qt Creator

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 4 Posters 930 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.
  • J Offline
    J Offline
    JacobNovitsky
    wrote on last edited by JacobNovitsky
    #1

    Using Qt Creator for my Qt&C++ app.
    I use Ctrl + R to build and run my app, it opens in Gnome Terminal (Ubuntu 20)
    I need to send args before I call Ctrl + R, without re-writing any variables
    Is there any kind of feature in Qt creator?

    Other question:
    after I reinstall OS and Qt, if I have one terminal instance open and I'm trying to Ctrl + R to build and open new terminal it stops previous process and prints:

    qtc.process_stub: Control socket error: QLocalSocket::PeerClosedError
    Press <RETURN> to close this window...

    Tried to look to settings, but there is no obvious solution

    It also gets to non-responding state from time to time

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Is there any kind of feature in Qt creator?

      a3bf610d-0437-4b97-8ae3-53154138f563-image.png

      J 1 Reply Last reply
      4
      • C ChrisW67

        Is there any kind of feature in Qt creator?

        a3bf610d-0437-4b97-8ae3-53154138f563-image.png

        J Offline
        J Offline
        JacobNovitsky
        wrote on last edited by
        #3

        @ChrisW67 yes, getting test:test in first line of terminal
        how to manage it?

        JonBJ 1 Reply Last reply
        0
        • J JacobNovitsky

          @ChrisW67 yes, getting test:test in first line of terminal
          how to manage it?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @JacobNovitsky
          Creator/Qt does not output anything to the terminal/standard output. Maybe you output test:test from your code?

          For your questions about running two instances I see no problem under Ubuntu 22.04. Whether my application has Run in terminal or not. Don't know exactly what you are doing when you see your error. Why do you need to start a new instance/terminal when you have a previous one still running/open anyway?

          J 1 Reply Last reply
          1
          • JonBJ JonB

            @JacobNovitsky
            Creator/Qt does not output anything to the terminal/standard output. Maybe you output test:test from your code?

            For your questions about running two instances I see no problem under Ubuntu 22.04. Whether my application has Run in terminal or not. Don't know exactly what you are doing when you see your error. Why do you need to start a new instance/terminal when you have a previous one still running/open anyway?

            J Offline
            J Offline
            JacobNovitsky
            wrote on last edited by
            #5

            @JonB I need to send some args when calling Qt from cmd as per below:

            ~/Qt/Tools/QtCreator/bin/qtcreator /home/supernova/App/CMakeLists.txt
            how to do the same?

            JonBJ 1 Reply Last reply
            0
            • J JacobNovitsky

              @JonB I need to send some args when calling Qt from cmd as per below:

              ~/Qt/Tools/QtCreator/bin/qtcreator /home/supernova/App/CMakeLists.txt
              how to do the same?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @JacobNovitsky
              You can only do that when first launching the application. Nothing to do with running multiple copies. You can specify command line arguments for you app from Qt Creator as @ChrisW67 showed you. Don't know what your issue is.

              J 1 Reply Last reply
              0
              • JonBJ JonB

                @JacobNovitsky
                You can only do that when first launching the application. Nothing to do with running multiple copies. You can specify command line arguments for you app from Qt Creator as @ChrisW67 showed you. Don't know what your issue is.

                J Offline
                J Offline
                JacobNovitsky
                wrote on last edited by
                #7

                @JonB solved, ./ProjectName a b c

                C 1 Reply Last reply
                1
                • J JacobNovitsky

                  @JonB solved, ./ProjectName a b c

                  C Offline
                  C Offline
                  CompSciDude
                  wrote on last edited by
                  #8

                  @JacobNovitsky That is how you would run it from the Terminal, not Qt Creator. In Qt Creator, you pass arguments to the application via the Command line arguments line edit in Run Settings under the Projects tab.

                  1 Reply Last reply
                  1
                  • aha_1980A aha_1980 has marked this topic as solved on

                  • Login

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