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. Signals and Slots on console application

Signals and Slots on console application

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 3.2k 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.
  • P Offline
    P Offline
    pkiorpes
    wrote on last edited by
    #1

    I am trying to make a network console application and i want to use signals and slots.
    Is there any example to use see how to?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Binary91
      wrote on last edited by
      #2

      Hi,
      well I'm not sure if your question is how to use Signals & Slots in a console application or how to manage a network console application.

      To use Signals & Slots in a console application, just use QCoreApplication.
      For coding a network console application, just google it, you'll get a lot of results ;-)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        danieltm64
        wrote on last edited by
        #3

        Just make a Qt Console Application in Qt Creator in the usual [File > New] way. Then, add this line to your .pro file:

        QT += network

        At this point, you're all set to start coding. Click on the "Welcome" tab in Qt Creator and then click on "Examples", then type in "Network" in the search field, a bunch of networking examples will show up. Click on one of them and learn how to use Qt's networking classes, most of those examples are graphical applications however.

        You also need to use QCoreApplication so that you have an event loop, which is necessary for signals and slots, the new Qt Console Application template in Qt Creator sets that all up for you.

        Daniel

        1 Reply Last reply
        0
        • D Offline
          D Offline
          danieltm64
          wrote on last edited by
          #4

          OK, let me rephrase what I said previously: The signals and slots mechanism doesn't require an event loop, but in a networked console application you do need an event loop if you want to use signals and slots because console applications usually quit really fast, and networked applications require time to receive all the data from the network, so in this case you do need an event loop to keep the application alive. Sorry for the confusion I may have caused.

          Anyways, what seems to be your difficulty with setting up a networked console application with Qt?

          Daniel

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pkiorpes
            wrote on last edited by
            #5

            I am trying to make an application on raspberrypi.
            The consept is a streaming video from raspberrypi as server to another pc win 7 as client receiver.
            The question is how to make a stream and how to receive it.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Video streaming is not an easy topic, so I'd recommend using something already working like e.g. gstreamer to do that.

              Hope it helps

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pkiorpes
                wrote on last edited by
                #7

                Is there some code example with gstreamer and qt to start?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You have the QtGStreamer project which should help you

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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