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
Supported an input method #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Though a few minor changes would be better.
editor/screen.go
Outdated
@@ -58,11 +58,21 @@ type Screen struct { | |||
keyShift core.Qt__Key | |||
} | |||
|
|||
var tooltip *widgets.QLabel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to make tooltip struct Screen's filed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing out.
Actually I started implementing it Screen's field at first, but I got the following error when qtdeploy
and could not solve it.
Would you point out if there is an idea for this error?
../../editor/moc.go:724: ptr.QLabel_PTR undefined (type *Screen has no field or method QLabel_PTR)
../../editor/moc.go:731: ptr.QLabel_PTR undefined (type *Screen has no field or method QLabel_PTR)
../../editor/moc.go:753: unknown field 'QLabel' in struct literal of type Screen
../../editor/moc.go:1000: tmpValue.ConnectDestroyed undefined (type *Screen has no field or method ConnectDestroyed)
../../editor/moc.go:1013: tmpValue.ConnectDestroyed undefined (type *Screen has no field or method ConnectDestroyed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try to run qtmoc
first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it already, but the same situation.
I also tried deleting the .moc file before qtmoc, but I got the same error :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it myself and it was fine. Don't bother then. I can change this after merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate it. I will check the code again when it is merged.
editor/screen.go
Outdated
family := editor.font.fontNew.Family() | ||
size := editor.font.fontNew.PointSize() | ||
ttfont := gui.NewQFont2(family, size, int(gui.QFont__Normal), false) | ||
tooltip.SetFont(ttfont) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just tooltip.SetFont(editor.font.fontNew)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
I didnt know that such a simple implementation would be possible.
I'll fix that way.
This fix is to enable an input method.
I confirmed that it works with macos and Windows.
However, since I am a beginner for both qt and go, I would like you to point out if there is a wrong code. I wrote these codes with reference to neovim-qt.