2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qabstractbutton.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QAbstractButton struct {
|
|
|
|
h *C.QAbstractButton
|
|
|
|
*QWidget
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) cPointer() *C.QAbstractButton {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QAbstractButton) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQAbstractButton(h *C.QAbstractButton) *QAbstractButton {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-10-16 05:07:56 +00:00
|
|
|
return &QAbstractButton{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQAbstractButton(h unsafe.Pointer) *QAbstractButton {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQAbstractButton((*C.QAbstractButton)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) MetaObject() *QMetaObject {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractButton_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QAbstractButton) 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.QAbstractButton_Metacast(this.h, param1_Cstring))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QAbstractButton_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.QAbstractButton_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 QAbstractButton_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.QAbstractButton_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 *QAbstractButton) SetText(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.QAbstractButton_SetText(this.h, text_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Text() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QAbstractButton_Text(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 *QAbstractButton) SetIcon(icon *QIcon) {
|
|
|
|
C.QAbstractButton_SetIcon(this.h, icon.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Icon() *QIcon {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QAbstractButton_Icon(this.h)
|
|
|
|
_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 *QAbstractButton) IconSize() *QSize {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QAbstractButton_IconSize(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 *QAbstractButton) SetShortcut(key *QKeySequence) {
|
|
|
|
C.QAbstractButton_SetShortcut(this.h, key.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Shortcut() *QKeySequence {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QAbstractButton_Shortcut(this.h)
|
|
|
|
_goptr := newQKeySequence(_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 *QAbstractButton) SetCheckable(checkable bool) {
|
|
|
|
C.QAbstractButton_SetCheckable(this.h, (C.bool)(checkable))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) IsCheckable() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractButton_IsCheckable(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) IsChecked() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractButton_IsChecked(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) SetDown(down bool) {
|
|
|
|
C.QAbstractButton_SetDown(this.h, (C.bool)(down))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) IsDown() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractButton_IsDown(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) SetAutoRepeat(autoRepeat bool) {
|
|
|
|
C.QAbstractButton_SetAutoRepeat(this.h, (C.bool)(autoRepeat))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) AutoRepeat() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractButton_AutoRepeat(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) SetAutoRepeatDelay(autoRepeatDelay int) {
|
|
|
|
C.QAbstractButton_SetAutoRepeatDelay(this.h, (C.int)(autoRepeatDelay))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) AutoRepeatDelay() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QAbstractButton_AutoRepeatDelay(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) SetAutoRepeatInterval(autoRepeatInterval int) {
|
|
|
|
C.QAbstractButton_SetAutoRepeatInterval(this.h, (C.int)(autoRepeatInterval))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) AutoRepeatInterval() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QAbstractButton_AutoRepeatInterval(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) SetAutoExclusive(autoExclusive bool) {
|
|
|
|
C.QAbstractButton_SetAutoExclusive(this.h, (C.bool)(autoExclusive))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) AutoExclusive() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractButton_AutoExclusive(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Group() *QButtonGroup {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQButtonGroup(unsafe.Pointer(C.QAbstractButton_Group(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) SetIconSize(size *QSize) {
|
|
|
|
C.QAbstractButton_SetIconSize(this.h, size.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) AnimateClick() {
|
|
|
|
C.QAbstractButton_AnimateClick(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Click() {
|
|
|
|
C.QAbstractButton_Click(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Toggle() {
|
|
|
|
C.QAbstractButton_Toggle(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) SetChecked(checked bool) {
|
|
|
|
C.QAbstractButton_SetChecked(this.h, (C.bool)(checked))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Pressed() {
|
|
|
|
C.QAbstractButton_Pressed(this.h)
|
|
|
|
}
|
|
|
|
func (this *QAbstractButton) OnPressed(slot func()) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QAbstractButton_connect_Pressed(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QAbstractButton_Pressed
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QAbstractButton_Pressed(cb C.intptr_t) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func())
|
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
|
|
|
gofunc()
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Released() {
|
|
|
|
C.QAbstractButton_Released(this.h)
|
|
|
|
}
|
|
|
|
func (this *QAbstractButton) OnReleased(slot func()) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QAbstractButton_connect_Released(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QAbstractButton_Released
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QAbstractButton_Released(cb C.intptr_t) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func())
|
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
|
|
|
gofunc()
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Clicked() {
|
|
|
|
C.QAbstractButton_Clicked(this.h)
|
|
|
|
}
|
2024-09-07 03:31:00 +00:00
|
|
|
func (this *QAbstractButton) OnClicked(slot func()) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QAbstractButton_connect_Clicked(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
2024-09-14 22:29:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QAbstractButton_Clicked
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QAbstractButton_Clicked(cb C.intptr_t) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func())
|
2024-09-14 22:29:05 +00:00
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-09-07 03:31:00 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
gofunc()
|
2024-09-07 03:31:00 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QAbstractButton) Toggled(checked bool) {
|
|
|
|
C.QAbstractButton_Toggled(this.h, (C.bool)(checked))
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QAbstractButton) OnToggled(slot func(checked bool)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QAbstractButton_connect_Toggled(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_QAbstractButton_Toggled
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QAbstractButton_Toggled(cb C.intptr_t, checked C.bool) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(checked bool))
|
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-09-17 07:30:27 +00:00
|
|
|
slotval1 := (bool)(checked)
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractButton_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.QAbstractButton_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 QAbstractButton_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.QAbstractButton_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 QAbstractButton_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.QAbstractButton_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 QAbstractButton_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.QAbstractButton_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 *QAbstractButton) AnimateClick1(msec int) {
|
|
|
|
C.QAbstractButton_AnimateClick1(this.h, (C.int)(msec))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractButton) Clicked1(checked bool) {
|
|
|
|
C.QAbstractButton_Clicked1(this.h, (C.bool)(checked))
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
func (this *QAbstractButton) OnClicked1(slot func(checked bool)) {
|
2024-10-13 06:06:06 +00:00
|
|
|
C.QAbstractButton_connect_Clicked1(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_QAbstractButton_Clicked1
|
2024-10-13 06:06:06 +00:00
|
|
|
func miqt_exec_callback_QAbstractButton_Clicked1(cb C.intptr_t, checked C.bool) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(checked bool))
|
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-09-17 07:30:27 +00:00
|
|
|
slotval1 := (bool)(checked)
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
2024-08-25 04:08:24 +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 *QAbstractButton) Delete() {
|
|
|
|
C.QAbstractButton_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 *QAbstractButton) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QAbstractButton) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|