qtcreator can't find QT quick on ubuntu 18.04 - qt

I would like to develop a Qt Quick application on my Ubuntu 18.04.03 machine. I am going the route of installing Qt through the Ubuntu distribution. I first install the following:
sudo apt-get install qt5-default # Installs Qt 5.9.5
sudo apt install qtcreator # Version 4.5.2
Now I'm not sure what to install for Qt Quick, so I install these:
sudo apt install qml-module-qtquick-controls
sudo apt install qtquickcontrols2-5-dev
I run qtcreator, select New Project -> Qt Quick application, fill out requested information in the wizard. But after clicking "Finish" I'm presented with this error:
Project ERROR: Unknown module(s) in QT: quick
Why can't qtcreator find QT quick? Do I need to install additional packages? I am developing in C++ for desktop.
apt -cache search qtquick yields 40+ results, some of the more plausible ones being:
qml-module-qtquick-controls2 - Qt 5 Qt Quick Controls 2 QML module
qml-module-qtquick-dialogs - Qt 5 Dialogs QML module
qml-module-qtquick-extras - Qt 5 Quick Extras QML module
qml-module-qtquick-layouts - Qt 5 Quick Layouts QML module
qml-module-qtquick-localstorage - Qt 5 localstorage QML module
qml-module-qtquick-particles2 - Qt 5 particles 2 QML module
qml-module-qtquick-privatewidgets - Qt 5 Private Widgets QML module
qml-module-qtquick-scene2d - Qt 5 Quick Scene 2D QML module
qml-module-qtquick-scene3d - Qt 5 Quick Scene 3D QML module
qml-module-qtquick-templates2 - Qt 5 Qt Quick Templates 2 QML module
qml-module-qtquick-virtualkeyboard - Qt virtual keyboard - QML module
qml-module-qtquick-window2 - Qt 5 window 2 QML module
qml-module-qtquick-xmllistmodel - Qt 5 xmllistmodel QML module
qml-module-qtquick2 - Qt 5 Qt Quick 2 QML module
qtdeclarative4-kqtquickcharts-1 - QtQuick plugin to render interactive charts
qtdeclarative5-qtquick2-plugin - transitional dummy package Qt 5 Qt Quick 2 QML module
qtdeclarative5-u1db1.0 - Qt5 binding for U1DB - QtQuick2 QML plugin
qtquickcontrols2-5-dev - Qt 5 Quick Controls 2 development files
qtquickcontrols2-5-doc - Qt 5 Quick Controls 2 documentation
qtquickcontrols2-5-doc-html - Qt 5 Quick Controls 2 HTML documentation
qtquickcontrols2-5-examples - Qt 5 Qt Quick Templates 2 examples
qtquickcontrols5-doc - Qt 5 Quick Controls documentation
qtquickcontrols5-doc-html - Qt 5 Quick Controls HTML documentation
qtquickcontrols5-examples - Qt 5 Quick Controls examples
Thanks!

This is a problem I bumped into recently; Qt Quick is indeed part of a different package. Just run:
sudo apt install qtdeclarative5-dev
And after that you should be able to use Qt Quick without even having to restart Qt Creator.

Related

open a Qt cmake project in Qt Creator always re-run cmake

I took over a Qt project using cmake on Windows platform; every time I open this project in Qt Creator IDE (by open the top level CMakeLists.txt), Qt Creator always re-run cmake for this project. Then when I run this project, even without changing anything, cmake will re-build the complete project (because cmake is re-run).
How can I avoid such re-build? I use cmake 3.12 and Qt Creator 4.10
p/s: I noticed that there is a similar question [1], but the answer there doesn't help to avoid the re-run.
[1] Can I prevent auto-run of CMake at startup of Qt Creator 4?

Unknown module(s) in QT: 3dstudioruntime2

