2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qitemeditorfactory.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
2024-11-19 06:29:06 +00:00
|
|
|
"runtime/cgo"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QItemEditorCreatorBase struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QItemEditorCreatorBase
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QItemEditorCreatorBase) cPointer() *C.QItemEditorCreatorBase {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QItemEditorCreatorBase) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQItemEditorCreatorBase constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQItemEditorCreatorBase(h *C.QItemEditorCreatorBase) *QItemEditorCreatorBase {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QItemEditorCreatorBase{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQItemEditorCreatorBase constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQItemEditorCreatorBase(h unsafe.Pointer) *QItemEditorCreatorBase {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QItemEditorCreatorBase{h: (*C.QItemEditorCreatorBase)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QItemEditorCreatorBase) CreateWidget(parent *QWidget) *QWidget {
|
2024-11-19 06:29:06 +00:00
|
|
|
return UnsafeNewQWidget(unsafe.Pointer(C.QItemEditorCreatorBase_CreateWidget(this.h, parent.cPointer())), nil, nil)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QItemEditorCreatorBase) ValuePropertyName() []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QItemEditorCreatorBase_ValuePropertyName(this.h)
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QItemEditorCreatorBase) OperatorAssign(param1 *QItemEditorCreatorBase) {
|
|
|
|
C.QItemEditorCreatorBase_OperatorAssign(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QItemEditorCreatorBase) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QItemEditorCreatorBase_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 *QItemEditorCreatorBase) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QItemEditorCreatorBase) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QItemEditorFactory struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QItemEditorFactory
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QItemEditorFactory) cPointer() *C.QItemEditorFactory {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QItemEditorFactory) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQItemEditorFactory constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQItemEditorFactory(h *C.QItemEditorFactory) *QItemEditorFactory {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QItemEditorFactory{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQItemEditorFactory constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQItemEditorFactory(h unsafe.Pointer) *QItemEditorFactory {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QItemEditorFactory{h: (*C.QItemEditorFactory)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQItemEditorFactory constructs a new QItemEditorFactory object.
|
|
|
|
func NewQItemEditorFactory() *QItemEditorFactory {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QItemEditorFactory *C.QItemEditorFactory = nil
|
|
|
|
|
|
|
|
C.QItemEditorFactory_new(&outptr_QItemEditorFactory)
|
|
|
|
ret := newQItemEditorFactory(outptr_QItemEditorFactory)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQItemEditorFactory2 constructs a new QItemEditorFactory object.
|
|
|
|
func NewQItemEditorFactory2(param1 *QItemEditorFactory) *QItemEditorFactory {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QItemEditorFactory *C.QItemEditorFactory = nil
|
|
|
|
|
|
|
|
C.QItemEditorFactory_new2(param1.cPointer(), &outptr_QItemEditorFactory)
|
|
|
|
ret := newQItemEditorFactory(outptr_QItemEditorFactory)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QItemEditorFactory) CreateEditor(userType int, parent *QWidget) *QWidget {
|
2024-11-19 06:29:06 +00:00
|
|
|
return UnsafeNewQWidget(unsafe.Pointer(C.QItemEditorFactory_CreateEditor(this.h, (C.int)(userType), parent.cPointer())), nil, nil)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QItemEditorFactory) ValuePropertyName(userType int) []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QItemEditorFactory_ValuePropertyName(this.h, (C.int)(userType))
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QItemEditorFactory) RegisterEditor(userType int, creator *QItemEditorCreatorBase) {
|
|
|
|
C.QItemEditorFactory_RegisterEditor(this.h, (C.int)(userType), creator.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QItemEditorFactory_DefaultFactory() *QItemEditorFactory {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQItemEditorFactory(unsafe.Pointer(C.QItemEditorFactory_DefaultFactory()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QItemEditorFactory_SetDefaultFactory(factory *QItemEditorFactory) {
|
|
|
|
C.QItemEditorFactory_SetDefaultFactory(factory.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
func (this *QItemEditorFactory) callVirtualBase_CreateEditor(userType int, parent *QWidget) *QWidget {
|
|
|
|
|
|
|
|
return UnsafeNewQWidget(unsafe.Pointer(C.QItemEditorFactory_virtualbase_CreateEditor(unsafe.Pointer(this.h), (C.int)(userType), parent.cPointer())), nil, nil)
|
|
|
|
}
|
|
|
|
func (this *QItemEditorFactory) OnCreateEditor(slot func(super func(userType int, parent *QWidget) *QWidget, userType int, parent *QWidget) *QWidget) {
|
|
|
|
C.QItemEditorFactory_override_virtual_CreateEditor(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QItemEditorFactory_CreateEditor
|
|
|
|
func miqt_exec_callback_QItemEditorFactory_CreateEditor(self *C.QItemEditorFactory, cb C.intptr_t, userType C.int, parent *C.QWidget) *C.QWidget {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(userType int, parent *QWidget) *QWidget, userType int, parent *QWidget) *QWidget)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := (int)(userType)
|
|
|
|
|
|
|
|
slotval2 := UnsafeNewQWidget(unsafe.Pointer(parent), nil, nil)
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QItemEditorFactory{h: self}).callVirtualBase_CreateEditor, slotval1, slotval2)
|
|
|
|
|
|
|
|
return virtualReturn.cPointer()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QItemEditorFactory) callVirtualBase_ValuePropertyName(userType int) []byte {
|
|
|
|
|
|
|
|
var _bytearray C.struct_miqt_string = C.QItemEditorFactory_virtualbase_ValuePropertyName(unsafe.Pointer(this.h), (C.int)(userType))
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
func (this *QItemEditorFactory) OnValuePropertyName(slot func(super func(userType int) []byte, userType int) []byte) {
|
|
|
|
C.QItemEditorFactory_override_virtual_ValuePropertyName(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QItemEditorFactory_ValuePropertyName
|
|
|
|
func miqt_exec_callback_QItemEditorFactory_ValuePropertyName(self *C.QItemEditorFactory, cb C.intptr_t, userType C.int) C.struct_miqt_string {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(userType int) []byte, userType int) []byte)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
slotval1 := (int)(userType)
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QItemEditorFactory{h: self}).callVirtualBase_ValuePropertyName, slotval1)
|
|
|
|
virtualReturn_alias := C.struct_miqt_string{}
|
|
|
|
virtualReturn_alias.data = (*C.char)(unsafe.Pointer(&virtualReturn[0]))
|
|
|
|
virtualReturn_alias.len = C.size_t(len(virtualReturn))
|
|
|
|
|
|
|
|
return virtualReturn_alias
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QItemEditorFactory) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QItemEditorFactory_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 *QItemEditorFactory) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QItemEditorFactory) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|