2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qcompleter.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QCompleter__CompletionMode int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QCompleter__PopupCompletion QCompleter__CompletionMode = 0
|
|
|
|
QCompleter__UnfilteredPopupCompletion QCompleter__CompletionMode = 1
|
|
|
|
QCompleter__InlineCompletion QCompleter__CompletionMode = 2
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QCompleter__ModelSorting int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QCompleter__UnsortedModel QCompleter__ModelSorting = 0
|
|
|
|
QCompleter__CaseSensitivelySortedModel QCompleter__ModelSorting = 1
|
|
|
|
QCompleter__CaseInsensitivelySortedModel QCompleter__ModelSorting = 2
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QCompleter struct {
|
|
|
|
h *C.QCompleter
|
|
|
|
*QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) cPointer() *C.QCompleter {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QCompleter) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQCompleter(h *C.QCompleter) *QCompleter {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-10-16 05:07:56 +00:00
|
|
|
return &QCompleter{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQCompleter(h unsafe.Pointer) *QCompleter {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCompleter((*C.QCompleter)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCompleter constructs a new QCompleter object.
|
|
|
|
func NewQCompleter() *QCompleter {
|
|
|
|
ret := C.QCompleter_new()
|
|
|
|
return newQCompleter(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCompleter2 constructs a new QCompleter object.
|
|
|
|
func NewQCompleter2(model *QAbstractItemModel) *QCompleter {
|
|
|
|
ret := C.QCompleter_new2(model.cPointer())
|
|
|
|
return newQCompleter(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCompleter3 constructs a new QCompleter object.
|
|
|
|
func NewQCompleter3(completions []string) *QCompleter {
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-10-18 23:53:33 +00:00
|
|
|
completions_CArray := (*[0xffff]C.struct_miqt_string)(C.malloc(C.size_t(8 * len(completions))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(completions_CArray))
|
|
|
|
for i := range completions {
|
2024-10-18 23:53:33 +00:00
|
|
|
completions_i_ms := C.struct_miqt_string{}
|
|
|
|
completions_i_ms.data = C.CString(completions[i])
|
|
|
|
completions_i_ms.len = C.size_t(len(completions[i]))
|
|
|
|
defer C.free(unsafe.Pointer(completions_i_ms.data))
|
|
|
|
completions_CArray[i] = completions_i_ms
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
completions_ma := &C.struct_miqt_array{len: C.size_t(len(completions)), data: unsafe.Pointer(completions_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(completions_ma))
|
|
|
|
ret := C.QCompleter_new3(completions_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCompleter(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCompleter4 constructs a new QCompleter object.
|
|
|
|
func NewQCompleter4(parent *QObject) *QCompleter {
|
|
|
|
ret := C.QCompleter_new4(parent.cPointer())
|
|
|
|
return newQCompleter(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCompleter5 constructs a new QCompleter object.
|
|
|
|
func NewQCompleter5(model *QAbstractItemModel, parent *QObject) *QCompleter {
|
|
|
|
ret := C.QCompleter_new5(model.cPointer(), parent.cPointer())
|
|
|
|
return newQCompleter(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCompleter6 constructs a new QCompleter object.
|
|
|
|
func NewQCompleter6(completions []string, parent *QObject) *QCompleter {
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-10-18 23:53:33 +00:00
|
|
|
completions_CArray := (*[0xffff]C.struct_miqt_string)(C.malloc(C.size_t(8 * len(completions))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(completions_CArray))
|
|
|
|
for i := range completions {
|
2024-10-18 23:53:33 +00:00
|
|
|
completions_i_ms := C.struct_miqt_string{}
|
|
|
|
completions_i_ms.data = C.CString(completions[i])
|
|
|
|
completions_i_ms.len = C.size_t(len(completions[i]))
|
|
|
|
defer C.free(unsafe.Pointer(completions_i_ms.data))
|
|
|
|
completions_CArray[i] = completions_i_ms
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
completions_ma := &C.struct_miqt_array{len: C.size_t(len(completions)), data: unsafe.Pointer(completions_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(completions_ma))
|
|
|
|
ret := C.QCompleter_new6(completions_ma, parent.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCompleter(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) MetaObject() *QMetaObject {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QCompleter_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QCompleter) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
return (unsafe.Pointer)(C.QCompleter_Metacast(this.h, param1_Cstring))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QCompleter_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QCompleter_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetWidget(widget *QWidget) {
|
|
|
|
C.QCompleter_SetWidget(this.h, widget.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) Widget() *QWidget {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQWidget(unsafe.Pointer(C.QCompleter_Widget(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetModel(c *QAbstractItemModel) {
|
|
|
|
C.QCompleter_SetModel(this.h, c.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) Model() *QAbstractItemModel {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QCompleter_Model(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QCompleter) SetCompletionMode(mode QCompleter__CompletionMode) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QCompleter_SetCompletionMode(this.h, (C.int)(mode))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QCompleter) CompletionMode() QCompleter__CompletionMode {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QCompleter__CompletionMode)(C.QCompleter_CompletionMode(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QCompleter) SetFilterMode(filterMode MatchFlag) {
|
2024-09-18 01:33:50 +00:00
|
|
|
C.QCompleter_SetFilterMode(this.h, (C.int)(filterMode))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QCompleter) FilterMode() MatchFlag {
|
|
|
|
return (MatchFlag)(C.QCompleter_FilterMode(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QCompleter) Popup() *QAbstractItemView {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQAbstractItemView(unsafe.Pointer(C.QCompleter_Popup(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetPopup(popup *QAbstractItemView) {
|
|
|
|
C.QCompleter_SetPopup(this.h, popup.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QCompleter) SetCaseSensitivity(caseSensitivity CaseSensitivity) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QCompleter_SetCaseSensitivity(this.h, (C.int)(caseSensitivity))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QCompleter) CaseSensitivity() CaseSensitivity {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (CaseSensitivity)(C.QCompleter_CaseSensitivity(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QCompleter) SetModelSorting(sorting QCompleter__ModelSorting) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QCompleter_SetModelSorting(this.h, (C.int)(sorting))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QCompleter) ModelSorting() QCompleter__ModelSorting {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QCompleter__ModelSorting)(C.QCompleter_ModelSorting(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QCompleter) SetCompletionColumn(column int) {
|
|
|
|
C.QCompleter_SetCompletionColumn(this.h, (C.int)(column))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CompletionColumn() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QCompleter_CompletionColumn(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetCompletionRole(role int) {
|
|
|
|
C.QCompleter_SetCompletionRole(this.h, (C.int)(role))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CompletionRole() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QCompleter_CompletionRole(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) WrapAround() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QCompleter_WrapAround(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) MaxVisibleItems() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QCompleter_MaxVisibleItems(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetMaxVisibleItems(maxItems int) {
|
|
|
|
C.QCompleter_SetMaxVisibleItems(this.h, (C.int)(maxItems))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CompletionCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QCompleter_CompletionCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetCurrentRow(row int) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QCompleter_SetCurrentRow(this.h, (C.int)(row)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CurrentRow() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QCompleter_CurrentRow(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CurrentIndex() *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QCompleter_CurrentIndex(this.h)
|
|
|
|
_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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CurrentCompletion() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_CurrentCompletion(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CompletionModel() *QAbstractItemModel {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QCompleter_CompletionModel(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) CompletionPrefix() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_CompletionPrefix(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetCompletionPrefix(prefix string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
prefix_ms := C.struct_miqt_string{}
|
|
|
|
prefix_ms.data = C.CString(prefix)
|
|
|
|
prefix_ms.len = C.size_t(len(prefix))
|
|
|
|
defer C.free(unsafe.Pointer(prefix_ms.data))
|
|
|
|
C.QCompleter_SetCompletionPrefix(this.h, prefix_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) Complete() {
|
|
|
|
C.QCompleter_Complete(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SetWrapAround(wrap bool) {
|
|
|
|
C.QCompleter_SetWrapAround(this.h, (C.bool)(wrap))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) PathFromIndex(index *QModelIndex) string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_PathFromIndex(this.h, index.cPointer())
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) SplitPath(path string) []string {
|
2024-10-18 23:53:33 +00:00
|
|
|
path_ms := C.struct_miqt_string{}
|
|
|
|
path_ms.data = C.CString(path)
|
|
|
|
path_ms.len = C.size_t(len(path))
|
|
|
|
defer C.free(unsafe.Pointer(path_ms.data))
|
|
|
|
var _ma *C.struct_miqt_array = C.QCompleter_SplitPath(this.h, path_ms)
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
2024-10-18 23:53:33 +00:00
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
2024-09-17 07:30:27 +00:00
|
|
|
_ret[i] = _lv_ret
|
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 *QCompleter) Activated(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.QCompleter_Activated(this.h, text_ms)
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
|
|
|
func (this *QCompleter) OnActivated(slot func(text string)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QCompleter_connect_Activated(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QCompleter_Activated
|
2024-10-18 23:53:33 +00:00
|
|
|
func miqt_exec_callback_QCompleter_Activated(cb C.intptr_t, text C.struct_miqt_string) {
|
2024-10-13 06:06:06 +00:00
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(text string))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-18 23:53:33 +00:00
|
|
|
var text_ms C.struct_miqt_string = text
|
|
|
|
text_ret := C.GoStringN(text_ms.data, C.int(int64(text_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(text_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
slotval1 := text_ret
|
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) ActivatedWithIndex(index *QModelIndex) {
|
|
|
|
C.QCompleter_ActivatedWithIndex(this.h, index.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QCompleter) OnActivatedWithIndex(slot func(index *QModelIndex)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QCompleter_connect_ActivatedWithIndex(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QCompleter_ActivatedWithIndex
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QCompleter_ActivatedWithIndex(cb C.intptr_t, index *C.QModelIndex) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(index *QModelIndex))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-16 05:07:56 +00:00
|
|
|
slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) Highlighted(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.QCompleter_Highlighted(this.h, text_ms)
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
|
|
|
func (this *QCompleter) OnHighlighted(slot func(text string)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QCompleter_connect_Highlighted(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QCompleter_Highlighted
|
2024-10-18 23:53:33 +00:00
|
|
|
func miqt_exec_callback_QCompleter_Highlighted(cb C.intptr_t, text C.struct_miqt_string) {
|
2024-10-13 06:06:06 +00:00
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(text string))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-18 23:53:33 +00:00
|
|
|
var text_ms C.struct_miqt_string = text
|
|
|
|
text_ret := C.GoStringN(text_ms.data, C.int(int64(text_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(text_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
slotval1 := text_ret
|
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) HighlightedWithIndex(index *QModelIndex) {
|
|
|
|
C.QCompleter_HighlightedWithIndex(this.h, index.cPointer())
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QCompleter) OnHighlightedWithIndex(slot func(index *QModelIndex)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QCompleter_connect_HighlightedWithIndex(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
//export miqt_exec_callback_QCompleter_HighlightedWithIndex
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QCompleter_HighlightedWithIndex(cb C.intptr_t, index *C.QModelIndex) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(index *QModelIndex))
|
2024-09-14 22:29:05 +00:00
|
|
|
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-10-16 05:07:56 +00:00
|
|
|
slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index))
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QCompleter_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QCompleter_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QCompleter_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QCompleter_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QCompleter_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCompleter) Complete1(rect *QRect) {
|
|
|
|
C.QCompleter_Complete1(this.h, rect.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 *QCompleter) Delete() {
|
|
|
|
C.QCompleter_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 *QCompleter) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QCompleter) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|