2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qdirmodel.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QDirModel__Roles int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QDirModel__Roles__FileIconRole QDirModel__Roles = 1
|
|
|
|
QDirModel__Roles__FilePathRole QDirModel__Roles = 257
|
|
|
|
QDirModel__Roles__FileNameRole QDirModel__Roles = 258
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QDirModel struct {
|
|
|
|
h *C.QDirModel
|
|
|
|
*QAbstractItemModel
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) cPointer() *C.QDirModel {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQDirModel(h *C.QDirModel) *QDirModel {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QDirModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQDirModel_U(h unsafe.Pointer) *QDirModel {
|
|
|
|
return newQDirModel((*C.QDirModel)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDirModel constructs a new QDirModel object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQDirModel(nameFilters []string, filters int, sort int) *QDirModel {
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters))))
|
2024-08-29 07:01:51 +00:00
|
|
|
defer C.free(unsafe.Pointer(nameFilters_CArray))
|
|
|
|
for i := range nameFilters {
|
2024-09-17 07:30:27 +00:00
|
|
|
nameFilters_i_ms := miqt_strdupg(nameFilters[i])
|
|
|
|
defer C.free(nameFilters_i_ms)
|
|
|
|
nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_ma := &C.struct_miqt_array{len: C.size_t(len(nameFilters)), data: unsafe.Pointer(nameFilters_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(nameFilters_ma))
|
|
|
|
ret := C.QDirModel_new(nameFilters_ma, (C.int)(filters), (C.int)(sort))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQDirModel(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDirModel2 constructs a new QDirModel object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQDirModel2() *QDirModel {
|
|
|
|
ret := C.QDirModel_new2()
|
|
|
|
return newQDirModel(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDirModel3 constructs a new QDirModel object.
|
|
|
|
func NewQDirModel3(nameFilters []string, filters int, sort int, parent *QObject) *QDirModel {
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters))))
|
2024-08-29 07:01:51 +00:00
|
|
|
defer C.free(unsafe.Pointer(nameFilters_CArray))
|
|
|
|
for i := range nameFilters {
|
2024-09-17 07:30:27 +00:00
|
|
|
nameFilters_i_ms := miqt_strdupg(nameFilters[i])
|
|
|
|
defer C.free(nameFilters_i_ms)
|
|
|
|
nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms)
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_ma := &C.struct_miqt_array{len: C.size_t(len(nameFilters)), data: unsafe.Pointer(nameFilters_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(nameFilters_ma))
|
|
|
|
ret := C.QDirModel_new3(nameFilters_ma, (C.int)(filters), (C.int)(sort), parent.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQDirModel(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQDirModel4 constructs a new QDirModel object.
|
|
|
|
func NewQDirModel4(parent *QObject) *QDirModel {
|
|
|
|
ret := C.QDirModel_new4(parent.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQDirModel(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) MetaObject() *QMetaObject {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMetaObject_U(unsafe.Pointer(C.QDirModel_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QDirModel_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.QDirModel_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 QDirModel_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.QDirModel_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 *QDirModel) Index(row int, column int) *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_Index(this.h, (C.int)(row), (C.int)(column))
|
|
|
|
_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 *QDirModel) Parent(child *QModelIndex) *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_Parent(this.h, child.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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) RowCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_RowCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) ColumnCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_ColumnCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Data(index *QModelIndex) *QVariant {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_Data(this.h, index.cPointer())
|
|
|
|
_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 *QDirModel) SetData(index *QModelIndex, value *QVariant) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_SetData(this.h, index.cPointer(), value.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QDirModel) HeaderData(section int, orientation Orientation) *QVariant {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_HeaderData(this.h, (C.int)(section), (C.uintptr_t)(orientation))
|
|
|
|
_goptr := newQVariant(_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 *QDirModel) HasChildren() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_HasChildren(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QDirModel) Flags(index *QModelIndex) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_Flags(this.h, index.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Sort(column int) {
|
|
|
|
C.QDirModel_Sort(this.h, (C.int)(column))
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QDirModel) MimeTypes() []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QDirModel_MimeTypes(this.h)
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +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))
|
|
|
|
_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 *QDirModel) MimeData(indexes []QModelIndex) *QMimeData {
|
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-01 05:51:28 +00:00
|
|
|
indexes_CArray := (*[0xffff]*C.QModelIndex)(C.malloc(C.size_t(8 * len(indexes))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(indexes_CArray))
|
|
|
|
for i := range indexes {
|
|
|
|
indexes_CArray[i] = indexes[i].cPointer()
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(indexes_ma))
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMimeData_U(unsafe.Pointer(C.QDirModel_MimeData(this.h, indexes_ma)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QDirModel) DropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_DropMimeData(this.h, data.cPointer(), (C.uintptr_t)(action), (C.int)(row), (C.int)(column), parent.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) SupportedDropActions() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_SupportedDropActions(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QDirModel) SetIconProvider(provider *QFileIconProvider) {
|
|
|
|
C.QDirModel_SetIconProvider(this.h, provider.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) IconProvider() *QFileIconProvider {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQFileIconProvider_U(unsafe.Pointer(C.QDirModel_IconProvider(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) SetNameFilters(filters []string) {
|
2024-09-17 07:30:27 +00:00
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
filters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(filters))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(filters_CArray))
|
|
|
|
for i := range filters {
|
2024-09-17 07:30:27 +00:00
|
|
|
filters_i_ms := miqt_strdupg(filters[i])
|
|
|
|
defer C.free(filters_i_ms)
|
|
|
|
filters_CArray[i] = (*C.struct_miqt_string)(filters_i_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
filters_ma := &C.struct_miqt_array{len: C.size_t(len(filters)), data: unsafe.Pointer(filters_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(filters_ma))
|
|
|
|
C.QDirModel_SetNameFilters(this.h, filters_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) NameFilters() []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QDirModel_NameFilters(this.h)
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +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))
|
|
|
|
_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
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QDirModel) SetFilter(filters int) {
|
|
|
|
C.QDirModel_SetFilter(this.h, (C.int)(filters))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Filter() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_Filter(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) SetSorting(sort int) {
|
|
|
|
C.QDirModel_SetSorting(this.h, (C.int)(sort))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Sorting() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_Sorting(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QDirModel) SetResolveSymlinks(enable bool) {
|
|
|
|
C.QDirModel_SetResolveSymlinks(this.h, (C.bool)(enable))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) ResolveSymlinks() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_ResolveSymlinks(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) SetReadOnly(enable bool) {
|
|
|
|
C.QDirModel_SetReadOnly(this.h, (C.bool)(enable))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) IsReadOnly() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_IsReadOnly(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) SetLazyChildCount(enable bool) {
|
|
|
|
C.QDirModel_SetLazyChildCount(this.h, (C.bool)(enable))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) LazyChildCount() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_LazyChildCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) IndexWithPath(path string) *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
path_ms := miqt_strdupg(path)
|
|
|
|
defer C.free(path_ms)
|
|
|
|
_ret := C.QDirModel_IndexWithPath(this.h, (*C.struct_miqt_string)(path_ms))
|
|
|
|
_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 *QDirModel) IsDir(index *QModelIndex) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_IsDir(this.h, index.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Mkdir(parent *QModelIndex, name string) *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
_ret := C.QDirModel_Mkdir(this.h, parent.cPointer(), (*C.struct_miqt_string)(name_ms))
|
|
|
|
_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 *QDirModel) Rmdir(index *QModelIndex) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_Rmdir(this.h, index.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Remove(index *QModelIndex) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_Remove(this.h, index.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) FilePath(index *QModelIndex) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QDirModel_FilePath(this.h, index.cPointer())
|
|
|
|
_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 *QDirModel) FileName(index *QModelIndex) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QDirModel_FileName(this.h, index.cPointer())
|
|
|
|
_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 *QDirModel) FileIcon(index *QModelIndex) *QIcon {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_FileIcon(this.h, index.cPointer())
|
|
|
|
_goptr := newQIcon(_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 *QDirModel) FileInfo(index *QModelIndex) *QFileInfo {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_FileInfo(this.h, index.cPointer())
|
|
|
|
_goptr := newQFileInfo(_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 *QDirModel) Refresh() {
|
|
|
|
C.QDirModel_Refresh(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func QDirModel_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.QDirModel_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 QDirModel_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.QDirModel_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 QDirModel_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.QDirModel_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 QDirModel_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.QDirModel_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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Index3(row int, column int, parent *QModelIndex) *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_Index3(this.h, (C.int)(row), (C.int)(column), parent.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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) RowCount1(parent *QModelIndex) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_RowCount1(this.h, parent.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) ColumnCount1(parent *QModelIndex) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QDirModel_ColumnCount1(this.h, parent.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QDirModel) Data2(index *QModelIndex, role int) *QVariant {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_Data2(this.h, index.cPointer(), (C.int)(role))
|
|
|
|
_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 *QDirModel) SetData3(index *QModelIndex, value *QVariant, role int) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_SetData3(this.h, index.cPointer(), value.cPointer(), (C.int)(role)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QDirModel) HeaderData3(section int, orientation Orientation, role int) *QVariant {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QDirModel_HeaderData3(this.h, (C.int)(section), (C.uintptr_t)(orientation), (C.int)(role))
|
|
|
|
_goptr := newQVariant(_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 *QDirModel) HasChildren1(index *QModelIndex) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QDirModel_HasChildren1(this.h, index.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QDirModel) Sort2(column int, order SortOrder) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QDirModel_Sort2(this.h, (C.int)(column), (C.uintptr_t)(order))
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QDirModel) Index2(path string, column int) *QModelIndex {
|
2024-09-14 22:29:05 +00:00
|
|
|
path_ms := miqt_strdupg(path)
|
|
|
|
defer C.free(path_ms)
|
|
|
|
_ret := C.QDirModel_Index2(this.h, (*C.struct_miqt_string)(path_ms), (C.int)(column))
|
|
|
|
_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 *QDirModel) Refresh1(parent *QModelIndex) {
|
|
|
|
C.QDirModel_Refresh1(this.h, parent.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 *QDirModel) Delete() {
|
|
|
|
C.QDirModel_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 *QDirModel) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QDirModel) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|