mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
197 lines
6.2 KiB
Go
197 lines
6.2 KiB
Go
|
package qt6
|
||
|
|
||
|
/*
|
||
|
|
||
|
#include "gen_qcommandlinkbutton.h"
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
*/
|
||
|
import "C"
|
||
|
|
||
|
import (
|
||
|
"runtime"
|
||
|
"unsafe"
|
||
|
)
|
||
|
|
||
|
type QCommandLinkButton struct {
|
||
|
h *C.QCommandLinkButton
|
||
|
*QPushButton
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) cPointer() *C.QCommandLinkButton {
|
||
|
if this == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return this.h
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) UnsafePointer() unsafe.Pointer {
|
||
|
if this == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return unsafe.Pointer(this.h)
|
||
|
}
|
||
|
|
||
|
func newQCommandLinkButton(h *C.QCommandLinkButton) *QCommandLinkButton {
|
||
|
if h == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return &QCommandLinkButton{h: h, QPushButton: UnsafeNewQPushButton(unsafe.Pointer(h))}
|
||
|
}
|
||
|
|
||
|
func UnsafeNewQCommandLinkButton(h unsafe.Pointer) *QCommandLinkButton {
|
||
|
return newQCommandLinkButton((*C.QCommandLinkButton)(h))
|
||
|
}
|
||
|
|
||
|
// NewQCommandLinkButton constructs a new QCommandLinkButton object.
|
||
|
func NewQCommandLinkButton() *QCommandLinkButton {
|
||
|
ret := C.QCommandLinkButton_new()
|
||
|
return newQCommandLinkButton(ret)
|
||
|
}
|
||
|
|
||
|
// NewQCommandLinkButton2 constructs a new QCommandLinkButton object.
|
||
|
func NewQCommandLinkButton2(text string) *QCommandLinkButton {
|
||
|
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))
|
||
|
ret := C.QCommandLinkButton_new2(text_ms)
|
||
|
return newQCommandLinkButton(ret)
|
||
|
}
|
||
|
|
||
|
// NewQCommandLinkButton3 constructs a new QCommandLinkButton object.
|
||
|
func NewQCommandLinkButton3(text string, description string) *QCommandLinkButton {
|
||
|
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))
|
||
|
description_ms := C.struct_miqt_string{}
|
||
|
description_ms.data = C.CString(description)
|
||
|
description_ms.len = C.size_t(len(description))
|
||
|
defer C.free(unsafe.Pointer(description_ms.data))
|
||
|
ret := C.QCommandLinkButton_new3(text_ms, description_ms)
|
||
|
return newQCommandLinkButton(ret)
|
||
|
}
|
||
|
|
||
|
// NewQCommandLinkButton4 constructs a new QCommandLinkButton object.
|
||
|
func NewQCommandLinkButton4(parent *QWidget) *QCommandLinkButton {
|
||
|
ret := C.QCommandLinkButton_new4(parent.cPointer())
|
||
|
return newQCommandLinkButton(ret)
|
||
|
}
|
||
|
|
||
|
// NewQCommandLinkButton5 constructs a new QCommandLinkButton object.
|
||
|
func NewQCommandLinkButton5(text string, parent *QWidget) *QCommandLinkButton {
|
||
|
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))
|
||
|
ret := C.QCommandLinkButton_new5(text_ms, parent.cPointer())
|
||
|
return newQCommandLinkButton(ret)
|
||
|
}
|
||
|
|
||
|
// NewQCommandLinkButton6 constructs a new QCommandLinkButton object.
|
||
|
func NewQCommandLinkButton6(text string, description string, parent *QWidget) *QCommandLinkButton {
|
||
|
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))
|
||
|
description_ms := C.struct_miqt_string{}
|
||
|
description_ms.data = C.CString(description)
|
||
|
description_ms.len = C.size_t(len(description))
|
||
|
defer C.free(unsafe.Pointer(description_ms.data))
|
||
|
ret := C.QCommandLinkButton_new6(text_ms, description_ms, parent.cPointer())
|
||
|
return newQCommandLinkButton(ret)
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) MetaObject() *QMetaObject {
|
||
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QCommandLinkButton_MetaObject(this.h)))
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) Metacast(param1 string) unsafe.Pointer {
|
||
|
param1_Cstring := C.CString(param1)
|
||
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
||
|
return (unsafe.Pointer)(C.QCommandLinkButton_Metacast(this.h, param1_Cstring))
|
||
|
}
|
||
|
|
||
|
func QCommandLinkButton_Tr(s string) string {
|
||
|
s_Cstring := C.CString(s)
|
||
|
defer C.free(unsafe.Pointer(s_Cstring))
|
||
|
var _ms C.struct_miqt_string = C.QCommandLinkButton_Tr(s_Cstring)
|
||
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
||
|
C.free(unsafe.Pointer(_ms.data))
|
||
|
return _ret
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) Description() string {
|
||
|
var _ms C.struct_miqt_string = C.QCommandLinkButton_Description(this.h)
|
||
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
||
|
C.free(unsafe.Pointer(_ms.data))
|
||
|
return _ret
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) SetDescription(description string) {
|
||
|
description_ms := C.struct_miqt_string{}
|
||
|
description_ms.data = C.CString(description)
|
||
|
description_ms.len = C.size_t(len(description))
|
||
|
defer C.free(unsafe.Pointer(description_ms.data))
|
||
|
C.QCommandLinkButton_SetDescription(this.h, description_ms)
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) SizeHint() *QSize {
|
||
|
_ret := C.QCommandLinkButton_SizeHint(this.h)
|
||
|
_goptr := newQSize(_ret)
|
||
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
||
|
return _goptr
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) HeightForWidth(param1 int) int {
|
||
|
return (int)(C.QCommandLinkButton_HeightForWidth(this.h, (C.int)(param1)))
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) MinimumSizeHint() *QSize {
|
||
|
_ret := C.QCommandLinkButton_MinimumSizeHint(this.h)
|
||
|
_goptr := newQSize(_ret)
|
||
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
||
|
return _goptr
|
||
|
}
|
||
|
|
||
|
func (this *QCommandLinkButton) InitStyleOption(option *QStyleOptionButton) {
|
||
|
C.QCommandLinkButton_InitStyleOption(this.h, option.cPointer())
|
||
|
}
|
||
|
|
||
|
func QCommandLinkButton_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))
|
||
|
var _ms C.struct_miqt_string = C.QCommandLinkButton_Tr2(s_Cstring, c_Cstring)
|
||
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
||
|
C.free(unsafe.Pointer(_ms.data))
|
||
|
return _ret
|
||
|
}
|
||
|
|
||
|
func QCommandLinkButton_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))
|
||
|
var _ms C.struct_miqt_string = C.QCommandLinkButton_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
||
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
||
|
C.free(unsafe.Pointer(_ms.data))
|
||
|
return _ret
|
||
|
}
|
||
|
|
||
|
// Delete this object from C++ memory.
|
||
|
func (this *QCommandLinkButton) Delete() {
|
||
|
C.QCommandLinkButton_Delete(this.h)
|
||
|
}
|
||
|
|
||
|
// 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 *QCommandLinkButton) GoGC() {
|
||
|
runtime.SetFinalizer(this, func(this *QCommandLinkButton) {
|
||
|
this.Delete()
|
||
|
runtime.KeepAlive(this.h)
|
||
|
})
|
||
|
}
|