Friday, May 3, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 7379  / 2 Years ago, wed, february 2, 2022, 8:23:51

It appears that since I didn't install the beta1 version of QT5 from the ppa, I'm unable to use the Ubuntu components package. I have the released version QT5 already and not interested in installing a beta version now. Is there a workaround?



The following packages have unmet dependencies:
qt-components-ubuntu : Depends: qtbase but it is not installable
Depends: qtdeclarative but it is not installable


The instructions to install the preview toolkit are here. I skipped the step to install QT5 because I already have a newer version straight from qt-project.org.


More From » application-development

 Answers
0

These instructions were tested on Ubuntu 12.04, Ubuntu 12.10 both 32-bit and 64-bit.



First off we need to install some dependencies. Install these even if you already have Qt5 installed:



sudo apt-get install build-essential libgtk2.0-dev libgl1-mesa-dev


If you haven't already, download and install the QtSDK from http://qt-project.org/downloads.



For Ubuntu 64-bit run:



cd ~
wget http://releases.qt-project.org/qt5/5.0.0/qt-linux-opensource-5.0.0-x86_64-offline.run
mv qt-linux-opensource-5.0.0-x86_64-offline.run qt5-installer.run


For Ubuntu 32-bit run:



cd ~
wget http://releases.qt-project.org/qt5/5.0.0/qt-linux-opensource-5.0.0-x86-offline.run
mv qt-linux-opensource-5.0.0-x86-offline.run qt5-installer.run


Then make it executable:



chmod +x qt5-installer.run


Now run it as root in order to install it to /opt:



sudo ./qt5-installer.run


Follow the prompts and, when asked where to install, select /opt/QtSDK.
From now on I will assume that you have it installed to that location, if you already had the Qt installed to a different location, adapt the steps in order to reflect your installation.



After installation I suggest you delete the QtCreator configuration folder as the permissions are wrong. QtCreator will recreate them when restarted.



cd ~/.config
sudo rm -rf QtProject


Now for the Qt Ubuntu Components, download the source file and unpack it:



wget https://launchpad.net/~ui-toolkit/+archive/ppa/+files/qt-components-ubuntu_0.1.24%7Equantal1.tar.gz
tar -zxvf qt-components-ubuntu_0.1.24~quantal1.tar.gz


Now in order to compile and install the components we need to create some sim-links.



For Ubuntu 64-bit run:



sudo ln -s /opt/QtSDK/5.0.0/gcc_x64 /opt/qt5


For Ubuntu 32-bit run:



sudo ln -s /opt/QtSDK/5.0.0/gcc /opt/qt5


One more thing before we compile and install, we need to change two environment variables, PATH and QML_IMPORT_PATH:



export PATH=$PATH:/opt/qt5/bin
export QML_IMPORT_PATH=/opt/qt5/imports
echo 'export PATH=$PATH:/opt/qt5/bin' >> ~/.bashrc
echo 'export QML_IMPORT_PATH=/opt/qt5/imports' >> ~/.bashrc


Now we need generate a Makefile an build the Qt Ubuntu Components:



cd ~/trunk
qmake ubuntu-sdk.pro
make
sudo make install


If everything went OK, the the components should be built and installed, now we need to try it out to make sure everything went alright. I suggest you log out and the back in before doing the next steps.




  • Open QtCreator, go to Tools -> Options, select the External Tools
    tab.

  • For Qt Quick 1 Preview (qmlviewer), in the Executable field write: /opt/qt5/bin/qmlviewer

  • For Qt Quick 2 Preview (qmlscene), in the Executable field write: /opt/qt5/bin/qmlscene.

  • Click Apply and close the Options window.



Everything should be working now, one thing to keep in mind is that in order to successfully execute a QML Ubuntu Phone Application, in the .qmlproject file you need to uncomment importPaths and add "/opt/qt5/imports" to it like so:



Project {
...
/* List of plugin directories passed to QML runtime */
importPaths: [ "/opt/qt5/imports" ]
...
}


That's about it. For any questions comment and I'll try to get back to you. Have Fun!


[#33372] Thursday, February 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
suspengn

Total Points: 477
Total Questions: 104
Total Answers: 100

Location: Rwanda
Member since Thu, Feb 10, 2022
2 Years ago
suspengn questions
;