August 14, 2010

david drell david drell
Lab Rat
2 posts

Creator can’t find QGraphicsView includes

 

I just installed Qt Creator 2.0.0 built June 21, 2010, on to windows from the binary installer.

Trying to play around with QGraphics view, but none of these includes are found when compiling,

nor found by the Creator intellisence facility.

#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsItem>

I found the includes in c:/Qt/2010.04/qt/include/Qt/

but why can’t Qt Creator find or the compiler find them?

4 replies

August 14, 2010

mario mario
Lab Rat
209 posts

You should first try to clean your build and re-run qmake and see if that fixes the problem (which it should if you can run qmake successfully). This can happen if you have an old build with files pointing to some Qt-SDK:s not longer valid on your system

If qmake isn’t found, check under “Tools/Options/Qt4”. You should at least find one entry. If not, add qmake from c:/Qt/2010.04/… and try again.

Hope this solves the problem.

August 14, 2010

david drell david drell
Lab Rat
2 posts

Thanks Mariio but that did not solve the problem. I just noticed that in my first post the included file names did not show up. Here it is again, with code block markers. Hopefully this time you will see that its QGraphics headers which are the problem. All the other normal class headers show up just fine. qmake is found and the default paths seem to work.

Is there a Qt lib include I need to add to my .pro file to get QGraphics ?

  1. #include <QGraphicsItem>
  2. #include <QGraphicsView>
  3. #include <QGraphicsScene>

August 14, 2010

mario mario
Lab Rat
209 posts

Huh, that is certainly strange. The graphics stuff is included in the Gui module.

My boring answer is that you could try download a new fresh package of the Qt libraries and try using that when compiling.

March 10, 2014

chris16 chris16
Lab Rat
1 posts

I ran into a similar issue. Make sure widgets is included in your .pro file.

 
  ‹‹ Fresh Nokia Qt SDK install - won’t run simulator or package anything      Nokia Qt SDK co-existing with Perl 5.10 ››

You must log in to post a reply. Not a member yet? Register here!