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

passing multiple options to qterminal

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 750 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on 19 Sept 2022, 14:10 last edited by
    #1
       Could somebody please verify my code ?
    

    I am trying to instruct qterminal to execute "bluetoothctl help".
    I cannot get expected result , actually no results at all.
    And no errors either.

    Reading qterminal manual does no tell how to pass "options" to the command , hence I may be
    coding something which cannot be done by qterminal.

    Thanks

        processTERMINAL = new QProcess();
        QString exec = "qterminal";
        QStringList params;
    

    this works as expected
    / params = QStringList()<<"-e"<<"bluetoothctl";

    this does not
    params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << "help";

         qDebug() <<"params " << params;
    

    // processTERMINAL->start(exec,QStringList()<<arguments);

         processTERMINAL->start(exec,params);
        if(processTERMINAL->waitForStarted())
    
    J 1 Reply Last reply 19 Sept 2022, 14:13
    0
    • A Anonymous_Banned275
      19 Sept 2022, 14:10
         Could somebody please verify my code ?
      

      I am trying to instruct qterminal to execute "bluetoothctl help".
      I cannot get expected result , actually no results at all.
      And no errors either.

      Reading qterminal manual does no tell how to pass "options" to the command , hence I may be
      coding something which cannot be done by qterminal.

      Thanks

          processTERMINAL = new QProcess();
          QString exec = "qterminal";
          QStringList params;
      

      this works as expected
      / params = QStringList()<<"-e"<<"bluetoothctl";

      this does not
      params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << "help";

           qDebug() <<"params " << params;
      

      // processTERMINAL->start(exec,QStringList()<<arguments);

           processTERMINAL->start(exec,params);
          if(processTERMINAL->waitForStarted())
      
      J Offline
      J Offline
      JonB
      wrote on 19 Sept 2022, 14:13 last edited by JonB
      #2

      @AnneRanch

      I am trying to instruct qterminal to execute "bluetoothctl help".

      Presumably you want

      params = QStringList()<<"-e"<<"bluetoothctl help";
      
      A 1 Reply Last reply 19 Sept 2022, 16:17
      0
      • J JonB
        19 Sept 2022, 14:13

        @AnneRanch

        I am trying to instruct qterminal to execute "bluetoothctl help".

        Presumably you want

        params = QStringList()<<"-e"<<"bluetoothctl help";
        
        A Offline
        A Offline
        Anonymous_Banned275
        wrote on 19 Sept 2022, 16:17 last edited by
        #3

        @JonB Yes, your assumption is correct ...and it does not work ,,,been there , done that

        J 1 Reply Last reply 19 Sept 2022, 16:50
        0
        • A Anonymous_Banned275
          19 Sept 2022, 16:17

          @JonB Yes, your assumption is correct ...and it does not work ,,,been there , done that

          J Offline
          J Offline
          JonB
          wrote on 19 Sept 2022, 16:50 last edited by
          #4

          @AnneRanch
          Guessing from https://github.com/lxqt/qterminal/blob/master/src/main.cpp, either

          params = QStringList()<<"-e"<<"bluetoothctl help";
          params = QStringList()<<"-e"<<"bluetoothctl" << "help";
          

          may work just as well, because the author likes the latter. So long as you have tried both those it's not your command-line that is at issue.

          A 1 Reply Last reply 19 Sept 2022, 17:56
          1
          • J JonB
            19 Sept 2022, 16:50

            @AnneRanch
            Guessing from https://github.com/lxqt/qterminal/blob/master/src/main.cpp, either

            params = QStringList()<<"-e"<<"bluetoothctl help";
            params = QStringList()<<"-e"<<"bluetoothctl" << "help";
            

            may work just as well, because the author likes the latter. So long as you have tried both those it's not your command-line that is at issue.

            A Offline
            A Offline
            Anonymous_Banned275
            wrote on 19 Sept 2022, 17:56 last edited by
            #5

            @JonB said in passing multiple options to qterminal:

            params = QStringList()<<"-e"<<"bluetoothctl help";
            params = QStringList()<<"-e"<<"bluetoothctl" << "help";

            These are all of my attempts to make it work...
            What is really frustrating - there are no progress / error codes -
            the QProcess starts but there is obviously no execution of the arguments...

               params = QStringList()<<"-e"<<"bluetoothctl";
                //params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << " help";
                //params = QStringList()<<"-e"<<"bluetoothctl help";
                //params = QStringList()<<"-e"<<"bluetoothctl" << "help";
            

            I did post my inquiry in "qterminal" forum - waiting for reply....
            Irregardless if I can make it work - I am still working on how to actually access the "window "
            created . Again - most people expect to have single process question and this is not
            a single issue - it has to be solved as a collection of systems / processes etc.

            And I am reluctant to post in half a dozed forums just to solve ONE process.
            .

            J 1 Reply Last reply 19 Sept 2022, 19:14
            0
            • M Offline
              M Offline
              mchinand
              wrote on 19 Sept 2022, 19:12 last edited by mchinand
              #6

              Does it work when just calling it from the command line?

              qterminal -e bluetoothctl help

              A 1 Reply Last reply 19 Sept 2022, 23:54
              1
              • A Anonymous_Banned275
                19 Sept 2022, 17:56

                @JonB said in passing multiple options to qterminal:

                params = QStringList()<<"-e"<<"bluetoothctl help";
                params = QStringList()<<"-e"<<"bluetoothctl" << "help";

                These are all of my attempts to make it work...
                What is really frustrating - there are no progress / error codes -
                the QProcess starts but there is obviously no execution of the arguments...

                   params = QStringList()<<"-e"<<"bluetoothctl";
                    //params = QStringList()<<"-e"<<"bluetoothctl" << "-e" << " help";
                    //params = QStringList()<<"-e"<<"bluetoothctl help";
                    //params = QStringList()<<"-e"<<"bluetoothctl" << "help";
                

                I did post my inquiry in "qterminal" forum - waiting for reply....
                Irregardless if I can make it work - I am still working on how to actually access the "window "
                created . Again - most people expect to have single process question and this is not
                a single issue - it has to be solved as a collection of systems / processes etc.

                And I am reluctant to post in half a dozed forums just to solve ONE process.
                .

                J Offline
                J Offline
                JonB
                wrote on 19 Sept 2022, 19:14 last edited by
                #7

                @AnneRanch
                Ultimately if you get it going it will behave the same as your xterm attempt, because you are still running a terminal.

                A 1 Reply Last reply 20 Sept 2022, 00:03
                0
                • M mchinand
                  19 Sept 2022, 19:12

                  Does it work when just calling it from the command line?

                  qterminal -e bluetoothctl help

                  A Offline
                  A Offline
                  Anonymous_Banned275
                  wrote on 19 Sept 2022, 23:54 last edited by Anonymous_Banned275
                  #8

                  @mchinand

                  No, it does not work from terminal, hence the problem is in qterminal itself. I think it is time to abandon qterminal....

                  6c98a21f-6cda-44ff-b517-1a2fb0219cca-image.png

                  M 1 Reply Last reply 20 Sept 2022, 00:39
                  0
                  • J JonB
                    19 Sept 2022, 19:14

                    @AnneRanch
                    Ultimately if you get it going it will behave the same as your xterm attempt, because you are still running a terminal.

                    A Offline
                    A Offline
                    Anonymous_Banned275
                    wrote on 20 Sept 2022, 00:03 last edited by
                    #9

                    @JonB
                    I fully realize that - but this "native window" exists physically and I should be able to access it.
                    As I said - this is not a single process problem - now the multiple options is identified - it is time to
                    concentrate on access to "NATIVE WINDOW"...

                    J 1 Reply Last reply 20 Sept 2022, 07:16
                    0
                    • A Anonymous_Banned275
                      19 Sept 2022, 23:54

                      @mchinand

                      No, it does not work from terminal, hence the problem is in qterminal itself. I think it is time to abandon qterminal....

                      6c98a21f-6cda-44ff-b517-1a2fb0219cca-image.png

                      M Offline
                      M Offline
                      mchinand
                      wrote on 20 Sept 2022, 00:39 last edited by
                      #10

                      @AnneRanch said in passing multiple options to qterminal:

                      No, it does not work from terminal

                      Is that 'Shell No. 1' terminal the result of qterminal -e bluetoothctl? Doesn't that mean it does work from a terminal?

                      A 1 Reply Last reply 20 Sept 2022, 01:11
                      0
                      • M mchinand
                        20 Sept 2022, 00:39

                        @AnneRanch said in passing multiple options to qterminal:

                        No, it does not work from terminal

                        Is that 'Shell No. 1' terminal the result of qterminal -e bluetoothctl? Doesn't that mean it does work from a terminal?

                        A Offline
                        A Offline
                        Anonymous_Banned275
                        wrote on 20 Sept 2022, 01:11 last edited by
                        #11

                        @mchinand Please read the title and the last post - it about passing multiple options .....and that does not work

                        1 Reply Last reply
                        0
                        • A Anonymous_Banned275
                          20 Sept 2022, 00:03

                          @JonB
                          I fully realize that - but this "native window" exists physically and I should be able to access it.
                          As I said - this is not a single process problem - now the multiple options is identified - it is time to
                          concentrate on access to "NATIVE WINDOW"...

                          J Offline
                          J Offline
                          JonB
                          wrote on 20 Sept 2022, 07:16 last edited by JonB
                          #12

                          @AnneRanch said in passing multiple options to qterminal:

                          but this "native window" exists physically and I should be able to access it.
                          it is time to concentrate on access to "NATIVE WINDOW"...

                          I have tried to explain several times that you will not be able to access the output you see in a terminal --- whether from xterm or qterminal --- from an external program, such as your Qt application. That output goes into the terminal's output window and is not available to "see" or "read" elsewhere, even though you would like it to be. But I will leave you to your investigations.

                          When you come to the same conclusion you have my reply at https://forum.qt.io/topic/139374/another-xterm-qtextedit-issues/10 which shows what you will need to do if you do wish to access the output from bluetoothctl and has code showing how to do it and what the final output will look like.

                          1 Reply Last reply
                          2

                          1/12

                          19 Sept 2022, 14:10

                          • Login

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