mirror of
https://github.com/mappu/miqt.git
synced 2025-01-03 14:18:37 +00:00
171 lines
4.4 KiB
Go
171 lines
4.4 KiB
Go
|
package qt
|
||
|
|
||
|
/*
|
||
|
|
||
|
#cgo CFLAGS: -fPIC
|
||
|
#cgo pkg-config: Qt5Widgets
|
||
|
#include "gen_qfontcombobox.h"
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
*/
|
||
|
import "C"
|
||
|
|
||
|
import (
|
||
|
"runtime"
|
||
|
"runtime/cgo"
|
||
|
"unsafe"
|
||
|
)
|
||
|
|
||
|
type QFontComboBox struct {
|
||
|
h *C.QFontComboBox
|
||
|
*QComboBox
|
||
|
}
|
||
|
|
||
|
func (this *QFontComboBox) cPointer() *C.QFontComboBox {
|
||
|
if this == nil {
|
||
|
return nil
|
||
|
}
|
||
|
return this.h
|
||
|
}
|
||
|
|
||
|
func newQFontComboBox(h *C.QFontComboBox) *QFontComboBox {
|
||
|
return &QFontComboBox{h: h, QComboBox: newQComboBox_U(unsafe.Pointer(h))}
|
||
|
}
|
||
|
|
||
|
func newQFontComboBox_U(h unsafe.Pointer) *QFontComboBox {
|
||
|
return newQFontComboBox((*C.QFontComboBox)(h))
|
||
|
}
|
||
|
|
||
|
// NewQFontComboBox constructs a new QFontComboBox object.
|
||
|
func NewQFontComboBox() *QFontComboBox {
|
||
|
ret := C.QFontComboBox_new()
|
||
|
return newQFontComboBox(ret)
|
||
|
}
|
||
|
|
||
|
// NewQFontComboBox2 constructs a new QFontComboBox object.
|
||
|
func NewQFontComboBox2(parent *QWidget) *QFontComboBox {
|
||
|
ret := C.QFontComboBox_new2(parent.cPointer())
|
||
|
return newQFontComboBox(ret)
|
||
|
}
|
||
|
|
||
|
func (this *QFontComboBox) MetaObject() *QMetaObject {
|
||
|
ret := C.QFontComboBox_MetaObject(this.h)
|
||
|
return newQMetaObject_U(unsafe.Pointer(ret))
|
||
|
}
|
||
|
|
||
|
func QFontComboBox_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.QFontComboBox_Tr(s_Cstring, &_out, &_out_Strlen)
|
||
|
ret := C.GoStringN(_out, _out_Strlen)
|
||
|
C.free(unsafe.Pointer(_out))
|
||
|
return ret
|
||
|
}
|
||
|
|
||
|
func QFontComboBox_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.QFontComboBox_TrUtf8(s_Cstring, &_out, &_out_Strlen)
|
||
|
ret := C.GoStringN(_out, _out_Strlen)
|
||
|
C.free(unsafe.Pointer(_out))
|
||
|
return ret
|
||
|
}
|
||
|
|
||
|
func (this *QFontComboBox) CurrentFont() *QFont {
|
||
|
ret := C.QFontComboBox_CurrentFont(this.h)
|
||
|
// Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
||
|
ret1 := newQFont(ret)
|
||
|
runtime.SetFinalizer(ret1, func(ret2 *QFont) {
|
||
|
ret2.Delete()
|
||
|
runtime.KeepAlive(ret2.h)
|
||
|
})
|
||
|
return ret1
|
||
|
}
|
||
|
|
||
|
func (this *QFontComboBox) SizeHint() *QSize {
|
||
|
ret := C.QFontComboBox_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 *QFontComboBox) SetCurrentFont(f *QFont) {
|
||
|
C.QFontComboBox_SetCurrentFont(this.h, f.cPointer())
|
||
|
}
|
||
|
|
||
|
func (this *QFontComboBox) CurrentFontChanged(f *QFont) {
|
||
|
C.QFontComboBox_CurrentFontChanged(this.h, f.cPointer())
|
||
|
}
|
||
|
|
||
|
func (this *QFontComboBox) OnCurrentFontChanged(slot func()) {
|
||
|
var slotWrapper miqtCallbackFunc = func(argc C.int, args *C.void) {
|
||
|
slot()
|
||
|
}
|
||
|
|
||
|
C.QFontComboBox_connect_CurrentFontChanged(this.h, unsafe.Pointer(uintptr(cgo.NewHandle(slotWrapper))))
|
||
|
}
|
||
|
|
||
|
func QFontComboBox_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.QFontComboBox_Tr2(s_Cstring, c_Cstring, &_out, &_out_Strlen)
|
||
|
ret := C.GoStringN(_out, _out_Strlen)
|
||
|
C.free(unsafe.Pointer(_out))
|
||
|
return ret
|
||
|
}
|
||
|
|
||
|
func QFontComboBox_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.QFontComboBox_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 QFontComboBox_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.QFontComboBox_TrUtf82(s_Cstring, c_Cstring, &_out, &_out_Strlen)
|
||
|
ret := C.GoStringN(_out, _out_Strlen)
|
||
|
C.free(unsafe.Pointer(_out))
|
||
|
return ret
|
||
|
}
|
||
|
|
||
|
func QFontComboBox_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.QFontComboBox_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 *QFontComboBox) Delete() {
|
||
|
C.QFontComboBox_Delete(this.h)
|
||
|
}
|