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

Qt-interest Archive, May 2007
VS.Net 2003-- "resolve ambiguity" problems vis-a-vis Qt 3 & 4


Message 1 in thread

Hi everyone,

I'm trying to port a Qt3 app to Qt4, and have run the qt3to4 executable on 
all the source code, headers and .cpp files.  While I'm in Visual Studio 
2003 and am compiling, I get some strange messages that tell me something's 
strange.

For example (one of many), VS 2003 tells me that "LeftButton" is not a 
member of QMouseEvent.  When I right-click the code snippet in question 
(QMouseEvent::LeftButton) and try to go to the definition a dialog pops up 
telling me there's an ambiguity that needs to be resolved.  It asks me to 
choose a qnamespace.h file from one of two places-- where I loaded Qt 4.2.2, 
or a "c:\qt3.2.1noncommercial" directory.

The thing is, there is no qt3.2.1 directory on my machine, and never was. 
How did Visual Studio come up with that path?  I've looked through all the 
settings I can find (include paths, etc) and there's no mention of it. 
Obviously, the guy who built the project and gave it to me had that path on 
his hard drive, but he's not me and I can't find any reference to it in the 
project.

I've been spinning my wheels for hours on this.  Aside from the above, there 
are a number of errors involving Qt classes not having various members, when 
in fact they do.  If it helps in the diagnosis, I've defined the QT3_SUPPORT 
preprocessor symbol, to allow all the Qt3 calls the last developer used to 
work correctly now.  If anyone has any ideas what's going on and what I can 
do, I'd appreciate it.  Thanks! 


--
 [ signature omitted ] 

Message 2 in thread

Hi,

qt3to4 doesn't fix everything. 
if a symbol like LeftButton is not found, you probably need to prefix it: Qt::LeftButton

see also http://doc.trolltech.com/4.2/porting4.html

also, where did you define QT3_SUPPORT?

i'd suggest instead of trying to set that symbol manually, it's probably better to let the integration do that for you. (right click on the project and choose 'add Qt Module')

Cheers,
Peter

> -----Ursprüngliche Nachricht-----
> Von: Jim Bancroft [mailto:sdfsk@xxxxxxx]
> Gesendet: Sonntag, 6. Mai 2007 08:11
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: VS.Net 2003-- "resolve ambiguity" problems vis-a-vis Qt 3 & 4
> 
> Hi everyone,
> 
> I'm trying to port a Qt3 app to Qt4, and have run the qt3to4 executable on
> all the source code, headers and .cpp files.  While I'm in Visual Studio
> 2003 and am compiling, I get some strange messages that tell me
> something's
> strange.
> 
> For example (one of many), VS 2003 tells me that "LeftButton" is not a
> member of QMouseEvent.  When I right-click the code snippet in question
> (QMouseEvent::LeftButton) and try to go to the definition a dialog pops up
> telling me there's an ambiguity that needs to be resolved.  It asks me to
> choose a qnamespace.h file from one of two places-- where I loaded Qt
> 4.2.2,
> or a "c:\qt3.2.1noncommercial" directory.
> 
> The thing is, there is no qt3.2.1 directory on my machine, and never was.
> How did Visual Studio come up with that path?  I've looked through all the
> settings I can find (include paths, etc) and there's no mention of it.
> Obviously, the guy who built the project and gave it to me had that path
> on
> his hard drive, but he's not me and I can't find any reference to it in
> the
> project.
> 
> I've been spinning my wheels for hours on this.  Aside from the above,
> there
> are a number of errors involving Qt classes not having various members,
> when
> in fact they do.  If it helps in the diagnosis, I've defined the
> QT3_SUPPORT
> preprocessor symbol, to allow all the Qt3 calls the last developer used to
> work correctly now.  If anyone has any ideas what's going on and what I
> can
> do, I'd appreciate it.  Thanks!
> 
> 
> --
> 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 ]