2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qwhatsthis.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QWhatsThis struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QWhatsThis
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QWhatsThis) cPointer() *C.QWhatsThis {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
func newQWhatsThis(h *C.QWhatsThis) *QWhatsThis {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QWhatsThis{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQWhatsThis constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQWhatsThis(h unsafe.Pointer) *QWhatsThis {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQWhatsThis((*C.QWhatsThis)(h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_EnterWhatsThisMode() {
|
|
|
|
C.QWhatsThis_EnterWhatsThisMode()
|
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_InWhatsThisMode() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QWhatsThis_InWhatsThisMode())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_LeaveWhatsThisMode() {
|
|
|
|
C.QWhatsThis_LeaveWhatsThisMode()
|
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_ShowText(pos *QPoint, text string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
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)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_HideText() {
|
|
|
|
C.QWhatsThis_HideText()
|
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_CreateAction() *QAction {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQAction(C.QWhatsThis_CreateAction())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_ShowText3(pos *QPoint, text string, w *QWidget) {
|
2024-10-18 23:53:33 +00:00
|
|
|
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())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_CreateAction1(parent *QObject) *QAction {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQAction(C.QWhatsThis_CreateAction1(parent.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QWhatsThis) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QWhatsThis_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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)
|
|
|
|
})
|
|
|
|
}
|