Skip to content
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

Merged
merged 2 commits into from Jan 4, 2018
Merged

Supported an input method #73

merged 2 commits into from Jan 4, 2018

Conversation

akiyosi
Copy link
Contributor

@akiyosi akiyosi commented Nov 19, 2017

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.

Copy link
Owner

@dzhou121 dzhou121 left a 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
Copy link
Owner

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.

Copy link
Contributor Author

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)

Copy link
Owner

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

Copy link
Contributor Author

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 :(

Copy link
Owner

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.

Copy link
Contributor Author

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)
Copy link
Owner

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)?

Copy link
Contributor Author

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.

@dzhou121 dzhou121 merged commit be84af0 into dzhou121:master Jan 4, 2018
@akiyosi akiyosi deleted the imdev branch April 21, 2018 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants