PDA

View Full Version : Problems with QtPropertyBrowser and VS2012



QtNewbieNeedsHelp
18th August 2013, 03:03
hello,

I am pretty new to Qt and I started of with Qt4.3 a while back and recently had to change to Qt5.1 (due to switching to from VS2008 to VS2012).
I used to be able to compile the qtpropertybrowser from the qt-solutions repository into my project.
I downloaded the latest version of it and looked at the examples. I included all the sources in my VS2012 project and hit compile but I got tons of errors (350+).

then I tried to just get it to compile in a much simpler test project.
So I created a Qt Application via the VS "create new Qt project" , I then added all the qtpropertbrowser headers and cpp files to the project. and hit compile

I am getting various other errors with that (althought they seem to be slightly different.

it wont allow me to post all the errors here due to character limit but it seems to fail in stuff like this :

error C2065: 'qVariantValue' : undeclared identifier
error C2275: 'QString' : illegal use of this type as an expression
error C2275: 'QKeySequence' : illegal use of this type as an expression
error C2065: 'qFindChildren' : undeclared identifier
(and a lot more)

I remember this used to work out of the box but it doesn't seem to work anymore. :(


anyone knows what I might be doing wrong ? If I run the samples via the Qt Creator they all work fine.

here a link to my test project on my google drive : https://docs.google.com/file/d/0B3IV9TQwnFeuOEtqNzJoYXo5Skk/edit?usp=sharing

Added after 16 minutes:

If I build the QtPropertyBrowser as a library and include it in my test project I get these errors :

1>------ Rebuild All started: Project: TestQtPropertyBrowser, Configuration: Debug x64 ------
1> Moc'ing testqtpropertybrowser.h...
1> Uic'ing testqtpropertybrowser.ui...
1> Moc'ing qtvariantproperty.h...
1> Moc'ing qttreepropertybrowser.h...
1> Moc'ing qtpropertymanager.h...
1> Moc'ing qtpropertybrowserutils_p.h...
1> Moc'ing qtpropertybrowser.h...
1> Moc'ing qtgroupboxpropertybrowser.h...
1> Moc'ing qteditorfactory.h...
1> Moc'ing qtbuttonpropertybrowser.h...
1> Rcc'ing testqtpropertybrowser.qrc...
1>RCC : warning : No resources in 'C:\Users\Chrys\Documents\Visual Studio 2012\Projects\TestQtPropertyBrowser\testqtproperty browser.qrc'.
1>
1> moc_qtpropertybrowserutils_p.cpp
1> moc_testqtpropertybrowser.cpp
1> main.cpp
1> testqtpropertybrowser.cpp
1> Generating Code...
1> qrc_testqtpropertybrowser.cpp
1>moc_qtpropertybrowserutils_p.obj : error LNK2019: unresolved external symbol "public: void __cdecl QtKeySequenceEdit::setKeySequence(class QKeySequence const &)" (?setKeySequence@QtKeySequenceEdit@@QEAAXAEBVQKeyS equence@@@Z) referenced in function "private: static void __cdecl QtKeySequenceEdit::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@QtKeySequenceEdit@@CAXPEAVQOb ject@@W4Call@QMetaObject@@HPEAPEAX@Z)
1>moc_qtpropertybrowserutils_p.obj : error LNK2019: unresolved external symbol "private: void __cdecl QtKeySequenceEdit::slotClearShortcut(void)" (?slotClearShortcut@QtKeySequenceEdit@@AEAAXXZ) referenced in function "private: static void __cdecl QtKeySequenceEdit::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@QtKeySequenceEdit@@CAXPEAVQOb ject@@W4Call@QMetaObject@@HPEAPEAX@Z)
1>C:\Users\Chrys\Documents\Visual Studio 2012\Projects\TestQtPropertyBrowser\x64\Debug\\Tes tQtPropertyBrowser.exe : fatal error LNK1120: 2 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

EDIT: using the library actually works, I had left the headers in the solution, removing them fixed the problem. Still when I try to include the headers and sources in my project , the build errors remain.

amleto
18th August 2013, 16:43
looks like you haven't set up includes properly, or maybe have paths to the wrong Qt install in your environment

QtNewbieNeedsHelp
18th August 2013, 21:00
As I stated above I am not really doing anything else than adding all headers and cpp files to a test project for a Qt Application, the app runs fine so Qt and the project are working properly.

The readme.txt of the qtpropertybrowser states that I can either build a library from it (which works fine with Qt Creator) or simply add the headers and sources to my project to compile it as part of my solution. This last part doesn't seem to work.

In my initial post is also a link to a simple test project that shows my problem.

pkj
19th August 2013, 10:07
Although this may be off topic and no help to your problem, but my advice will be to abandon qtpropertybrowser if the use case dictates refreshing the browser frequently. It is widget based and not model view based and is too slow. You will be much better off writing one of your own than to depend upon it and waste ur time trying to familiarise urself with its api.