Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Import Ubuntu.Component to workspace ( code completion in qtcreator ) - cross platform
https://github.com/lduboeuf/ut-qtcreator
#run container clickable
docker run -i -t --entrypoint /bin/bash clickable/ubuntu-sdk:16.04-amd64
#in an another terminal, get the container id
docker ps
#copy ubuntu components to local folder
docker cp [container id]:/usr/lib/x86_64-linux-gnu/qt5/qml/ [path to somewhere]
#set the environnement variable to profile
echo "export QML_IMPORT_PATH=[path to somewhere]" >> ~/.profile
#reload env or you might need to logout/login
source ~/.profile
##stop container
docker stop [container id]
#only work for Ubuntu 16.04 and 18.04:
#add ubports repository
sudo add-apt-repository "deb https://repo.ubports.com/ [bionic|xenial] main"
#install Ubuntu.components
sudo apt install qml-module-ubuntu-components
#qml components should be installed in "/usr/lib/x86_64-linux-gnu/qt5/qml"
#set the environnement variable to profile
echo "export QML_IMPORT_PATH=/usr/lib/x86_64-linux-gnu/qt5/qml" >> ~/.profile
#reload env or you might need to logout/login
source ~/.profile
@lduboeuf

This comment has been minimized.

Copy link
Owner Author

lduboeuf commented Jul 6, 2019

make code completion available for Ubuntu.components in QtCreator ( without the need of ubuntu-sdk )

Probably a shortest way for 1st ?proposition

@jonnius

This comment has been minimized.

Copy link

jonnius commented Jul 8, 2019

A lot of people are asking for this. Would be great if you could add that to the ubports docs.

@lduboeuf

This comment has been minimized.

Copy link
Owner Author

lduboeuf commented Jul 8, 2019

have you tried successfully ? , maybe more a StackOverflow or forum thing ?

@jonnius

This comment has been minimized.

Copy link

jonnius commented Jul 9, 2019

Yes, I tried way 1 and it worked for me! 👍

There is a Guides Section in the docs, where it would fit in imho.

Some suggestions:

  • You could explicitly tell that the first command needs to be run in a separate terminal session.
  • The last command could be a simple exit in the terminal session from the first command.
  • If you append a -q to the second command, it will print the ID only.
  • You could even merged the second and third command as docker cp $(docker ps -q):/usr/lib/x86_64-linux-gnu/qt5/qml/ [path to somewhere]
  • I'd suggest to put some path in there instead of [path to somewhere], e.g. $HOME/.ubuntu-components
@lduboeuf

This comment has been minimized.

Copy link
Owner Author

lduboeuf commented Jul 9, 2019

great it worked :). feel free to add it to the doc, or if i find time i will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.