[Qt-interest] Problem with MFC to Qt migration using qt-vs-addin-1.0.2 in VisualStudio2005
Vanbrabant Martin
M.Vanbrabant at televic-education.com
Thu Sep 24 17:32:58 CEST 2009
Thanks Oliver,
Now we're getting close...
The only thing is that the QtGuiClass wizard shows some red text in the
dialog box where I would normally fill out the Class name etc., saying:
"It is impossible to add a QtGuiClass to the current project, as it was not
created using QtVSAddin".
That must be the reason why the "Qt Project Settings" menu item is grayed
out as well (see my original posting).
So basically the question is: how do I make the addin believe that it
created the project...
I already tried by comparing the .vcproj files of a simple project created
with the addin with a simple project created by the MFC app wizard.
I noticed additional include paths, library paths, libs.
I also noticed the VisualStudioProject attribate named "Keyword", which
changes from "Qt4VSv1.0" to "MFCProj"'.
No succes so far...
Martin.
-----Original Message-----
From: Oliver Wolff [mailto:oliver.wolff at nokia.com]
Sent: donderdag 24 september 2009 15:12
To: Vanbrabant Martin
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Problem with MFC to Qt migration using qt-vs-addin-1.0.2 in VisualStudio2005
Hi Martin,
as the Add-In is not the same as the Visual Studio Integration there are
a few differences in how things are handled.
In order to easily include a new dialog into your project you can use
Project->Add Class->Qt4GuiClass and edit the given properties as needed
(e.g. QDialog as base class). The Add-In then creates the needed cpp, h
and ui files and sets up the custom build steps. So I think this is the
easiest way to introduce a new dialog :)
Regards
Olli
ext Vanbrabant Martin schrieb:
> Hello,
>
>
>
> I am using Qt 4.5.2, open source version, configured and built from the
> source distribution for platform win32-msvc2005.
>
> I develop using VisualStudio2005, and have the Visual Studio add-in
> (qt-vs-addin-1.0.2) installed.
>
> Making new Qt applications work fine.
>
>
>
> Now I have to gradually migrate a (huge!) MFC application to Qt.
>
> I am using qt-winmigrate-opensource-2-8 for that purpose.
>
>
>
> I can reconstruct (using qmake -tp vc) .vcproj files for all steps found
> in the help:
>
> http://doc.trolltech.com/solutions/4/qtwinmigrate/winmigrate-walkthrough.html
> .
>
>
>
> Next thing to do is to repeat these steps in my own MFC application.
>
> When I am at the paragraph "A new Qt Dialog" in above walkthrough, I read:
>
> "To add a new dialog we use the Visual Studio integration toolbar's "New
> Qt Dialog" button. We add a Qt Designer .ui file "optionsdialog.ui" to
> the current project, and add the required build steps to generate a C++
> class from that file."
>
>
>
> Now here is the problem: the Visual Studio add-in does not provide this
> toolbar to VisualStudio2005.
>
>
>
> As a workaround, in the solution explorer, I tried the context sensitive
> menu Add.../New Item.../Qt Forms/Qt Dialog Form, which resulted in a new
> .ui file.
>
> I could edit the .ui file with Qt Designer, but when I built the
> project, the .ui file was not processed (I did not get any moc_*.cpp,
> ui_*.h files).
>
> Also, I could not change my project properties (the "Qt Project
> Settings" menu item is grayed out for this project, unlike for self-
> created Qt applications).
>
>
>
> Any idea how to continue here?
>
>
>
> Thanks.
>
--
Oliver Wolff - oliver.wolff (AT) nokia.com
Software Engineer - Nokia, Qt Software
Rudower Chaussee 13, 12489 Berlin, Germany
More information about the Qt-interest-old
mailing list