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
Forum Updated to NodeBB v4.3 + New Features

How to send args to Qt Application from Qt Creator

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 4 Posters 969 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 19 Aug 2023, 05:29 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 19 Aug 2023, 06:03 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 19 Aug 2023, 06:30
      4
      • C ChrisW67
        19 Aug 2023, 06:03

        Is there any kind of feature in Qt creator?

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

        J Offline
        J Offline
        JacobNovitsky
        wrote on 19 Aug 2023, 06:30 last edited by
        #3

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

        J 1 Reply Last reply 19 Aug 2023, 07:49
        0
        • J JacobNovitsky
          19 Aug 2023, 06:30

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

          J Offline
          J Offline
          JonB
          wrote on 19 Aug 2023, 07:49 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 5 Sept 2023, 01:58
          1
          • J JonB
            19 Aug 2023, 07:49

            @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 5 Sept 2023, 01:58 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?

            J 1 Reply Last reply 5 Sept 2023, 07:37
            0
            • J JacobNovitsky
              5 Sept 2023, 01:58

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

              J Offline
              J Offline
              JonB
              wrote on 5 Sept 2023, 07:37 last edited by JonB 9 May 2023, 07:38
              #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 6 Sept 2023, 10:48
              0
              • J JonB
                5 Sept 2023, 07:37

                @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 6 Sept 2023, 10:48 last edited by
                #7

                @JonB solved, ./ProjectName a b c

                C 1 Reply Last reply 7 Sept 2023, 01:24
                1
                • J JacobNovitsky
                  6 Sept 2023, 10:48

                  @JonB solved, ./ProjectName a b c

                  C Offline
                  C Offline
                  CompSciDude
                  wrote on 7 Sept 2023, 01:24 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
                  • A aha_1980 has marked this topic as solved on 24 Dec 2023, 05:14

                  • Login

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