I need to know how to get the user name and/or home directory of the users. I've googled around for a while but can only find the variables for C++ or BASH.
How do I get the user name or home directory? I'm writing in QML.
Join Stack Overflow to learn, share knowledge, and build your career.
|
I need to know how to get the user name and/or home directory of the users. I've googled around for a while but can only find the variables for C++ or BASH. How do I get the user name or home directory? I'm writing in QML. |
|||||
|
|
You would have to get the Username in C++ and then exchange that data from C++ to qml. Read here how to exchange data between qml and C++. |
|||||||||||||
|
|
This is how I implemented it: QmlEnvironmentVariable.h
QmlEnvironmentVariable.cpp
Then in
Finally, use it in QML like so:
|
|||||||||
|