2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qwhatsthis.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-10-16 05:07:56 +00:00
|
|
|
"github.com/mappu/miqt/libmiqt"
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QWhatsThis struct {
|
|
|
|
h *C.QWhatsThis
|
|
|
|
}
|
|
|
|
|
|
|
|
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-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-08-25 04:08:24 +00:00
|
|
|
return &QWhatsThis{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQWhatsThis(h unsafe.Pointer) *QWhatsThis {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQWhatsThis((*C.QWhatsThis)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
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-16 05:07:56 +00:00
|
|
|
text_ms := libmiqt.Strdupg(text)
|
2024-09-14 22:29:05 +00:00
|
|
|
defer C.free(text_ms)
|
|
|
|
C.QWhatsThis_ShowText(pos.cPointer(), (*C.struct_miqt_string)(text_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_HideText() {
|
|
|
|
C.QWhatsThis_HideText()
|
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_CreateAction() *QAction {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQAction(unsafe.Pointer(C.QWhatsThis_CreateAction()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_ShowText3(pos *QPoint, text string, w *QWidget) {
|
2024-10-16 05:07:56 +00:00
|
|
|
text_ms := libmiqt.Strdupg(text)
|
2024-09-14 22:29:05 +00:00
|
|
|
defer C.free(text_ms)
|
|
|
|
C.QWhatsThis_ShowText3(pos.cPointer(), (*C.struct_miqt_string)(text_ms), w.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QWhatsThis_CreateAction1(parent *QObject) *QAction {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQAction(unsafe.Pointer(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() {
|
|
|
|
C.QWhatsThis_Delete(this.h)
|
|
|
|
}
|
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)
|
|
|
|
})
|
|
|
|
}
|