I installed qt creator and qt 3dstudio with the qtOnline installer for linux. I want to build a project using these two packages. I design my project in qt3dstudio and then I use qtcreator to code the logic of the program. But I cannot import qt3dstudio module into the code.any suggestions??
I need to get this going on ubuntu 16.04LTS. I couldn't find anything useful on the web about the problem. I did try to build qt3dstudio but some of the dependencies caused my ubuntu desktop to stop working and I had to reinstall ubuntu.
QT modules in my .pro file:
QT += widgets qml quick gui 3dstudioruntime2
and when I hit build I get the following error:
Unknown module(s) in QT: 3dstudioruntime2

Build qt5.8 with desktop opengl option (ubuntu)

I built the sources of Qt5.8 with the option ./configure -opengl desktop
Then, I did a make and finally sudo make install. Now I changed the .profile file as pointed here: http://doc.qt.io/qt-5/linux-building.html
But I have a question: How can I start now qt creator ide?
It seems you're looking for qt creator, which isn't bundled in the qt sources and must be compiled separately, however if you want qt creator alongside with your new qt build, download the qt creator alone and install it, after that open the qt creator, go to Settings -> Build & Run -> Qt Versions , from there you can add new qt versions, just point to qmake which is located in your new qt installation (Probably /usr/local/qt5/bin/qmake) , now add a new kit via Kit's tab and then you can use your newly installed qt with qt creator.

How to install plugins into Qt Designer?

I have scoured the internet for information regarding the installation process for plugins into Qt Designer and I have found no helpful/relevant information.
The plugin I want to install is the echo plugin.
I have also looked through the Qt Designer program files and found the echoplugin folder but have no idea how to install it. Here is the file location:
C:\Qt\Examples\Qt-5.5\widgets\tools\echoplugin
This holds the following file types; Qt Project Files, C++ Header, C++ Source and JSON
System Information
Windows 10
PyQt4
Qt Designer 5.5.0
Official documentation describes it very well.
To install plugin for Qt Designer or Qt Creator you need to place the plugin to plugins\designer directory.
For Qt Creator it is located in it's bin directory.
Qt Designer is a part of Qt installation so directory will be QTDIR\plugins\designer where QTDIR is Qt installation path (for me it is "E:\DEV\Qt\5.5\msvc2015_desktop_shared" and full plugins path is "E:\DEV\Qt\5.5\msvc2015_desktop_shared\plugins\designer").
One important thing - Qt Designer / Qt Creator and the plugin must be compiled using the same compiler version. You can not install plugin compiled with MSVC 2015 to Qt Designer compiled with MSVC 2013!
Edit:
I am using C++ version of Qt.
It looks like echo plugin is not a plugin for Qt Designer / Qt Creator.

Fresh Qt installation does not run Qt projects, including many of Qt Example projects, says “shader program not linked”

Yesterday I installed Qt 5.4 on my windows 7 PC. But I can not build and run any Qt project including those given in Examples section on the Welcome page of Qt Creator 3.3 except for a few. Also, I can’t run any qml file either using this command from cmd: “qmlscene myqmlfile.qml”
Please note that I have added this path to my environment variables:
C:\Qt\Qt5.4.0\5.4\mingw491_32\bin
and Qt installation directory is
C:\Qt
The error message I get in the output window in Qt creator, and in console when running a qml file from cmd, is as follows:
QOpenGLShaderProgram::uniformLocation( qt_Matrix ): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:
""
Previously, I used PyQt5, and ran qml files using the command
qmlscene myqmlfile.qml
without any problem. Then installed Qt Creator 3.3 to run Qt projects, but failed (got some error saying problem in qmake). Finally I uninstalled PyQt5 and Qt Creator 3.3, downloaded Qt 5.4 and installed it, but still could not run Qt projects.
I found in some website, that I need open GL 2.0 to run Qt projects in Qt 5.4. How do I make sure that I have openGL 2.0? (I checked with GPU-Z and it shows my shader model 2.0 and I don’t know if it has anything to do with OpenGL :( )
Please help me correct whatever is wrong with my Qt installation. This is freaking annoying.
Make sure you have Intel Graphics Driver installed from Intel. Microsoft's default drivers do not include OpenGL support.

Resources