How to change computer name using QT
-
Hi all!
I am starting in qt programming, and want to know how to change computer name with using of this framework. I have tried to execute QHostInfo::setHostName, but it does not take some effect... -
@novell86 said in How to change computer name using QT:
QHostInfo::setHostName
I'm not sure that does what you think, I haven't really played there, I just use addresses.
I'm pretty sure that HostInfo is more for querying the connection endpoint and not an api to change the netbios name or anything.http://doc.qt.io/qt-5/qhostinfo.html#localHostName
http://doc.qt.io/qt-5/qsysinfo.html#machineHostNameTo do that you could maybe implement OS calls:
https://linux.die.net/man/2/sethostname
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724931(v=vs.85).aspxSomeone else may come along with something more solid... that's where I'd be looking, maybe search Qt code for api calls like that? Dunno. Pretty sure this isn't the class you are looking for this though.
-
Hi all!
I am starting in qt programming, and want to know how to change computer name with using of this framework. I have tried to execute QHostInfo::setHostName, but it does not take some effect...