Esempio n. 1
0
func fnPaint(ev *qt5.PaintEvent, w *qt5.Widget) {
	p := qt5.NewPainter()
	defer p.Close()
	p.Begin(w)
	p.DrawPoint(qt5.Pt(10, 10))
	p.DrawLine(qt5.Pt(10, 10), qt5.Pt(100, 100))
	p.End()
}
Esempio n. 2
0
func (p *MyWidget) paintEvent(e *qt5.PaintEvent) {
	paint := qt5.NewPainter()
	defer paint.Close()

	paint.Begin(p)
	paint.SetFont(p.font)
	paint.DrawLines(p.line)
	paint.SetFont(p.font)
	paint.DrawText(qt5.Pt(100, 100), "draw test")
	for _, v := range p.lines {
		//paint.DrawLines(v)
		paint.DrawPolyline(v)
	}
	paint.End()
	runtime.GC()
}