Split window upon new C++ class creation in QtCreator - qt-creator

Is it possible to customize QtCreator to make it automatically split editor with header and code files upon creating new C++ class in QtCreator?

It's not exactly what you asked for but did you know about the OpenHeaderSourceInNextSplit command (Ctrl+E,F4)? As the wizard opens up the cpp file automatically it might be good enough to hit that after creation.
Alternatively, You might be able to achieve it by creating a custom wizard?

Related

Visual Studio 2021 "A project with an Output Type of Class library cannot be started directly"

Very new to Visual Studio. I am just trying to run a simple hello world but I can't get past the debugging. I believe there's probably something wrong with the Output type but no matter what I choose I still get an error message and there aren't that many other settings I can change.
"in order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project" I honestly don't know how to interpret this. What executable project?
Error message with class library as output type
I think the other output types don't apply anyway as it's not a windows application or console application. I have also tried right-clicking on project and selecting "Set as startup project" but I still get the same message.
Any help is much appreciated.
Without seeing any of your code this could be a shot in the dark - but lets try.
When creating a new project, if you expect to create a simple console application that runs, then select "Console App" from the Wizard in Visual Studio.
A class library is, at it says, a library. Somewhere information can be stored and looked at by other projects\files.
It could be a place for all your logic, all your classes, whatever - but the invocation of any item in the class library is done from a different project which has a runtime.
If your trying do debug an existing project, then i guess there is references to other projects within your solution as well. Right click on what should be your "main point of entry", and select "Set as startup project".
If this doesnt help, then please provide more details \ screenshots of how your project is setup and what your trying to achieve.
Turns out my output type was in fact wrong and my little hello world was a console application. not a class library. I still don't understand the difference between the windows, console and class type outputs though. Anyway, I changed the startup object to the class object and it did the trick.

Prevent Xcode from opening new files

Is there any way to prevent Xcode from opening brand new files? Let me explain. Everytime I create a new file (Xib, .swift, .storyboard, etc...) Xcode opens that new file automatically in the standard editor. This functionality kinda annoys me because something I just want to create the file and maybe open it on the assistance editor instead or just to work on the file later. I tried changing some of the Xcode's behavior but I don't see any ways where I can trigger an action when certain events occur (like creating a new file).
Well here's one way:
Create a folder full of empty files of various types (with various extensions) that you typically create. Then whenenver you want a new file, rather than telling Xcode to create a new file, use the "Add Files to ..." command and choose one of those files. Just remember to also check the checkbox "Copy items if needed".
Doing this won't open the added file.
As an added benefit, you could also make some versions of these files pre-seeded with code or comments or whatever else that you often keep re-typing into many of your new files.

IDE: Apply property sheet to actual project settings

is anybody aware of a way to apply (as in write or transfer) the settings of a Visual studio property sheet to the actual properties of the project (so they appear explicitly in .vcxproj file)?
I would like to load in a property sheet, transfer the settings to the "real" project's properties (not inherit the settings from the sheet!) so I can remove the property sheet afterward again.
Does the VS IDE allow this?
I am looking for a clickable solution, not a manual transfer.
Thanks in advance
There is no built-in way to do this though you could program an extension or external executable (which is easy to invoke as External Tool in VS) to do this, using e.g the Project class. But it is not that trivial: what do to when conflicting properties are found? Replace them? Combine them? Moreover it sort of defeats the entire purpose of propertysheets which is having a reusable set of options for building.

Create custom file type handler for Visual Studio with code generation on save

I'm new in Visual Studio extension creation.
I need to create a such extension for C++ projects, which will:
handle provided file type (by extension);
syntax highlighting for provided file;
code generation on file change event.
In common i need to write some information to file, handle file change event and generate a set of files. and it will be nice to add automatically all generated files to my c++ solution.
Could any one advise on is it possible in common, what should i read to make this? thanks

Customise Default WinMain.cpp on Project Creation

When I create a new Win32 Project in Microsoft Visual C++ 2010 Express and it creates the default WinMain.cpp file with the default WinMain function...
Is it possible to load a different WinMain.cpp file, ie, my own WinMain.cpp file/template?
Hope that makes sense. To be more specific, I want to have different default code in WinMain.cpp whenever I create a new Win32 Project.
I have done it years ago with VC6 - it is known as Custom Project Wizard.
In New Project -> General select Custom Wizard to start off.
Using custom wizard, you can create a new wizard type to create project. You'd setup the wizard as per your needs, code the logic and things like that. Once done, and registered your wizard will come as another type.
Check this: http://msdn.microsoft.com/en-us/library/vstudio/bhceedxx.aspx

Resources