3
votes

I installed qtcreator on a Ubuntu 11.10

sudo apt-get install qtcreator

the versions installed are: QT Creator 2.2.1, QT 4.7.3

When i start qtcreator, to explore QT C++ examples the button is greyed out/disabled and it says Examples not installed.

Neither does qtdemo show any demo/documentation?

Do i have to install examples, doc separately? If yes, how?

How can i enable examples in qtcreator and documentation in qtdemo?

EDIT: In response to one answer below from @Murtuza Kabul, I tried many things to point qtcreator to correct qt but could not. So I did uninstall qtcreator and qt-sdk and reinstalled qt-sdk. So now qtcreator is what comes with qt-sdk . It still says examples not installed.

4
How was qt libraries installed?? - UmNyobe
@UmNyobe - qtlibraries were installed as apt-get install libqt4-dev libqt4-core - goldenmean

4 Answers

6
votes

I downloaded Qt 5.1 directly from qt-project.org and installed as admin (with sudo) on Linux Mint 12 (based on Ubuntu).

If I started qtcreator as normal user I didn't have examples but if started qtcreator as admin (with sudo) I had all examples.

My problem was with examples folder privilages. It was the only folder without read/execute privilage for all users (/opt/Qt5.1.0/5.1.0/gcc/examples). All other folders inside (and outside) examples had privilages for all users.

EDIT:

I forgot to say - as HostileFork mentioned in comment - sudo chown -R +rx /opt/Qt/5.1.0/gcc/examples was solution to this problem.

EDIT:

As noted by Climax - it should be chmod instead of chown

sudo chmod -R +rx /opt/Qt/5.1.0/gcc/examples

1
votes

enter image description hereYou also need to install qtsdk. It comes with the examples and binaries required to run the qt project. If you install the sdk, it will provide you an interface to update the sdk and install/uninstall different parts of the sdk whereby you will be able to choose if you want to install the examples or not

1
votes

Install the qt4-demos package.

sudo apt-get install qt4-demos

I found the sample code installed in /usr/lib/qt4/demos/. Also the qtdemo program was installed at /usr/lib/x86_64-linux-gnu/qt4/bin/qtdemo.

It seems only a limited set of examples are installed by this package.

0
votes

I had the same problem on Windows 7. How I solved this:

  • I open QT Creator.
  • I select menu-option [Tools]
  • From there I select [Options...]
  • From there I select the [Kits] option on the left-hand side
  • I select the tab [QT Versions]
  • I click The [Add...] button: to add the QT version that I am using... ... I am presented with a windows-explorer screen to select something... ... I go to the main directory on which QT is installed (in my case: C:\Qt)... ... In the explorer "Search" I enter qmake (without the quotes)... ... There is a single qmake EXECUTABLE file displayed - I double-click it!... ... I press [Apply], then [OK].

Walla - it works! I now have examples!