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

initSocket example without declaration udpSocket

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.0 Beta2
    • Documentation
    • 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

            docteam Qt Documentation Team
            dungeonlords Andrei Cherniaev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes