[Qt-interest] Problem with MFC to Qt migration using qt-vs-addin-1.0.2 in VisualStudio2005

Oliver Wolff oliver.wolff at nokia.com
Thu Sep 24 15:12:11 CEST 2009


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