Skip to content

Crash (segmentation violation) on QCoreApplication_SendEvent #277

@ilius

Description

@ilius

qt6.QCoreApplication_SendEvent causes a crash with *qt.QKeyEvent, but only when PageUp or PageDown is pressed with Alt or Ctrl.

func (app *Application) setupKeyPressEvent(widget KeyPressIface) {
	widget.OnKeyPressEvent(func(super func(event *qt.QKeyEvent), event *qt.QKeyEvent) {
		switch event.Key() {
		case int(qt.Key_PageUp), int(qt.Key_PageDown):
			// crashes (even with recover) if if event.Modifiers() > 0
			// qt.QCoreApplication_SendEvent(app.articleView.Browser.QObject, event.QEvent)
			qt.QCoreApplication_SendEvent(app.entry.QObject, event.QEvent)
		}
	})
}

go.mod: github.com/mappu/miqt v0.11.2
Qt 6.4.2
Go 1.24.6

My code: https://github.com/ilius/ayandict/blob/v3/pkg/application/app_handlers.go#L109

Full stderr log attached.
err.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    troubleshootingInvestigating an issue to determine its status

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions