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. Qt trip planner example help
Forum Updated to NodeBB v4.3 + New Features

Qt trip planner example help

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.9k 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.
  • J Offline
    J Offline
    Jyang772
    wrote on last edited by
    #1

    I downloaded the example for the Qt trip planner from here: http://www.informit.com/articles/article.aspx?p=1405552&seqNum=3

    Both the server and client compile and I have set the server address to localhost. Nothing is happening when I click Search. The client's sendRequest slot is executed, so I know the connection has been established. But the client is stuck sending a request to the server. I don't think the server received the data.

    @
    void TripServer::incomingConnection(int socketId)
    {
    qDebug() << "Incoming Connection";
    ClientSocket *socket = new ClientSocket(this);
    socket->setSocketDescriptor(socketId);
    }
    @

    The qDebug statement is not printed. Does this mean the client hasn't connected to the server?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      Usually if the slot is not connected there is a warning on the console. You should be seeing the qDebug() statement on the console as well though. It is possible it's not connected but it could be something else entirely.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jyang772
        wrote on last edited by
        #3

        What is the difference between incomingConnection and newConnection? I created a newConnection slot and it gets called. I tested it with telnet.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ambershark
          wrote on last edited by
          #4

          I have no idea. It is specific to that project. It's just what they named their slots. It could be anything. Without seeing the code I can't tell.

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jyang772
            wrote on last edited by
            #5

            I found my answer.

            The parameter list has changed since Qt 4.8.1

            http://qt-project.org/doc/qt-5/qtcpserver.html#incomingConnection

            Thanks anyway.

            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