-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shorter "super" parameters for virtual override methods #136
Comments
PaintEvent is not a signal/slot - actually it's a C++ virtual method override. In C++, you should usually call the parent function inside your callback. In therecipe/qt this was exposed as Because Miqt puts it as a parameter, there can be a linter warning if it is not used. But I agree that it's inconvenient to type.
|
For CurrentChanged, it just needs I think 2 parameters void QTreeView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) For PaintEvent, it is a custom type/class void QWidget::paintEvent(QPaintEvent *event) Forgive me for not understanding nuances of cpp, qt or even go.... |
I'd also like to mention how nice it is having a new qt library for go. It compiles as fast as go and current conversions (moving from therecipe) have been very quick. I had also been using therecepie with GO111MODULE=off and now I can use go modules :) Thanks! |
Using Putting it as parameter as it's done now also looks like it introduces a tiny bit of overhead for every call because the "this" parameter must be captured in a closure environment for the callback - not sure if this is significant or not, but it happens even if the "super" call ends up not being called. |
Using QTreeView OnCurrentChanged, to make it work is a little more verbose than my previous code:
However, OnDoubleClicked is the same as previous code. Is there a way to make it use just the two parameters?
I noticed in the examples its also like this
Basically, is there away to remove the need to specify a func inside a func (super func) ?
The text was updated successfully, but these errors were encountered: