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

QHostInfo::localDomainName() prints QObject::connect(QObject, Unknown): invalid nullptr parameter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.15.2
    • Network
    • None
    • Linux/X11

    Description

      QObject::connect(QObject, Unknown): invalid nullptr parameter is printed when calling QHostInfo::localDomainName(); on a Fedora35 machine with Qt qt5-qtbase-5.15.2-22.fc35.x86_64

       

      Code Example:

      #include <QtCore/QtCore>
      #include <QtCore/QtCore>
      #include <QtNetwork/QHostInfo>
      #include <iostream>
      
      int main(int argc, char **argv) { 
        QString domain = QHostInfo::localDomainName(); 
        std::cout << qPrintable(domain) << std::endl;
      }
      

      .pro file

      ######################################################################
      # Automatically generated by qmake (3.1) Fri Mar 4 21:26:01 2022
      ######################################################################
      TEMPLATE = app
      TARGET = domainname
      INCLUDEPATH += .
      QT += network
      # You can make your code fail to compile if you use deprecated APIs.
      # In order to do so, uncomment the following line.
      # Please consult the documentation of the deprecated API in order to know
      # how to port your code away from it.
      # You can also select to disable deprecated APIs only up to a certain version of Qt.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0# Input
      SOURCES += main.cpp
      

      Compilation instructions:

      qmake-qt5 -project
      qmake-qt5
      make

      Error

      [kevin_constantine@instance-1 domainname]$ ./domainname
      QObject::connect(QObject, Unknown): invalid nullptr parameter
      c.gcp-project.internal
      

      It may be coming from https://github.com/qt/qtbase/commit/38a727cc97aff6972005afe486d4ee81a41a7d7e

      Attachments

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

        Activity

          People

            manordheim Mårten Nordheim
            kconstan Kevin Constantine
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes