I cross compiled Qt 5.14.1 for my Raspberry pi 4 on a Ubuntu 18.04,
for my application I need arcs when I searched I found out that arc belongs to QtQuick.Studio.Components 1.0 https://doc.qt.io/qtdesignstudio/qml-qtquick-studio-components-arc.html
but when I added the import QtQuick.Studio.Components 1.0 in my main.qml I had an error QML module not found (QtQuick.Studio.Components 1.0 ) import paths : /opt/RaspberryQt/sysroot/usr/local/RaspberryQt/qml
so in my .pro file I added
QML_IMPORT_PATH = /opt/RaspberryQt/sysroot/usr/local/RaspberryQt/qml
but I still have this error
these are the libraries that I installed on my Raspberry pi 4 before cross compiling. Can you please tell me which one is missing ?
sudo apt-get build-dep qt5-qmake
sudo apt-get build-dep libqt5gui5
sudo apt-get build-dep libqt5webengine-data
sudo apt-get build-dep libqt5webkit5
sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0 gdbserver
and this is my configuration
cd /opt/RaspberryQt/build
../qt-everywhere-src-5.14.1/configure -release -opengl es2 -eglfs -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/RaspberryQt/tools/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf- -sysroot /opt/RaspberryQt/sysroot -prefix /usr/local/RaspberryQt -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -nomake examples -make libs -pkg-config -no-use-gold-linker -v -recheck
Thank you in advance
I was able to fix this problem. First install Qt Design Studio (you can add components to the Qt installation by going to the Qt install directory, such as C:\Qt and running MaintenanceTool.exe.
Once installed, navigate to following path in the Qt install directory:
[Wherever Installed]\Qt\Tools\QtDesignStudio\bin\qml\QtQuick
Then in there, copy the entire Studio folder, and paste it into:
[Wherever Installed]\Qt\Tools\QtCreator\bin\Qml\QtQuick
Then relaunch Qt Creator and it should see it.
Note: There might be a more elegant way to import the modules from Qt Design Studio by adding the [path]\Qt\Tools\QtCreator\bin\Qml\ directory to the import paths, but that wasn't working for me, so I just did it with the method above.
you are getting the import from an extra qt module. So compile and install https://codereview.qt-project.org/gitweb?p=qt-labs/qtquickdesigner-components.git;a=tree into the qt installation on your raoberry aswell.
Follow-up to ThioJoe's answer:
If you've already tried ThioJoe's approach but facing the same issue, try this:
1. Copy the Studio folder located in: [Wherever Installed]\Qt\Tools\QtDesignStudio\bin\qml\QtQuick.
2. Paste the copied Studio folder into: [Wherever Installed]\Qt\6.2.3\mingw_64\qml\QtQuick (note, the 6.2.3 might
be different depending on your version).
3. Relaunch QtCreator.
Related
Ubuntu 20.04
I just want to use default snap and apt versions
Qt Creator 4.11.0 from apt:
sudo apt install qtcreator qt5-default
CMake 3.24.0 from snap:
sudo snap install cmake --classic
If I open the project, it gives an error:
Running /usr/bin/snap /home/fresh/Downloads/test -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DCMAKE_PREFIX_PATH:STRING=/usr -DQT_QMAKE_EXECUTABLE:STRING=/usr/bin/qmake in /tmp/QtCreator-BsxNPO/qtc-cmake-BcKQdVpk.
error: unknown command "/home/fresh/Downloads/test", see 'snap help'.
CMake process exited with exit code 64.
Any change to make it work properly without building CMake from source or installing newer version of Qt Creator?
Solution:
sudo ln -s /snap/cmake/current/bin/cmake /usr/bin/cmake
sudo ln -s /snap/cmake/current/bin/ccmake /usr/bin/ccmake
sudo ln -s /snap/cmake/current/bin/cpack /usr/bin/cpack
In Qt go to Tools > Options > Kits > CMake in Manual set Path:
/usr/bin/cmake
Go back to Kits tab, in CMake Tool choose added new CMake
Relaunch Qt. It works
I installed QT-everywhere 5.15 open-source for academic reasons, but I have failed to run a program.
Firstly, I compiled the necessary source files with make and installed the QT Creator, then I selected qmake for running programs inside it. When I tried to run an example program, I encounter this error:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/usr/lib/x86-64-linux-gnu"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.
The program has unexpectedly finished.
The process was ended forcefully.
Then I looked into /usr/lib/x86-64-linux-gnu for finding the xcb plugin and set LD_LIBRARY_PATH=/usr/lib/x86-64-linux-gnu, but again the same error appeared.
What should I do to solve this problem?
1. Install requirements:
sudo apt install make g++ pkg-config libgl1-mesa-dev libxcb*-dev libfontconfig1-dev libxkbcommon-x11-dev python libgtk-3-dev
python is optional for QtQuick.
libgtk-3-dev optional if you want the GTK native theme for QtWidgets.
2. Configure:
./configure -opensource -confirm-license -nomake tests -nomake examples -prefix /path/to/install/dir
3. Compile:
make -j $(nproc)
make install
I have followed the instructions on this page Building Qt 5 from Git to build Qt 5.5 from source. The source is in "~/qt5_source_built/qt5" and the Qt 5.5 built system is in "~/qt5_source_built/qt5.5-build". I have used the following config options :
~/qt5_source_built/qt5/configure -developer-build -opensource -no-gtkstyle -nomake examples -nomake tests
and then used "make -j4" to build the qt-5.5 system. The system builds OK.
I use CMake to develop applications for the Qt 5.5 built system. It works for the usual cases (e.g. could use qtwebkit). However, when I want to test the qtwebengine module on a new application, I find that there seems NO qtwebengine include files and library files under the "~/qt5_source_built/qt5.5-build/qtbase" directory.
I have tried to re-make the system using different targets :
make all -j4
make module-qtwebengine -j4
make module-qtwebengine-all -j4
but the console keeps outputing
... Nothing to be done for ...
and the qtwebengine include and library files still could NOT be found under the "~/qt5_source_built/qt5.5-build/qtbase" directory after the re-make.
I notice that the qtwebengine source files seems could be found in "~/qt5_source_built/qt5/qtwebengine/src" but I just could not build it using the "make" command.
Have I just missed the qtwebengine include and library files under the built directory ? If not, does anyone know how could I build qtwebengine using this Qt 5.5 git source ?
Thanks for any suggestion.
The following ended up working. I installed all of these prereqs. If they were missing, QtWebEngine wouldn't build. make module-qtwebengine usually printed out the reason it didn't build it:
sudo apt-get install bison build-essential flex gperf gyp \
libasound2-dev libbz2-dev libcap-dev libcups2-dev libdrm-dev \
libegl1-mesa-dev libfontconfig1-dev libgcrypt11-dev \
libglu1-mesa-dev libicu-dev libnss3-dev libpci-dev libpulse-dev \
libssl-dev libudev-dev libxcomposite-dev libxcursor-dev \
libxdamage-dev libxrandr-dev libxtst-dev ninja python ruby
Then I used the following configuration. Not sure if this is minimal but it worked:
./configure -release -opensource -confirm-license -shared \
-no-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype\
-icu -openssl -qt-xcb -opengl -gui -widgets -skip webkit \
-nomake examples
Note that I skipped webkit, and also I use -shared instead of -static since static linking of QtWebEngine is apparently not yet supported.
I've tried to build a minimalist framework using qt-opensource-mac-x64-clang-5.4.0-beta.dmg with:
./configure -silent -nomake examples -nomake tests -platform macx-clang
but the build process fails miserably:
../../../src/3rdparty/chromium/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm:891:26: error: cannot initialize a parameter of type 'id<NSFileManagerDelegate>' with an rvalue of type 'PtrType' (aka 'ChromiumWebCoreObjCWebScrollbarPainterDelegate *')
[painter setDelegate:m_verticalScrollbarPainterDelegate.get()];
The latest sources in git also give this error, even if I remove the bogus module with -skip qtwebkit -skip qtwebkit-examples. Any ideas how to get it working?
This is from QtWebEngine so try
-skip qtwebengine
If you don't have specific requirements, it's best to let homebrew handle the details. I recently compiled pyqt, which also needs qt and it worked fine on OSX 10.10:
brew install qt
I'm trying to configure my Qt for Embedded Linux with a virtual framebuffer according to these instructions. From the Qt for Embedded source folder, I'm trying:
./configure -embedded -opensource -confirm-license -verbose -qvfb
make
I get the following error which prevents me from doing make install:
.obj/release-shared-emb-x86/qtextcodec.o: In function `setup()':
qtextcodec.cpp:(.text+0x23cc): undefined reference to `QIconvCodec::QIconvCodec()'
collect2: ld returned 1 exit status
make[1]: *** [../../lib/libQtCore.so.4.8.4] Error 1
make[1]: Leaving directory `/home/cstjean/qt/src/corelib'
make: *** [sub-corelib-all-ordered] Error 2
If I do:
./configure -embedded -opensource -confirm-license -verbose -qvfb
make -no-iconv
sudo make install -no-iconv
...This works. But when I go into QtCreator, Tools > Options > Build & Run > Qt Versions, I try to select qmake for Qt Embedded (for me it's in /home/cstjean/qt/bin/qmake) and it tells me:
Qt version is not properly installed, please run make install
I've tried googling this like crazy. There are a lot of suggestions to download various libraries, which I've tried to no avail, but perhaps I'm missing something because this is a pretty fresh installation of Ubuntu I'm using.
Thanks.
I solved this problem by installing Gnome and starting over from scratch for my Qt Embedded for Linux installation.
I googled gnome for ubuntu 12.04 and found these instructions. You'll have to see which version of Ubuntu you have and search for that of course. You can see which version you have by typing into a command line:
lsb_release -a
Once I had gnome installed, I restarted my computer and signed in using Gnome.
Then I completely uninstalled and removed all traces of Qt Embedded:
cd yourQtEmbeddedDir
sudo make uninstall
cd ..
rm -r yourQtEmbeddedDir sourceFileTarYouHadDownloaded.tar.gz
I redownloaded the source file tar for Qt Embedded for Linux (from here) and proceeded to install according to these instructions after extracting the source files from the tar:
./configure -embedded -opensource -confirm-license -verbose -qvfb
make
sudo make install
Now, if you tell QtCreator about qmake from this installation, then QtCreator will no longer complain about a bad installation! Ta da!
Note: If you're attempting to the do the Virtual Framebuffer business too, then this is not the end of the road. You need to have Qt for X11 installed as well in order to compile qvfb.
Long story short: You need Gnome if you're trying to install Qt Embedded for Linux with a Virtual Framebuffer on Ubuntu!