Auto adding definition and mutator method
-
Thats a nice idea, as far as i can affect the behavior of these methods.
-
[quote author="Schneidi" date="1299866850"]Thats a nice idea, as far as i can affect the behavior of these methods.[/quote]
Obviously. I was thinking about something like this:
@
//not actual code, just an idea
Q_PROPERTY (QString myString READ myString MEMBER m_myString GENERATED_WRITE setMyString GENERATED_NOTIFY myStringChanged)
@The idea is that you specify the member variable to use, and that the macro can generate the getter, setter and/or the signal by using a different keyword than the standard READ and WRITE. In this case, the read method would not be generated, but the write and the signal would be.
-
Ok, but this approach would generate the most basic kind of getter and setter methods right ?
This is a nice way to save much time for basic member access.IMHO it would be enough to generate the mutator methods. If I want to add more logic to these methods i guess that would be a good and easy to maintain approach.
Other IDEs already offer these features. The Creator is a fantastic piece of software but there are some nice features missing yet.
-
Yes, that is the idea. I guess having QtCreator generate the methods would already be a big help, but having them generated by Q_PROPERTY would be more maintainable. Deleting the Q_PROPERTY also gets rid of the generated methods that way.
-
You guys are developers, so I am looking forward to your Merge Requests about those helpers;-)
Seriously: It is not that hard to write them, using the existing examples as a guide. http://qt.gitorious.org/qt-creator/qt-creator/blobs/master/src/plugins/cppeditor/cppquickfixes.cpp has most of the code of the existing ones.
-
I just might... But first, I am going to see how a previous merge request is going to fare. I know it is my turn now for that request, but I have seen others stalled for about a year. Thanks for the ALT-Enter tip though!
-
Believe it or not,
I take this into consideration, but if there is already such a plug-in or whatever why should I do another.
But at the moment my skills arn't at the level to write plug-ins for the creator.Maybe in the near future ^^
-
Andre: We try to process MRs as fast as possible, but sometimes they do stall:-( The people doing the reviews are the developers that work on creator. Unfortunately we all are rather swamped with work... We try to keep up, but some MRs fall through the cracks, others are reviewed but awaiting action by the submitters. Gitorious does not send notification on updates to MRs, so sending a mail to the reviewer does help getting your MRs through the review faster.
Feel free to send me a message if you feel your MR did not get the attention it deserved. I'm happy to poke my coworkers;-)
-
Schneidi: Quickfixes should just be a couple of lines of code, no need to put those into a separate plugin.
-
Tobias, I understand that you do, and I wasn't talking about Creator either but about Qt proper. Perhaps the smaller group working on Creator is a bit more agile and processes merge requests faster. I have no experience with that. I hope the situation will improve for Qt itself too with the implementation of the Open Governance strategy.
-
Andre: Our track record in Qt Creator is unfortunately not perfect, either:-(
All of us here hope to see open governance asap! It will make things so much easier for us!
-
Good news: Just noticed that Qt Creator 2.2 will have support to implement getters and setters based in a Q_PROPERTY.
We still have a few too many bugs open against the 2.2 branch to release a Qt Creator 2.2 beta, but we are working on those right now.
-
[quote]Good news: Just noticed that Qt Creator 2.2 will have support to implement getters and setters based in a Q_PROPERTY.[/quote]
Nice!
Thanks! Is that something added just now by you because of this thread? ;) -
Andre: Actually it was mentioned in the changelog for 2.2.0:-) I was asked to add my changes there, so I had to read it.
-
Hi Tobias,
thats good news can't wait to explore the new feature in the upcomming release.Thanks for the info.
-
[quote author="Schneidi" date="1300212650"]Hi Tobias,
thats good news can't wait to explore the new feature in the upcomming release.Thanks for the info.[/quote]
The current sources are on git - if you don't mind using probably unstable code :)
-
Well this is on option and it depends on how long it takes to release the 2.2 version.
-
The nightly builds are currently using the 2.2 branch as far as I know. So that should be a fast way to test the branch. It is not beta-release ready at this time, but it is rather stable already and the version most of us currently use to develop Qt Creator in.