Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In this specific case, I'd like to use the full name of the currently logged-in user in a QML app (not the logname). As far as I found out, system calls can not yet be used (and would not be an elegant solution). Also the Ubuntu SDK documentation seems to cover only UI-related topics.

Is there a method to access the full user name from within a QML app? And in general, are system APIs or the Unity API available to QML apps?

share|improve this question

1 Answer 1

For that you need to create your own QML plugin what is a simple Qt/C++ code. In that QML plugin you can access the system the same way as you would access from any C++ code and expose the functions, properties to the QML layer.

There is a template available in the Ubuntu SDK.

Open the Ubuntu SDK (QtCreator) go to the "Touch" tab, click on the "Create a new project >" and choose the Ubuntu -> QML Extension Library

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.