Results 1 to 4 of 4

Thread: Problems with QtPropertyBrowser and VS2012

  1. #1
    Join Date
    Aug 2013
    Posts
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problems with QtPropertyBrowser and VS2012

    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/0B3IV...it?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.
    Last edited by QtNewbieNeedsHelp; 18th August 2013 at 03:19.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problems with QtPropertyBrowser and VS2012

    looks like you haven't set up includes properly, or maybe have paths to the wrong Qt install in your environment
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Aug 2013
    Posts
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problems with QtPropertyBrowser and VS2012

    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.

  4. #4
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems with QtPropertyBrowser and VS2012

    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.

Similar Threads

  1. Replies: 0
    Last Post: 3rd May 2013, 16:53
  2. Environment variable in vs2012 for Qt5
    By TorAn in forum Installation and Deployment
    Replies: 1
    Last Post: 18th March 2013, 02:59
  3. Build qt 4.8.3 with openssl with VS2012
    By Edder in forum Installation and Deployment
    Replies: 1
    Last Post: 12th December 2012, 18:08
  4. QtPropertyBrowser with a QStandardItemModel
    By mclark in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2010, 08:51
  5. Replies: 0
    Last Post: 23rd November 2009, 09:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.