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. QHostInfo::localHostName() never give my hostname (archlinux)

QHostInfo::localHostName() never give my hostname (archlinux)

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • jerome_isAviableJ Offline
    jerome_isAviableJ Offline
    jerome_isAviable
    wrote on last edited by
    #1

    why
    qDebug() << QHostInfo::localHostName();
    not show my hostname ?

    From terminal, command "hostname" give me my hostname...
    what's happen ? what i forget or misunderstand about QHostInfo ?
    If QHostLocalHostName::localHostName() not show hostname fromlocalhost, what is the interest of this function ?

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

      Hi,

      What do you get and what do you expect ?

      On what OS ?

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

      jerome_isAviableJ 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What do you get and what do you expect ?

        On what OS ?

        jerome_isAviableJ Offline
        jerome_isAviableJ Offline
        jerome_isAviable
        wrote on last edited by jerome_isAviable
        #3

        @SGaist
        os is in the title: archlinux (and Qt-5.5.1-9)
        i get exactly:
        QHostAddress("")

        but my machine name get by command "hostname" is exactly:
        archlinux-jerome

        1 Reply Last reply
        0
        • jerome_isAviableJ Offline
          jerome_isAviableJ Offline
          jerome_isAviable
          wrote on last edited by
          #4

          when i do an application just for that, it worked. Then now, suddenly (no do nothing more), in my application, it works also.
          strange... i don't know why but... ok... now it works.
          thank you.

          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