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. [Moved] QT and data input in ubuntu terminal

[Moved] QT and data input in ubuntu terminal

Scheduled Pinned Locked Moved Qt Creator and other tools
27 Posts 5 Posters 13.2k 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #14

    OK, thanks. I suppose that, given that Qt is a GUI development system, this is reasonable, though it may surprise some people who come from a more conventional IDE like Eclipse.

    Is there at least a way to launch the terminal from Qt? Some minor level of integration would make it a little easier.

    EDIT: let me rephrase that: there does appear to be some kind of terminal integration (though I can't get it to work for me); can one launch an app to terminal from Qt while still controlling the app through the Qt debugger? That would be slick.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #15

      It's not a problem of GUI or console development. You can have console input on a GUI program too :-)

      Ah, seems that I was wrong!

      In the run settings (project view of Creator) you can check a checkbox "run in terminal", this might be what you want. It's a bit cumbersome on the mac though (I remember you being on OS X, right?). You must set the terminal application on the mac to

      /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal

      (Settings, Environment, first tab)

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #16

        That sure seems like it should work, doesn't it? But, when I try to start a debug session, I get an error message at launch, saying it can't start the terminal emulator '/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal'. Dunno...

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #17

          There actually is a "launch in terminal" in the run settings of your project in Qt Creator... Go to project mode and visit the run settings there.

          1 Reply Last reply
          0
          • mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by
            #18

            I assume you mean the "Run in terminal" check box? I have that checked. Still doesn't go.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #19

              [quote author="mzimmers" date="1302358795"]That sure seems like it should work, doesn't it? But, when I try to start a debug session, I get an error message at launch, saying it can't start the terminal emulator '/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal'. Dunno...
              [/quote]

              This should work. Where is your Terminal.app located? You'll need to enter

              /path/to/Terminal.app/Contents/MacOS/Terminal

              into the config field.

              EDIT: You actually are on a Mac, aren't you?

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • mzimmersM Offline
                mzimmersM Offline
                mzimmers
                wrote on last edited by
                #20

                Heh...yes, I'm on a Mac, and the path you provided above is indeed the correct one. No idea why it's not working.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #21

                  For me it works, but the new terminal window is launched in the background. You have to select it via the dock or the running apps selector (cmd-tab). Also, the newly opened terminal is not quit once you terminate your application, you have to quit it manually (and watch out that you do not quit your regular terminal!)

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • mzimmersM Offline
                    mzimmersM Offline
                    mzimmers
                    wrote on last edited by
                    #22

                    Oho!

                    I just went back into preferences, and this time, I hit the apply button. This time the terminal launched. I had assumed just hitting "OK" would have done this for me.

                    Thanks for the help.

                    EDIT: just as an FYI for anyone reading this thread, note that while Terminal will launch your application, it will do so from the context of the default directory for your user account, NOT the directory that the application is in. You may need to move around data files or engage in directory processing within your program to achieve the desired results.

                    1 Reply Last reply
                    0
                    • mzimmersM Offline
                      mzimmersM Offline
                      mzimmers
                      wrote on last edited by
                      #23

                      Also, the newly opened terminal is not quit once you terminate your application, you have to quit it manually (and watch out that you do not quit your regular terminal!)

                      I seem to be having the opposite problem. My terminal window goes away, but according to the Application Output view, the app hasn't terminated yet. I hit the red square, and get a warning that the app is still running. Not a showstopper, but odd...

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        goetz
                        wrote on last edited by
                        #24

                        Yes, unless you do not have a means to quit the application, say ctrl-c, it works this way :-( You'll have to quit the app via the kill button in Creator.

                        http://www.catb.org/~esr/faqs/smart-questions.html

                        1 Reply Last reply
                        0
                        • mzimmersM Offline
                          mzimmersM Offline
                          mzimmers
                          wrote on last edited by
                          #25

                          Well...I thought I had this whipped, but...I just tried actually a console app with the debugger, and...it ignores all the debug commands (like breakpoints, etc.). Any idea what's going on? It seems as though the terminal window and the debugger aren't talking to each other very well.

                          1 Reply Last reply
                          0
                          • mzimmersM Offline
                            mzimmersM Offline
                            mzimmers
                            wrote on last edited by
                            #26

                            How funny to browse through old posts looking for a solution, and realize you had the same problem on a different platform nearly a year ago.

                            I'm now trying to get Creator and GDB working together on ubuntu, without success. Seems like the same issue. Just bumping this thread to see if anyone knows of a solution...

                            1 Reply Last reply
                            0
                            • D Offline
                              D Offline
                              Don Slowik
                              wrote on last edited by
                              #27

                              mzimmers,
                              I was able to get my QtCreator reading/writing from/to cin/cout thanks to your questions/post. And it's running fine here with GDB on Ubuntu 12.04. Thanks for your help, and hope your's is running fine now.

                              1 Reply Last reply
                              0

                              • Login

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