miqt/qt6/gen_qwhatsthis.go

105 lines
2.2 KiB
Go
Raw Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qwhatsthis.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QWhatsThis struct {
2024-11-19 06:29:06 +00:00
h *C.QWhatsThis
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QWhatsThis) cPointer() *C.QWhatsThis {
if this == nil {
return nil
}
return this.h
}
func (this *QWhatsThis) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQWhatsThis constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQWhatsThis(h *C.QWhatsThis) *QWhatsThis {
if h == nil {
return nil
}
return &QWhatsThis{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQWhatsThis constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQWhatsThis(h unsafe.Pointer) *QWhatsThis {
2024-11-19 06:29:06 +00:00
if h == nil {
return nil
}
return &QWhatsThis{h: (*C.QWhatsThis)(h)}
2024-10-20 05:21:03 +00:00
}
func QWhatsThis_EnterWhatsThisMode() {
C.QWhatsThis_EnterWhatsThisMode()
}
func QWhatsThis_InWhatsThisMode() bool {
return (bool)(C.QWhatsThis_InWhatsThisMode())
}
func QWhatsThis_LeaveWhatsThisMode() {
C.QWhatsThis_LeaveWhatsThisMode()
}
func QWhatsThis_ShowText(pos *QPoint, text string) {
text_ms := C.struct_miqt_string{}
text_ms.data = C.CString(text)
text_ms.len = C.size_t(len(text))
defer C.free(unsafe.Pointer(text_ms.data))
C.QWhatsThis_ShowText(pos.cPointer(), text_ms)
}
func QWhatsThis_HideText() {
C.QWhatsThis_HideText()
}
func QWhatsThis_CreateAction() *QAction {
2024-11-19 06:29:06 +00:00
return UnsafeNewQAction(unsafe.Pointer(C.QWhatsThis_CreateAction()), nil)
2024-10-20 05:21:03 +00:00
}
func QWhatsThis_ShowText3(pos *QPoint, text string, w *QWidget) {
text_ms := C.struct_miqt_string{}
text_ms.data = C.CString(text)
text_ms.len = C.size_t(len(text))
defer C.free(unsafe.Pointer(text_ms.data))
C.QWhatsThis_ShowText3(pos.cPointer(), text_ms, w.cPointer())
}
func QWhatsThis_CreateAction1(parent *QObject) *QAction {
2024-11-19 06:29:06 +00:00
return UnsafeNewQAction(unsafe.Pointer(C.QWhatsThis_CreateAction1(parent.cPointer())), nil)
2024-10-20 05:21:03 +00:00
}
// Delete this object from C++ memory.
func (this *QWhatsThis) Delete() {
2024-11-19 06:29:06 +00:00
C.QWhatsThis_Delete(this.h, C.bool(this.isSubclass))
2024-10-20 05:21:03 +00:00
}
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
// from C++ memory once it is unreachable from Go memory.
func (this *QWhatsThis) GoGC() {
runtime.SetFinalizer(this, func(this *QWhatsThis) {
this.Delete()
runtime.KeepAlive(this.h)
})
}