Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, January 2008
VS2005 header files and qmake


Message 1 in thread

Hi Everybody, 

I am using VS2005 pro and qt 4.3.1. 

Visual studio's (stupid) intellisense seems to rely on header files being included in the project, but adding all of the headers as HEADERS in the .pro file causes MOC to be run on them, even if they don't need it (no QObjects). 

Is there an easy way to declare non QObject header files in the .pro file so that they get included in the VS2005 project, but are not included in the MOC task? 

Thanks in advance, 

Tony Rietwyk.

--
 [ signature omitted ] 

Message 2 in thread

Hi Tony,

I can't help you with an answer to why Intellisense fails (I doubt anyone 
understands that beast), but I can tell you that you're on the wrong track. I 
do have intellisense support on qt classes and methods most of the time, and 
I never have Qt includes as part of my projects.

I believe it is easiest to get it working reasonably well when you use a 
precompiled header and include <QtGui> in it. But sometimes intellisense (in 
all it's intelligence) decides not to give me any Qt hints. Go figure :(

Bo.

On torsdag den 31. Januar 2008, Tony Rietwyk wrote:
> Hi Everybody,
>
> I am using VS2005 pro and qt 4.3.1.
>
> Visual studio's (stupid) intellisense seems to rely on header files being
> included in the project, but adding all of the headers as HEADERS in the
> .pro file causes MOC to be run on them, even if they don't need it (no
> QObjects).
>
> Is there an easy way to declare non QObject header files in the .pro file
> so that they get included in the VS2005 project, but are not included in
> the MOC task?
>
> Thanks in advance,
>
> Tony Rietwyk.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/



-- 
 [ signature omitted ] 

Message 3 in thread

Thanks for replying Bo, 

I am converting Delphi to C++ and Qt. On several occasions, a converted header file causes intellisense problems. As soon as I change one of the classes in the header to be based on QObject, and add a HEADER entry for it in the .pro file, and recreate the project, then suddenly intellisense works on all of the converted classes in that header file. 

When it does work, it can be real typing saver. What makes it so frustrating when the control-J member selection doesn't work, is that hovering the mouse over the variable shows the correct type hint! 

The other problem is that jumping between the declaration and definition gets screwed - jumping from a descendent override declaration to the base implmentation! 

And all MS can suggest is to close the project, delete the .pdb, reopen and rebuild the whole project! 

Tony. 

> -----Original Message-----
> From: Bo Thorsen [mailto:bo@xxxxxxxxxxxxxxxxxxxxx] 
> Sent: Thursday, 31 January 2008 19:34
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: VS2005 header files and qmake
> 
> 
> Hi Tony,
> 
> I can't help you with an answer to why Intellisense fails (I 
> doubt anyone 
> understands that beast), but I can tell you that you're on 
> the wrong track. I 
> do have intellisense support on qt classes and methods most 
> of the time, and 
> I never have Qt includes as part of my projects.
> 
> I believe it is easiest to get it working reasonably well 
> when you use a 
> precompiled header and include <QtGui> in it. But sometimes 
> intellisense (in 
> all it's intelligence) decides not to give me any Qt hints. 
> Go figure :(
> 
> Bo.
> 
> On torsdag den 31. Januar 2008, Tony Rietwyk wrote:
> > Hi Everybody,
> >
> > I am using VS2005 pro and qt 4.3.1.
> >
> > Visual studio's (stupid) intellisense seems to rely on 
> header files being
> > included in the project, but adding all of the headers as 
> HEADERS in the
> > .pro file causes MOC to be run on them, even if they don't 
> need it (no
> > QObjects).
> >
> > Is there an easy way to declare non QObject header files in 
> the .pro file
> > so that they get included in the VS2005 project, but are 
> not included in
> > the MOC task?
> >
> > Thanks in advance,
> >
> > Tony Rietwyk.
> >
> > --
> > To unsubscribe - send a mail to 
> qt-interest-request@xxxxxxxxxxxxx with
> > "unsubscribe" in the subject or the body. List archive and 
> information:
> > http://lists.trolltech.com/qt-interest/
> 
> 
> 
> -- 
> 
> Thorsen Consulting ApS - Qt consulting services
> http://www.thorsen-consulting.dk
> 
> --
> To unsubscribe - send a mail to 
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the 
> subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> 
> 

--
 [ signature omitted ] 

Message 4 in thread

Tony Rietwyk said the following on 31.01.2008 10:09:
> I am converting Delphi to C++ and Qt. On several occasions, a
> converted header file causes intellisense problems. As soon as I
> change one of the classes in the header to be based on QObject, and
> add a HEADER entry for it in the .pro file, and recreate the
> project, then suddenly intellisense works on all of the converted
> classes in that header file.
> 
> When it does work, it can be real typing saver. What makes it so
> frustrating when the control-J member selection doesn't work, is
> that hovering the mouse over the variable shows the correct type
> hint!
> 
> The other problem is that jumping between the declaration and
> definition gets screwed - jumping from a descendent override
> declaration to the base implmentation!
> 
> And all MS can suggest is to close the project, delete the .pdb,
> reopen and rebuild the whole project!

Here's something to try:

Adding Qt projects as unloaded sub-folder targets
-------------------------------------------------
In your projects Solution file, you can create a subfolder, and in 
this subfolder you can load the <QTDIR>/src/src.sln file (you might 
need to 'qmake -tp vc' in that directory first to get the src.sln file)

Leave the projects loaded for a little bit, so the Intellisense has 
the time to index all the sourcefiles. Then, when you seem to get good 
response from the Intellisense in your project, select the sub-folder, 
  right-click and choose "Unload Projects in Solution Folder", then 
save your current solution.

Hopefully this will leave you with good intellisense for all of Qt 
without having to load those projects next time you open your solution 
file.

If the above fails for you
--------------------------
Have you tried Visual Assist X? They have their own 'Intellisense' 
integrated into Visual Studio which is pretty good. Should give you 
proper tab completion without having to mess with adding Qt sources.

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: OpenPGP digital signature


Message 5 in thread

>I am using VS2005 pro and qt 4.3.1.

>Visual studio's (stupid) intellisense seems to rely on header files being 
>included in the project, but adding all of the >headers as HEADERS in the 
>.pro file causes MOC to be run on them, even if they don't need it (no 
>QObjects).

>Is there an easy way to declare non QObject header files in the .pro file 
>so that they get included in the VS2005 >project, but are not included in 
>the MOC task?

Have you tried using the vs integration pack?



--
 [ signature omitted ]