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. Display COUT in (visual studio/Qt framework)
Forum Updated to NodeBB v4.3 + New Features

Display COUT in (visual studio/Qt framework)

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 5.0k Views 1 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
    Amine Djeddi
    wrote on 17 May 2018, 14:24 last edited by
    #1

    hi my freinds :)

    I'm using VStudio and Qt framework for image processing ...
    when i run every thing is fine, but the COUT is not working

    cout << "Extracted " << contours.size() << " contours" << endl;

    thank you

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 17 May 2018, 14:26 last edited by
      #2

      Hi
      In what way not working ?
      std::cout is normally displayed in Application Output pane.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Amine Djeddi
        wrote on 17 May 2018, 14:31 last edited by
        #3

        it works when i changed to project properties :

        project properties -> linker -> system -> subsystem : console(/subsysteme:console)

        [before it was : -> subsystem : windows(/subsysteme:windows) ]

        M 1 Reply Last reply 17 May 2018, 14:34
        0
        • A Amine Djeddi
          17 May 2018, 14:31

          it works when i changed to project properties :

          project properties -> linker -> system -> subsystem : console(/subsysteme:console)

          [before it was : -> subsystem : windows(/subsysteme:windows) ]

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 17 May 2018, 14:34 last edited by
          #4

          @Amine-Djeddi
          Well std::cout is not visible in GUI projects.
          Only when its a console app.
          So that is pretty normal.

          1 Reply Last reply
          2
          • A Offline
            A Offline
            Amine Djeddi
            wrote on 17 May 2018, 14:37 last edited by
            #5

            yup :))
            thank you for being here to help

            J M 2 Replies Last reply 17 May 2018, 14:40
            0
            • A Amine Djeddi
              17 May 2018, 14:37

              yup :))
              thank you for being here to help

              J Offline
              J Offline
              JonB
              wrote on 17 May 2018, 14:40 last edited by
              #6

              @Amine-Djeddi
              See e.g. https://stackoverflow.com/questions/16703835/visual-studio-how-can-i-see-cout-output-in-a-non-console-application if you'd still like a way to see your output when a GUI program....

              1 Reply Last reply
              2
              • A Amine Djeddi
                17 May 2018, 14:37

                yup :))
                thank you for being here to help

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 17 May 2018, 14:43 last edited by
                #7

                @Amine-Djeddi
                Hi,
                What are you trying to use it for ?
                If you want the GUI program to also have a "command prompt" showing
                you will need to create on using native windows calls.
                If you just want to use std::cout for some debugging, the easy way is to redirect them to
                a file and load in PlainTextEdit in the app.

                1 Reply Last reply
                2
                • A Offline
                  A Offline
                  Amine Djeddi
                  wrote on 18 May 2018, 10:17 last edited by
                  #8

                  @mrjj
                  Hi again , i used this and it worsks fine :)
                  outData.open("count.csv", ios::app);

                  outData << ui.lineEdit_Filename->text().toStdString() << ";Number of Objects: " ;
                  outData << contours.size() <<endl;

                  than i will work for "PlainTextEdit" .. if i get into troubles XD than i will ask for help

                  1 Reply Last reply
                  1

                  1/8

                  17 May 2018, 14:24

                  • Login

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