miqt/qt/gen_qpushbutton.go

227 lines
5.9 KiB
Go

package qt
/*
#include "gen_qpushbutton.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QPushButton struct {
h *C.QPushButton
*QAbstractButton
}
func (this *QPushButton) cPointer() *C.QPushButton {
if this == nil {
return nil
}
return this.h
}
func newQPushButton(h *C.QPushButton) *QPushButton {
if h == nil {
return nil
}
return &QPushButton{h: h, QAbstractButton: newQAbstractButton_U(unsafe.Pointer(h))}
}
func newQPushButton_U(h unsafe.Pointer) *QPushButton {
return newQPushButton((*C.QPushButton)(h))
}
// NewQPushButton constructs a new QPushButton object.
func NewQPushButton() *QPushButton {
ret := C.QPushButton_new()
return newQPushButton(ret)
}
// NewQPushButton2 constructs a new QPushButton object.
func NewQPushButton2(text string) *QPushButton {
text_Cstring := C.CString(text)
defer C.free(unsafe.Pointer(text_Cstring))
ret := C.QPushButton_new2(text_Cstring, C.size_t(len(text)))
return newQPushButton(ret)
}
// NewQPushButton3 constructs a new QPushButton object.
func NewQPushButton3(icon *QIcon, text string) *QPushButton {
text_Cstring := C.CString(text)
defer C.free(unsafe.Pointer(text_Cstring))
ret := C.QPushButton_new3(icon.cPointer(), text_Cstring, C.size_t(len(text)))
return newQPushButton(ret)
}
// NewQPushButton4 constructs a new QPushButton object.
func NewQPushButton4(parent *QWidget) *QPushButton {
ret := C.QPushButton_new4(parent.cPointer())
return newQPushButton(ret)
}
// NewQPushButton5 constructs a new QPushButton object.
func NewQPushButton5(text string, parent *QWidget) *QPushButton {
text_Cstring := C.CString(text)
defer C.free(unsafe.Pointer(text_Cstring))
ret := C.QPushButton_new5(text_Cstring, C.size_t(len(text)), parent.cPointer())
return newQPushButton(ret)
}
// NewQPushButton6 constructs a new QPushButton object.
func NewQPushButton6(icon *QIcon, text string, parent *QWidget) *QPushButton {
text_Cstring := C.CString(text)
defer C.free(unsafe.Pointer(text_Cstring))
ret := C.QPushButton_new6(icon.cPointer(), text_Cstring, C.size_t(len(text)), parent.cPointer())
return newQPushButton(ret)
}
func (this *QPushButton) MetaObject() *QMetaObject {
ret := C.QPushButton_MetaObject(this.h)
return newQMetaObject_U(unsafe.Pointer(ret))
}
func QPushButton_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _out *C.char = nil
var _out_Strlen C.int = 0
C.QPushButton_Tr(s_Cstring, &_out, &_out_Strlen)
ret := C.GoStringN(_out, _out_Strlen)
C.free(unsafe.Pointer(_out))
return ret
}
func QPushButton_TrUtf8(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _out *C.char = nil
var _out_Strlen C.int = 0
C.QPushButton_TrUtf8(s_Cstring, &_out, &_out_Strlen)
ret := C.GoStringN(_out, _out_Strlen)
C.free(unsafe.Pointer(_out))
return ret
}
func (this *QPushButton) SizeHint() *QSize {
ret := C.QPushButton_SizeHint(this.h)
// Qt uses pass-by-value semantics for this type. Mimic with finalizer
ret1 := newQSize(ret)
runtime.SetFinalizer(ret1, func(ret2 *QSize) {
ret2.Delete()
runtime.KeepAlive(ret2.h)
})
return ret1
}
func (this *QPushButton) MinimumSizeHint() *QSize {
ret := C.QPushButton_MinimumSizeHint(this.h)
// Qt uses pass-by-value semantics for this type. Mimic with finalizer
ret1 := newQSize(ret)
runtime.SetFinalizer(ret1, func(ret2 *QSize) {
ret2.Delete()
runtime.KeepAlive(ret2.h)
})
return ret1
}
func (this *QPushButton) AutoDefault() bool {
ret := C.QPushButton_AutoDefault(this.h)
return (bool)(ret)
}
func (this *QPushButton) SetAutoDefault(autoDefault bool) {
C.QPushButton_SetAutoDefault(this.h, (C.bool)(autoDefault))
}
func (this *QPushButton) IsDefault() bool {
ret := C.QPushButton_IsDefault(this.h)
return (bool)(ret)
}
func (this *QPushButton) SetDefault(defaultVal bool) {
C.QPushButton_SetDefault(this.h, (C.bool)(defaultVal))
}
func (this *QPushButton) SetMenu(menu *QMenu) {
C.QPushButton_SetMenu(this.h, menu.cPointer())
}
func (this *QPushButton) Menu() *QMenu {
ret := C.QPushButton_Menu(this.h)
return newQMenu_U(unsafe.Pointer(ret))
}
func (this *QPushButton) SetFlat(flat bool) {
C.QPushButton_SetFlat(this.h, (C.bool)(flat))
}
func (this *QPushButton) IsFlat() bool {
ret := C.QPushButton_IsFlat(this.h)
return (bool)(ret)
}
func (this *QPushButton) ShowMenu() {
C.QPushButton_ShowMenu(this.h)
}
func QPushButton_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 _out *C.char = nil
var _out_Strlen C.int = 0
C.QPushButton_Tr2(s_Cstring, c_Cstring, &_out, &_out_Strlen)
ret := C.GoStringN(_out, _out_Strlen)
C.free(unsafe.Pointer(_out))
return ret
}
func QPushButton_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 _out *C.char = nil
var _out_Strlen C.int = 0
C.QPushButton_Tr3(s_Cstring, c_Cstring, (C.int)(n), &_out, &_out_Strlen)
ret := C.GoStringN(_out, _out_Strlen)
C.free(unsafe.Pointer(_out))
return ret
}
func QPushButton_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))
var _out *C.char = nil
var _out_Strlen C.int = 0
C.QPushButton_TrUtf82(s_Cstring, c_Cstring, &_out, &_out_Strlen)
ret := C.GoStringN(_out, _out_Strlen)
C.free(unsafe.Pointer(_out))
return ret
}
func QPushButton_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))
var _out *C.char = nil
var _out_Strlen C.int = 0
C.QPushButton_TrUtf83(s_Cstring, c_Cstring, (C.int)(n), &_out, &_out_Strlen)
ret := C.GoStringN(_out, _out_Strlen)
C.free(unsafe.Pointer(_out))
return ret
}
func (this *QPushButton) Delete() {
C.QPushButton_Delete(this.h)
}