qtcreator customize getters and setters - qt-creator

I have lots of member variables in my file i.e. int m_member_var, when I hit alt+enter to auto generate the getters/setters, it give me the settervoid setMember_var(...). But I need set_member_var(...). Is there a way to change the template?
I'm using Qtcreator 3.0.1

Related

How can I modify the template for generating setters in CLion?

In CLion, we can generate setters from fields by: Code -> Generate... -> Setter. But how can I modify the template for the code generation to change, for example, the generated setter parameter name?
As far as I know you can not fully customize it, but you can change some attributes of it under Editor > Code Style > C/C++ Like if prefixes should be added.
Unfortunately, I've got it confirmed from JetBrains that this is currently not possible in CLion.

Override Xcode's default templates

I want to modify Xcode's default templates but only for a given user in my Mac. I tried following the steps in this answer, but instead of overriding the default templates it created new ones. You can see the result in the following image.
Is there any way I can tell Xcode to use only my custom templates without modifying the original files?

Visual Studio DSL interaction with my classes

I'm getting start with DSL, I have build my DSL and I have a T4 template for generate code from a design.
I can create a new element in my project of my DSL type, I can create my design and then I have to run my T4 to generate code.
But, I can see how to work the default Visual Studio Class Diagram, it don't need to run any T4. For example when you drop a class in the diagram it shows a dialog to choose the class name and file.
When I change a class (adding properties for example) by edit the file the diagram update itself the new information (properties, methods, ...). When you add a property in a class using the diagram its update the file adding the correct property ...
How to do it? I'm newbie and I would like to find documentation about it.

How to add method to MFC-ActiveX

The question seems to be stupid since there are many explanations in internet, that describe how to add a new method that can be called by users of the resulting OCX later. Unfortunately it does not work for me.
I have a MFC-based ActiveX-control project that was created with Visual Studio 6 and was imported to VS2010. There I have NO class view where I could use the Wizard with to add a method (the class view tab pane is there but it is empty). The existing code also does not provide any callable methods until now so that I simply could copy them.
So: how can I enable/invoke the class view generation in VS2010 to use the Wizard?
And as soon as it works: What type should such a method be to be externally visible? From what I learned the Wizard asks for some type...
To add a method to your ActiveX control you have to follow the folliwng steps:
1. Declare the function in the header file.
e.g.
public:
int Connect(int timeout);
2. Add the definition in the CPP file.
int CSLWebLinkCtrl::Connect(int timeout)
// Your logic here.
return 0;
}
3. Expose your methods in the .idl file
[id(4), helpstring("method Connect")] int Connect(int timeout);
Hope it will help you. :)
Maybe the SDF file is corrupt?
If you right-click the Class View dialog bar, you should see a context menu option for Class Wizard. From there, you should be able to work with your project's classes.

Custom control in reference does not render correctly

I have made a custom control (round button with a fixed image) and tested that it works. However, I would like to reuse this particular control in other projects and hence thought of making a class library out of it. However, when I try to get the custom control to show in my other applications, the icons does not show even though the button responds to clicks.
I have tried to build the icon in the class library projects as Content and Resources and test but to no avail. (of course, I change the addressing of the icon in the code when I updated its build icon). At the moment, i have decided to leave the icon /icons/myimage.png to be built as Content. And, in the class library code (XAML), i am accessing it as "/icons/myimage.png".
So, would anyone have an idea on how I could get the round button to render properly in my projects? How should I build the class library project?
I would't make a graphics part of my class library, because most likely in the future you will need to customize it, so what I suggest is to make the following property in your custom module and set the image where you use it:
public ImageSource ButtonImage {get { return <button image>; } set { <set button image>; } }
I experimented a bit and found the solution. The idea is to use embedded resource to store the image in the dll. And then for loading it by the CustomControl, one can use constructs like this:
BitmapImage img = new BitmapImage();
img.SetSource(Assembly.GetExecutingAssembly().GetManifestResourceStream("MyLib.icons.my_icon.png"));
MyLib here is the name of the assembly for the class library. icons is the folder where the resource is kept in the assembly.

Resources