2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qcolumnview.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QColumnView struct {
|
|
|
|
h *C.QColumnView
|
|
|
|
*QAbstractItemView
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) cPointer() *C.QColumnView {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQColumnView(h *C.QColumnView) *QColumnView {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QColumnView{h: h, QAbstractItemView: newQAbstractItemView_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQColumnView_U(h unsafe.Pointer) *QColumnView {
|
|
|
|
return newQColumnView((*C.QColumnView)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColumnView constructs a new QColumnView object.
|
|
|
|
func NewQColumnView() *QColumnView {
|
|
|
|
ret := C.QColumnView_new()
|
|
|
|
return newQColumnView(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQColumnView2 constructs a new QColumnView object.
|
|
|
|
func NewQColumnView2(parent *QWidget) *QColumnView {
|
|
|
|
ret := C.QColumnView_new2(parent.cPointer())
|
|
|
|
return newQColumnView(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) MetaObject() *QMetaObject {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMetaObject_U(unsafe.Pointer(C.QColumnView_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QColumnView) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
|
|
|
return C.QColumnView_Metacast(this.h, param1_Cstring)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QColumnView_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.QColumnView_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 QColumnView_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.QColumnView_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 *QColumnView) UpdatePreviewWidget(index *QModelIndex) {
|
|
|
|
C.QColumnView_UpdatePreviewWidget(this.h, index.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QColumnView) OnUpdatePreviewWidget(slot func(index *QModelIndex)) {
|
|
|
|
C.QColumnView_connect_UpdatePreviewWidget(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_QColumnView_UpdatePreviewWidget
|
|
|
|
func miqt_exec_callback_QColumnView_UpdatePreviewWidget(cb *C.void, index *C.QModelIndex) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func(index *QModelIndex))
|
|
|
|
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
|
2024-09-17 07:30:27 +00:00
|
|
|
slotval1 := newQModelIndex_U(unsafe.Pointer(index))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) IndexAt(point *QPoint) *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColumnView_IndexAt(this.h, point.cPointer())
|
|
|
|
_goptr := newQModelIndex(_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
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QColumnView) ScrollTo(index *QModelIndex) {
|
|
|
|
C.QColumnView_ScrollTo(this.h, index.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QColumnView) SizeHint() *QSize {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColumnView_SizeHint(this.h)
|
|
|
|
_goptr := newQSize(_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 *QColumnView) VisualRect(index *QModelIndex) *QRect {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QColumnView_VisualRect(this.h, index.cPointer())
|
|
|
|
_goptr := newQRect(_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 *QColumnView) SetModel(model *QAbstractItemModel) {
|
|
|
|
C.QColumnView_SetModel(this.h, model.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) SetSelectionModel(selectionModel *QItemSelectionModel) {
|
|
|
|
C.QColumnView_SetSelectionModel(this.h, selectionModel.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) SetRootIndex(index *QModelIndex) {
|
|
|
|
C.QColumnView_SetRootIndex(this.h, index.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) SelectAll() {
|
|
|
|
C.QColumnView_SelectAll(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) SetResizeGripsVisible(visible bool) {
|
|
|
|
C.QColumnView_SetResizeGripsVisible(this.h, (C.bool)(visible))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) ResizeGripsVisible() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QColumnView_ResizeGripsVisible(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) PreviewWidget() *QWidget {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQWidget_U(unsafe.Pointer(C.QColumnView_PreviewWidget(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) SetPreviewWidget(widget *QWidget) {
|
|
|
|
C.QColumnView_SetPreviewWidget(this.h, widget.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) SetColumnWidths(list []int) {
|
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-01 05:51:28 +00:00
|
|
|
list_CArray := (*[0xffff]C.int)(C.malloc(C.size_t(8 * len(list))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(list_CArray))
|
|
|
|
for i := range list {
|
|
|
|
list_CArray[i] = (C.int)(list[i])
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
list_ma := &C.struct_miqt_array{len: C.size_t(len(list)), data: unsafe.Pointer(list_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(list_ma))
|
|
|
|
C.QColumnView_SetColumnWidths(this.h, list_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QColumnView) ColumnWidths() []int {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QColumnView_ColumnWidths(this.h)
|
|
|
|
_ret := make([]int, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = (int)(_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 QColumnView_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.QColumnView_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 QColumnView_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.QColumnView_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 QColumnView_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.QColumnView_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 QColumnView_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.QColumnView_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 *QColumnView) ScrollTo2(index *QModelIndex, hint QAbstractItemView__ScrollHint) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QColumnView_ScrollTo2(this.h, index.cPointer(), (C.int)(hint))
|
2024-08-29 07:01:51 +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 *QColumnView) Delete() {
|
|
|
|
C.QColumnView_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 *QColumnView) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QColumnView) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|