add Qt to existing Visual Studio c++ project [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've got an existing Visual Studio C++ project. It creates a main window using GLUT and also uses glut for a right-click context menu.
All I want to do now, is to open a second window used as a property inspector to display and change some values.
Everyone recommends using Qt for GUI development, but all the tutorials I find discuss either working in Qt creator or how to create a Qt project from scratch.
I have used Qt some years ago to do something similar and it was not so difficult to add it to my project.
Can anyone explain, or point me to a tutorial explaining how to do this?
thanks!

Thank to Arno Duvenhage and Tom for their answers. Here are steps who worked for me in Qt 5.2.1 and Visual Studio 2012 and 2015:
Install QT Add In (for visual studio 2015 is in still in beta, but works fully for me).
Right click the project, select "Unload project".
Add add the <keyword>Qt4VSv1.0</keyword> entry into the <PropertyGroup Label="Globals"> tag.
Select load project.
Select "Convert project to Qt Add-in project" in "Qt 5" menu.
Almost done. Go to Qt project settings and Qt option in the Qt menu to set details.
In your project properties Linker\Additional Library Directories\ might need to add $(QTDIR)\lib
In your project properties C++\Additional Include Directories\ might need to add $(QTDIR)\include
In each of your classes derived from Q_OBJECT, delete the Q_OBJECT macro, save the file, return the Q_OBJECT macro (Ctrl+Z), and save again. It adds the 'moc' files to your generated files folder.
Set your project as startup project.

edit your project using an xml editor
i usually unload the project, right click on it and select edit
add the qt version you wish to use (for me it's):
Keyword="Qt4VSv1.0"
and the following globals
<Global
Name="lupdateOnBuild"
Value="0"
/>
<Global
Name="MocDir"
Value=".\GeneratedFiles\$(ConfigurationName)"
/>
<Global
Name="MocOptions"
Value=""
/>
<Global
Name="QtVersion Win32"
Value="QT 4.5.3"
/>
<Global
Name="RccDir"
Value=".\GeneratedFiles"
/>
<Global
Name="UicDir"
Value=".\GeneratedFiles"
/>
reload the project and fiddle with "convert project to QMake generated project" and it should work

This works for me:
manually change the project version to a qt project in the project file -- use <Keyword>Qt4VSv1.0</Keyword>'
reload the project
right click on the project and select 'update to a qt-addin project'
remove and add the qt source files to the project
Hope it helps.

There is an ability of qmake to generate .vcproj from a .pro file. So you should read qmake documentation to create a right .pro file.

Related

Eclipse CDT, CMAKE project: No C/C++ Build Menu Item

Thanks in advance for the help.
This is on Windows/MSYS2 (mingw64) Eclipse CDT Version: 2019-09 R (4.13.0) Build id: 20190917-1200.
I have figured out how to run cmake in order to create an Eclipse compatible project file. I then got the project into Eclipse via I got this File->Open Project from File System. I can then make/build that file and create my executables. I do get a couple warnings regarding improper project path but the code all compiles without error.
However, I need to "connect" the cmake build directory (i.e. the project in Kicad) to my source code in order to edit and/or debug the changes I wish to make. Based on my research I believe I have to do this via the Project Properties C/C++ Build menu, however, this menu is not present. I believe I access this menu by selecting the project on the left and right clicking or alt-enter or from the top menu Project->Properties.
For some reason I can't do a screen grab on Eclipse but I pulled the image attached from the online help file: (https://help.eclipse.org/2019-06/index.jsp)
.
My "Project->Properties" menu looks similar in that it shows Resource, Builders, plus more things but there is no C/C++ Build entry: it just goes from Builders to C/C++ General.
I found this "solution" https://bugs.eclipse.org/bugs/show_bug.cgi?id=508319 which seemed appropriate as I had installed the standalone debugger, however, uninstalling it had no effect.
Any suggestions?
Thanks

VS2019 + Xamarin.Forms = UWP/EXE dropped?

How do I get the UWP back into Xamarin.Forms Cross-Platform creation to have the templates ready to roll?
After picking through the release notes, playing with VS2019's UI and a few hours of web searching, I have only found others posting about the problem in the preview versions. Some say UWP is gone forever, some say it just isn't included by default (so Microsoft can brag about how the install went from 23GB to 8GB or something like that) - but no help on HOW TO re-enable it, or add it to the project creation wizard (apart from adding a blank UWP project sans all code that is in the iOS/Android projects).
<Project Sdk="Microsoft.NET.Sdk">
// the code is not the problem here,
// getting TO the code is the problem
</Project>
EXPECTED:
In VS2017, Xamarin.Forms Cross-Platform supplied iOS + Android + UWP templates by default.
ACTUAL:
Visual Studio 2019 seems to have removed the UWP template from Xamarin.Forms Cross-Platform project creation.
Update 9 apr.: a new version of 2019 was released which reinstates the UWP templates again
It is correct that the UWP template is removed from VS2019, I don't know the reason behind it, but we'll have to deal with it. There is however a page that runs you through the process step by step. It has been there for a while for the projects that were created in Visual Studio for Mac, which don't include the UWP template as well. The full description can be found here: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/platform/windows/installation/ taken from this page:
First, right-click on the solution and select Add > New Project... and add a Blank App (Universal Windows) project:
Then, select the minimum and targeted UWP versions.
Right-click on the UWP project and select Manage NuGet Packages... and add the Xamarin.Forms package. Ensure the other projects in the solution are also updated to the same version of the Xamarin.Forms package.
Also, make sure the new UWP project will be built in the Build > Configuration Manager window (this probably won't have happened by default). Tick the Build and Deploy boxes for the Universal project:
Right-click on the UWP project and select Add > Reference and create a reference to the Xamarin.Forms application project (.NET Standard or Shared Project).
In the UWP project, edit App.xaml.cs to include the Init method call inside the OnLaunched method around line 52:
// under this line
rootFrame.NavigationFailed += OnNavigationFailed;
// add this line
Xamarin.Forms.Forms.Init (e); // requires the `e` parameter
In the UWP project, edit MainPage.xaml by removing the Grid contained within the Page element. Then in MainPage.xaml, add a new xmlns entry for Xamarin.Forms.Platform.UWP, like this: xmlns:forms="using:Xamarin.Forms.Platform.UWP".
In MainPage.xaml, change the root <Page element to <forms:WindowsPage, like this:
<forms:WindowsPage
...
xmlns:forms="using:Xamarin.Forms.Platform.UWP"
...
</forms:WindowsPage>
In the UWP project, edit MainPage.xaml.cs to remove the: Page inheritance specifier for the class name (since it will now inherit from WindowsPage due to the change made in the previous step)
public sealed partial class MainPage // REMOVE ": Page"
In MainPage.xaml.cs, add the LoadApplication call in the MainPage constructor to start the Xamarin.Forms app:
// below this existing line
this.InitializeComponent();
// add this line
LoadApplication(new YOUR_NAMESPACE.App());
Add any local resources (eg. image files) from the existing platform projects that are required.
And now it should work as before. I know, it's a hassle to go through it for something that just worked before. Sorry about that, but this should get you there as well.
With the Update 16.0.1, Microsoft restored the UWP creation on new Xamarin.Forms applications
except when you try to use Shell, which is not available for UWP:
Issues fixed in Visual Studio 2019 version 16.0.1
Add option for Windows (UWP) platform when creating new Xamarin.Forms project from 'Mobile App (Xamarin.Forms)' project
template.
EDIT (7/17/2021): i have started a new xamarin forms solution and it seems all 3 platforms are available again in VS2019 on all prebuilt templates (blank, master-detail, tabbed layout).
thank you, everyone, for your input.
great information!
it helped me steel myself to face the fact:
UWP is gone (for now) from Xamarin.Forms new project scaffolding.
but, the (simplest) solution to the question asked that i have found is:
open VS2017. create new Xamarin.Forms cross-platform project.
once it is open, save-all.
then close VS2017 and open in VS2019 if so desired.

NetBeans - C++ build current project

When you work on NetBeans there is a defined main project.
And when ever you press the build or run button that project is being executed.
I was wondering if there is a way to build the current project I'm viewing.
So say I jump between projects and hit the run button, the project it will run will be the one in my current edit view.
In the newest version of Netbeans, currently 7.2, there's no such things as main project. Hitting F11 or the icon will automatically build the project which file you're viewing.

How do I set up a C++ project in Xcode 4?

This probably has a really obvious answer, but I can't seem to find it. I am trying to use Xcode 4 to program with C++, and I want to create a project, build, and run it through Xcode 4 like I do for other languages. My problem is that I can't find the right type of project to do this.
Check this out : http://www.youtube.com/watch?v=Ey8LK7P1K94 at 2:30 he creates a C++ project.
Or try this:
Open XCode.
File/New Project...
In the "New Project" Assistant, expand the "Command Line Utility" group.
Select "C++ Tool"
Click "Next"
Give a project name and directory, then click "Finish".
Press Cmd-Shift-R to open the Console window. Output will appear there.
Click the "Build and Go" toolbar button.
If you click around in the Mac OS part of New Project, there are a couple of options that I can see with a brief glance. Under Framework & Library there is an STL C++ Library you can access, and then under System Plug-in there's a barebones c++ plug-in you can use.
Is that what you mean, or am I misinterpreting the question?

VS2008 C++ Project Properties Application Settings

I am fairly new to C++ in the VS2008 world. I have experience with C++ up to VC++6.0 but then I converted to C#. I now have run into a project that I need to develop using C++.
So on to my question . . . Specifically in VS2008 (C++ Project), where/how do I set the application level settings such as Version, Name, Description and Trademark?
I know in VC++6.0 there was a simple wizard to do all this but I cannot seem to find the equivalent in VS2008.
Any help or guidance is appreciated.
Thank you!!!
Right click on the project in solution explorer, and add a resource or type Version, then fill in the details. OR, pinch a .rc file from an old vc6 project, add it to the project and edit the details in there.
Add a version resource to the project.