2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qobject.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QObjectData__ int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QObjectData____CheckForParentChildLoopsWarnDepth QObjectData__ = 4096
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QObjectData struct {
|
|
|
|
h *C.QObjectData
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObjectData) cPointer() *C.QObjectData {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQObjectData(h *C.QObjectData) *QObjectData {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QObjectData{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQObjectData_U(h unsafe.Pointer) *QObjectData {
|
|
|
|
return newQObjectData((*C.QObjectData)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObjectData) DynamicMetaObject() *QMetaObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObjectData_DynamicMetaObject(this.h)
|
|
|
|
return newQMetaObject_U(unsafe.Pointer(_ret))
|
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 *QObjectData) Delete() {
|
|
|
|
C.QObjectData_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 *QObjectData) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QObjectData) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QObject struct {
|
|
|
|
h *C.QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) cPointer() *C.QObject {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQObject(h *C.QObject) *QObject {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QObject{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQObject_U(h unsafe.Pointer) *QObject {
|
|
|
|
return newQObject((*C.QObject)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQObject constructs a new QObject object.
|
|
|
|
func NewQObject() *QObject {
|
|
|
|
ret := C.QObject_new()
|
|
|
|
return newQObject(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQObject2 constructs a new QObject object.
|
|
|
|
func NewQObject2(parent *QObject) *QObject {
|
|
|
|
ret := C.QObject_new2(parent.cPointer())
|
|
|
|
return newQObject(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) MetaObject() *QMetaObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_MetaObject(this.h)
|
|
|
|
return newQMetaObject_U(unsafe.Pointer(_ret))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QObject_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QObject_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Event(event *QEvent) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Event(this.h, event.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) EventFilter(watched *QObject, event *QEvent) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_EventFilter(this.h, watched.cPointer(), event.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) ObjectName() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QObject_ObjectName(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SetObjectName(name string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
C.QObject_SetObjectName(this.h, (*C.struct_miqt_string)(name_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) IsWidgetType() bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_IsWidgetType(this.h)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) IsWindowType() bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_IsWindowType(this.h)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SignalsBlocked() bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_SignalsBlocked(this.h)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) BlockSignals(b bool) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_BlockSignals(this.h, (C.bool)(b))
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Thread() *QThread {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Thread(this.h)
|
|
|
|
return newQThread_U(unsafe.Pointer(_ret))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) MoveToThread(thread *QThread) {
|
|
|
|
C.QObject_MoveToThread(this.h, thread.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QObject) StartTimer(interval int) int {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_StartTimer(this.h, (C.int)(interval))
|
|
|
|
return (int)(_ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QObject) KillTimer(id int) {
|
|
|
|
C.QObject_KillTimer(this.h, (C.int)(id))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Children() []*QObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QObject_Children(this.h)
|
|
|
|
_ret := make([]*QObject, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QObject)(unsafe.Pointer(_ma.data)) // mrs jackson
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = newQObject(_outCast[i])
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SetParent(parent *QObject) {
|
|
|
|
C.QObject_SetParent(this.h, parent.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) InstallEventFilter(filterObj *QObject) {
|
|
|
|
C.QObject_InstallEventFilter(this.h, filterObj.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) RemoveEventFilter(obj *QObject) {
|
|
|
|
C.QObject_RemoveEventFilter(this.h, obj.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func QObject_Connect(sender *QObject, signal *QMetaMethod, receiver *QObject, method *QMetaMethod) *QMetaObject__Connection {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Connect(sender.cPointer(), signal.cPointer(), receiver.cPointer(), method.cPointer())
|
|
|
|
_goptr := newQMetaObject__Connection(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Connect2(sender *QObject, signal string, member string) *QMetaObject__Connection {
|
|
|
|
signal_Cstring := C.CString(signal)
|
|
|
|
defer C.free(unsafe.Pointer(signal_Cstring))
|
|
|
|
member_Cstring := C.CString(member)
|
|
|
|
defer C.free(unsafe.Pointer(member_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Connect2(this.h, sender.cPointer(), signal_Cstring, member_Cstring)
|
|
|
|
_goptr := newQMetaObject__Connection(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QObject_Disconnect(sender *QObject, signal *QMetaMethod, receiver *QObject, member *QMetaMethod) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Disconnect(sender.cPointer(), signal.cPointer(), receiver.cPointer(), member.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func QObject_DisconnectWithQMetaObjectConnection(param1 *QMetaObject__Connection) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_DisconnectWithQMetaObjectConnection(param1.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QObject) DumpObjectTree() {
|
|
|
|
C.QObject_DumpObjectTree(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DumpObjectInfo() {
|
|
|
|
C.QObject_DumpObjectInfo(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DumpObjectTree2() {
|
|
|
|
C.QObject_DumpObjectTree2(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DumpObjectInfo2() {
|
|
|
|
C.QObject_DumpObjectInfo2(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SetProperty(name string, value *QVariant) bool {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_SetProperty(this.h, name_Cstring, value.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Property(name string) *QVariant {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Property(this.h, name_Cstring)
|
|
|
|
_goptr := newQVariant(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DynamicPropertyNames() []QByteArray {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QObject_DynamicPropertyNames(this.h)
|
|
|
|
_ret := make([]QByteArray, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QByteArray)(unsafe.Pointer(_ma.data)) // mrs jackson
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = *newQByteArray(_outCast[i])
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_RegisterUserData() uint {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_RegisterUserData()
|
|
|
|
return (uint)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SetUserData(id uint, data *QObjectUserData) {
|
|
|
|
C.QObject_SetUserData(this.h, (C.uint)(id), data.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) UserData(id uint) *QObjectUserData {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_UserData(this.h, (C.uint)(id))
|
|
|
|
return newQObjectUserData_U(unsafe.Pointer(_ret))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Destroyed() {
|
|
|
|
C.QObject_Destroyed(this.h)
|
|
|
|
}
|
2024-09-07 03:31:00 +00:00
|
|
|
func (this *QObject) OnDestroyed(slot func()) {
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QObject_connect_Destroyed(this.h, unsafe.Pointer(uintptr(cgo.NewHandle(slot))))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_Destroyed
|
|
|
|
func miqt_exec_callback_QObject_Destroyed(cb *C.void) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func())
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-09-07 03:31:00 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
gofunc()
|
2024-09-07 03:31:00 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QObject) Parent() *QObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Parent(this.h)
|
|
|
|
return newQObject_U(unsafe.Pointer(_ret))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Inherits(classname string) bool {
|
|
|
|
classname_Cstring := C.CString(classname)
|
|
|
|
defer C.free(unsafe.Pointer(classname_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Inherits(this.h, classname_Cstring)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DeleteLater() {
|
|
|
|
C.QObject_DeleteLater(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Tr2(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QObject_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Tr3(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QObject_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_TrUtf82(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QObject_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_TrUtf83(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QObject_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QObject) StartTimer2(interval int, timerType TimerType) int {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_StartTimer2(this.h, (C.int)(interval), (C.uintptr_t)(timerType))
|
|
|
|
return (int)(_ret)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func QObject_Connect5(sender *QObject, signal *QMetaMethod, receiver *QObject, method *QMetaMethod, typeVal ConnectionType) *QMetaObject__Connection {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Connect5(sender.cPointer(), signal.cPointer(), receiver.cPointer(), method.cPointer(), (C.uintptr_t)(typeVal))
|
|
|
|
_goptr := newQMetaObject__Connection(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QObject) Connect4(sender *QObject, signal string, member string, typeVal ConnectionType) *QMetaObject__Connection {
|
2024-08-29 07:01:51 +00:00
|
|
|
signal_Cstring := C.CString(signal)
|
|
|
|
defer C.free(unsafe.Pointer(signal_Cstring))
|
|
|
|
member_Cstring := C.CString(member)
|
|
|
|
defer C.free(unsafe.Pointer(member_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QObject_Connect4(this.h, sender.cPointer(), signal_Cstring, member_Cstring, (C.uintptr_t)(typeVal))
|
|
|
|
_goptr := newQMetaObject__Connection(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QObject) Destroyed1(param1 *QObject) {
|
|
|
|
C.QObject_Destroyed1(this.h, param1.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QObject) OnDestroyed1(slot func(param1 *QObject)) {
|
|
|
|
C.QObject_connect_Destroyed1(this.h, unsafe.Pointer(uintptr(cgo.NewHandle(slot))))
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QObject_Destroyed1
|
|
|
|
func miqt_exec_callback_QObject_Destroyed1(cb *C.void, param1 *C.QObject) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func(param1 *QObject))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
param1_ret := param1
|
|
|
|
slotval1 := newQObject_U(unsafe.Pointer(param1_ret))
|
|
|
|
|
|
|
|
gofunc(slotval1)
|
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 *QObject) Delete() {
|
|
|
|
C.QObject_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 *QObject) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QObject) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QObjectUserData struct {
|
|
|
|
h *C.QObjectUserData
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObjectUserData) cPointer() *C.QObjectUserData {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQObjectUserData(h *C.QObjectUserData) *QObjectUserData {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QObjectUserData{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQObjectUserData_U(h unsafe.Pointer) *QObjectUserData {
|
|
|
|
return newQObjectUserData((*C.QObjectUserData)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQObjectUserData constructs a new QObjectUserData object.
|
|
|
|
func NewQObjectUserData() *QObjectUserData {
|
|
|
|
ret := C.QObjectUserData_new()
|
|
|
|
return newQObjectUserData(ret)
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QObjectUserData) Delete() {
|
|
|
|
C.QObjectUserData_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 *QObjectUserData) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QObjectUserData) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QSignalBlocker struct {
|
|
|
|
h *C.QSignalBlocker
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSignalBlocker) cPointer() *C.QSignalBlocker {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSignalBlocker(h *C.QSignalBlocker) *QSignalBlocker {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QSignalBlocker{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQSignalBlocker_U(h unsafe.Pointer) *QSignalBlocker {
|
|
|
|
return newQSignalBlocker((*C.QSignalBlocker)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSignalBlocker constructs a new QSignalBlocker object.
|
|
|
|
func NewQSignalBlocker(o *QObject) *QSignalBlocker {
|
|
|
|
ret := C.QSignalBlocker_new(o.cPointer())
|
|
|
|
return newQSignalBlocker(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSignalBlocker2 constructs a new QSignalBlocker object.
|
|
|
|
func NewQSignalBlocker2(o *QObject) *QSignalBlocker {
|
|
|
|
ret := C.QSignalBlocker_new2(o.cPointer())
|
|
|
|
return newQSignalBlocker(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSignalBlocker) Reblock() {
|
|
|
|
C.QSignalBlocker_Reblock(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSignalBlocker) Unblock() {
|
|
|
|
C.QSignalBlocker_Unblock(this.h)
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSignalBlocker) Delete() {
|
|
|
|
C.QSignalBlocker_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 *QSignalBlocker) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QSignalBlocker) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|