Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-105266

initSocket example without declaration udpSocket

    XMLWordPrintable

Details

    • Suggestion
    • Status: Reported
    • Not Evaluated
    • Resolution: Unresolved
    • 6.4.0 Beta2
    • None
    • Build tools: qdoc
    • None
    • All

    Description

      At page https://doc.qt.io/qt-6/qudpsocket.html
      this is code

      void Server::initSocket()
      {
          udpSocket = new QUdpSocket(this);
          udpSocket->bind(QHostAddress::LocalHost, 7755);
      
          connect(udpSocket, &QUdpSocket::readyRead,
                  this, &Server::readPendingDatagrams);
      }
      

      I suggest to add declaration of udpSocket. As I know
      QUdpSocket* udpSocket;

      Because dummy wants
      QUdpSocket udpSocket;

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            docinfrastructure Documentation Infrastructure Team
            dungeonlords Andrei Cherniaev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes