Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Qt Creator, examples are missed

Installed Qt Creator 2.8 in ArchLinux Installed qt5-* (* as every related package) using pacman

examples were not available in the repositories so I used the one in the AUR, qt5-examples

examples are installed under /usr/share/doc/qt/examples

qmake-qt5 -query says:

QT_SYSROOT:
QT_INSTALL_PREFIX:/usr
QT_INSTALL_ARCHDATA:/usr/lib/qt
QT_INSTALL_DATA:/usr/share/qt
QT_INSTALL_DOCS:/usr/share/doc/qt
QT_INSTALL_HEADERS:/usr/include/qt
QT_INSTALL_LIBS:/usr/lib
QT_INSTALL_LIBEXECS:/usr/lib/qt/libexec                                                                                                              
QT_INSTALL_BINS:/usr/lib/qt/bin                                                                                                                      
QT_INSTALL_TESTS:/usr/tests                                                                                                                          
QT_INSTALL_PLUGINS:/usr/lib/qt/plugins                                                                                                               
QT_INSTALL_IMPORTS:/usr/lib/qt/imports                                                                                                               
QT_INSTALL_QML:/usr/lib/qt/qml                                                                                                                       
QT_INSTALL_TRANSLATIONS:/usr/share/qt/translations                                                                                                   
QT_INSTALL_CONFIGURATION:/etc/xdg                                                                                                                    
QT_INSTALL_EXAMPLES:/usr/share/doc/qt/examples                                                                                                       
QT_INSTALL_DEMOS:/usr/share/doc/qt/examples                                                                                                          
QT_HOST_PREFIX:/usr                                                                                                                                  
QT_HOST_DATA:/usr/lib/qt                                                                                                                             
QT_HOST_BINS:/usr/lib/qt/bin                                                                                                                         
QT_HOST_LIBS:/usr/lib                                                                                                                                
QMAKE_SPEC:linux-g++                                                                                                                                 
QMAKE_XSPEC:linux-g++                                                                                                                                
QMAKE_VERSION:3.0
QT_VERSION:5.1.0

which means examples are in the right place

But they are not shown in Qt Creator!

Qt Creator Examples

How can I bring them in qtcreator?

PS: I don't wanna forget about the solution and install SDK.

like image 806
Nixmd Avatar asked Aug 12 '13 02:08

Nixmd


3 Answers

I know OP asked for archlinux but I faced the same issue with Ubuntu 20.04. To solve it I had to install the following two packages:

sudo apt-get install qtbase5-examples qtbase5-doc-html

This will show the basic widget examples.

Additional examples (e.g. qt quick) can be added by installing them explicitly:

sudo apt install qtquickcontrols2-5-examples

To actually get them displayed in qtcreator I had to install:

sudo apt install qt5-doc qt5-doc-html

Here is the output of echo $(apt-mark showmanual | grep -P '(libqt|qt)')

cmake-qt-gui qt5-default qt5-doc qt5-doc-html qtbase5-dev qtbase5-doc-html qtbase5-examples qtcreator qtquickcontrols2-5-examples

Edit:

Also make sure to install the qml modules you need, for example:

sudo apt install qml-module-qtquick-controls2
like image 115
evolved Avatar answered Oct 03 '22 16:10

evolved


Qtcreator cannot detect the example without its html file.

So, in my case I've already installed qtbase5-examples, but could not able to see examples in qtcreator.

After,

sudo apt-get install qtbase5-doc-html

examples are visible in qtcreator. It was the same with qt5serialport-examples.

sudo apt-get install qt5serialport-examples qtserialport5-doc-html

Have a nice one.

like image 29
muhammed kocoglu Avatar answered Oct 03 '22 18:10

muhammed kocoglu


My situation is that qt example folder has no permission to read and execute for non-root users, fixed it and everything OK. In your case:

sudo chmod +rx /usr/share/doc/qt/examples
like image 37
Alston Avatar answered Oct 03 '22 16:10

Alston