Coder Social home page Coder Social logo

goqt's Introduction

GoQt

Introduction

GoQt is golang bindings to the Qt cross-platform application framework.

Experiment

GoQt project current is experiment.

What is GoQt

GoQt is a GUI toolkit for the Go programming language. It allows Go programmers to create programs with a robust, highly functional graphical user interface, simply and easily. It is implemented as a Golang extension module (cgo code) that wraps the popular Qt cross platform GUI library, which is written in C++.

Like Golang and Qt, GoQt is Open Source. The Golang extension module(cgo code) under the BSD license. The C++ bindings library under the LGPL license.

Platforms Support

System

  • Windows x86 (32-bit or 64-bit)
  • Linux x86 (32-bit or 64-bit)
  • MacOS X10.6

Golang

  • Go1.4.2
  • Go1.5.2

ToDo

  • Go1.6 cgo check almost completed

Qt Version

  • Qt4.8.5
  • Qt5.5.1

Documents

GoQt Documents

Instructions install GoQt and learning documents.

Examples

GoQt Examples

Some examples of learning to use GoQt source code.

Website

goqt's People

Contributors

visualfc avatar zlowred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goqt's Issues

???

这里什么都没有

calculator and codeedit do not work

Running Arch Linux/amd64. All examples work, excepting calculator and codeedit (and "application doesn't show any icons in toolbar, not sure if bug or it's on my end).

calculator stdout is "error load ui"

codeedit creates a window but it's fully transparent (no content, frozen).

According to examples/version:
GoQt version is 0.1.1
Qt version is 5.5.1
Go version is 1.5.2

QTableWidget里放置QProgressBar如何绑定数据源?

本想在QTableView里用QProgressBar,但放不进去,类型不匹配。
把QProgressBar放进QTableWidget里之后,想要定时刷新,如果使用一个goroutine来刷新QProgressBar的值,程序会崩溃(貌似也不推荐这么做)。网上查了下,如果使用delegate需要重载OnPaint()函数,这在go里怎么做?QItemDelegate里也没有这个函数。
使用golang时间不长,能否给个怎么用的示例?万分感谢!

windows下面,第二步build qtdrv, need install QtSDK,出现错误

D:\Gopath\src\github.com\visualfc\goqt\qtdrv>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'D:/Gopath/src/github.com/visualfc/goqt/qtdrv'
g++ -Wl,-s -shared -Wl,-subsystem,windows -mthreads -Wl,--out-implib,D:/Gopath/src/github.com/visualfc/goqt/qtdrv/../bin/libqtdrv.ui.a -o ../bin/qtdrv.ui.dll object_script.qtdrv.ui.Release -LC:/Qt/Qt5.5.1/5.5/mingw492_32/lib -lQt5UiTools -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core
./release/uiapplication.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Makefile.Release:110: recipe for target '../bin/qtdrv.ui.dll' failed
mingw32-make[1]: *** [../bin/qtdrv.ui.dll] Error 1
mingw32-make[1]: Leaving directory 'D:/Gopath/src/github.com/visualfc/goqt/qtdrv'
makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2

qmake执行后,make过不去,总是出现错误,请问应该怎么办?

Error building qtdrv in windows 10 amd64

Hi I am building qtdrv in windows but error occurs, I've installed Qt creator 4.0.2(Qt 5.7.0) and mingw-w64.

PS D:\go\src\github.com\visualfc\goqt\qtdrv> qmake "CONFIG+=release"
PS D:\go\src\github.com\visualfc\goqt\qtdrv> mingw32-make
C:/Program Files/mingw-w64/x86_64-5.3.0-posix-seh-rt_v4-rev0/mingw64/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'D:/go/src/github.com/visualfc/goqt/qtdrv'
Makefile.Release:95: *** missing separator.  Stop.
mingw32-make[1]: Leaving directory 'D:/go/src/github.com/visualfc/goqt/qtdrv'
Makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2
PS D:\go\src\github.com\visualfc\goqt\qtdrv> go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\go
set GORACE=
set GOROOT=D:\Program Files\go
set GOTOOLDIR=D:\Program Files\go\pkg\tool\windows_amd64
set GO15VENDOREXPERIMENT=1
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1

Win10 [go 1.6] fatal error: out of memory

D:\go\gopath\src\github.com\visualfc\goqt\examples\minimal>go build
fatal error: out of memory

runtime stack:
runtime.throw(0x7b4470, 0xd)
c:/go/src/runtime/panic.go:530 +0x7f
runtime.(*mcache).refill(0xf60000, 0xe, 0x6695be6c)
c:/go/src/runtime/mcache.go:121 +0xce
runtime.mallocgc.func2()
c:/go/src/runtime/malloc.go:642 +0x2b
runtime.systemstack(0x11382000)
c:/go/src/runtime/asm_386.s:313 +0x5e
runtime.mstart()
c:/go/src/runtime/proc.go:1048

goroutine 1 [running]:
runtime.systemstack_switch()
c:/go/src/runtime/asm_386.s:267 fp=0x48d2571c sp=0x48d25718
runtime.mallocgc(0xd0, 0x78c140, 0x0, 0xbe11373)
c:/go/src/runtime/malloc.go:643 +0x6ca fp=0x48d25788 sp=0x48d2571c
runtime.newobject(0x78c140, 0x0)
c:/go/src/runtime/malloc.go:781 +0x41 fp=0x48d2579c sp=0x48d25788
cmd/compile/internal/gc.Prog(0x3, 0x6695c880)
c:/go/src/cmd/compile/internal/gc/gsubr.go:113 +0x27f fp=0x48d257d0 sp=0x48d2579c
cmd/compile/internal/x86.gins(0x3, 0x0, 0x0, 0x0)
c:/go/src/cmd/compile/internal/x86/gsubr.go:1790 +0x243 fp=0x48d25840 sp=0x48d257d0
cmd/compile/internal/gc.dsymptr(0x1ccd5540, 0x1010, 0x660aa000, 0x0, 0x1010)
c:/go/src/cmd/compile/internal/gc/obj.go:339 +0x73 fp=0x48d258e4 sp=0x48d25840
cmd/compile/internal/gc.dextratype(0x1ccd5540, 0x28, 0x66079d40, 0x1c, 0x28)
c:/go/src/cmd/compile/internal/gc/reflect.go:529 +0x379 fp=0x48d25934 sp=0x48d258e4
cmd/compile/internal/gc.dtypesym(0x66079d40, 0x66079d40)
c:/go/src/cmd/compile/internal/gc/reflect.go:1197 +0x303 fp=0x48d25a08 sp=0x48d25934
cmd/compile/internal/gc.dcommontype(0x1ccd52c0, 0x0, 0x179f4000, 0x0)
c:/go/src/cmd/compile/internal/gc/reflect.go:707 +0x741 fp=0x48d25ac8 sp=0x48d25a08
cmd/compile/internal/gc.dtypesym(0x179f4000, 0x203c3380)
c:/go/src/cmd/compile/internal/gc/reflect.go:1167 +0xb28 fp=0x48d25b9c sp=0x48d25ac8
cmd/compile/internal/gc.dumptypestructs()
c:/go/src/cmd/compile/internal/gc/reflect.go:1250 +0x40f fp=0x48d25bfc sp=0x48d25b9c
cmd/compile/internal/gc.dumpobj()
c:/go/src/cmd/compile/internal/gc/obj.go:76 +0xb6c fp=0x48d25d24 sp=0x48d25bfc
cmd/compile/internal/gc.Main()
c:/go/src/cmd/compile/internal/gc/lex.go:495 +0x1ce0 fp=0x48d25eb8 sp=0x48d25d24
cmd/compile/internal/x86.Main()
c:/go/src/cmd/compile/internal/x86/galign.go:108 +0x53e fp=0x48d25f24 sp=0x48d25eb8
main.main()
c:/go/src/cmd/compile/main.go:30 +0x117 fp=0x48d25f90 sp=0x48d25f24
runtime.main()
c:/go/src/runtime/proc.go:188 +0x234 fp=0x48d25fb8 sp=0x48d25f90
runtime.goexit()
c:/go/src/runtime/asm_386.s:1585 +0x1 fp=0x48d25fbc sp=0x48d25fb8

D:\go\gopath\src\github.com\visualfc\goqt\examples\minimal>go version
go version go1.6 windows/386

D:\go\gopath\src\github.com\visualfc\goqt\examples\minimal>go env
set GOARCH=386
set GOBIN=D:\go\bin
set GOEXE=.exe
set GOHOSTARCH=386
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\go\gopath;D:\go\cpath
set GORACE=
set GOROOT=D:\go
set GOTOOLDIR=D:\go\pkg\tool\windows_386
set GO15VENDOREXPERIMENT=1
set CC=gcc
set GOGCCFLAGS=-m32 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1

qt的event还不完善吗?(已解决)

想获取鼠标移动
func (w *MyWidget) OnMouseMoveEvent(event *ui.QMouseEvent) bool { log.Println(event) return true }
无效,看godoc,OnMouseMoveEvent(event *QMouseMoveEvent) bool
却没找到ui.QMouseMoveEvent类型
type QMouseMoveEvent ui.QMouseEvent好像也不行

Build error: qtdrv.ui

After I execute: me$ go get github.com/visualfc/goqt/ui

The following occurs:
# github.com/visualfc/goqt/ui

ld: library not found for -lqtdrv.ui

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Operating system: MacOSX El Capitain

New functions

Hi,

I started to use the package, it works fine now. I started to port an earlier project of mine from PyQt, and I have a big problem.

I have a QListView, using a QFileSystemModel as model. I'd like to define my model as an anonym subclass to be able to overwrite it's methods like:
type FileManagerModel struct {
*ui.QFileSystemModel
parent *DirWidget
}

But as far as the QFileSystemModel should be initiated with NewFileSystemModel() or any other New function, it's just impossible to do this way. I'd like to ask you to make "Init" functions for the structs, so after creating a
model := FileManagerModel{}
I can call it as
model.Init()

Thanks.

Example issue with Qt 5.5.1

Thank you for this amazing work!

I'm trying to compile the examples, but only "minimal" and "version" seem to work with Go 1.5 and Qt 5.5.1 on Linux (jessie). I've got the following error while trying to run:

symbol lookup error: ./libqtdrv.ui.so.1: undefined symbol: _ZNK11QMetaObject10Connection18isConnected_helperEv

go install: no install location for directory

Hello,
I am using Linux mint and would like develop an application using goqt.

I followed the steps as mentioned by visualfc, in the process of doing so i am getting the following error

mint@mint-OptiPlex-790 ~/go/goqt/ui $ go install
go install: no install location for directory /home/mint/go/goqt/ui outside GOPATH
For more details see: go help gopath

mint@mint-OptiPlex-790 ~/go/goqt/ui $

I have tried different methods as mentioned in various blogs,

  1. such as setting the GOPATH and GOROOT
  2. Setting GOBIN
  3. Enabling "CGO_ENABLED" manually from shell and also setting / resetting CGO_ENABLED of go env

None of the above worked for me, kindly let me know how i can proceed

Run errors

osx 10.11.2 qt5.5.1

➜  bin git:(master) ✗ ./minimal
dyld: Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /Users/qipeng/mac/workspace/go/src/github.com/visualfc/goqt/bin/libqtdrv.ui.1.0.0.dylib
  Reason: image not found
[1]    82010 trace trap  ./minimal

Unknown module(s) in QT: uitools

This issue concerns the installing instructions for goqt. Executing qmake "CONFIG+=release" causes an project error: "Project ERROR: Unknown module(s) in QT: uitools".

Is this error due to a missing QT module or is it caused by the project itself?

compiling for windows gives dll not found error

2017/11/10 13:54:12 Failed to load qtdrv.ui.dll: Module not found.

I build with this command:

env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -ldflags "-r ." -o bin/out.exe

QListWidgetItem is garbage collected

If I add a QListWidgetItem to a QListWidget, it's initially visible in the list, but soon disappears.

    listWidget := ui.NewListWidget()

    item := ui.NewListWidgetItem()
    item.SetText("some text")
    listWidget.AddItem(item)

It seems that it's garbage collected, and that results in it disappearing from the list.

If I deliberately make sure that a reference to the item is kept, it doesn't disappear.

    time.AfterFunc(time.Hour*10000, func() {
        fmt.Println(item)
    })

Is this expected behaviour? If it is, what's the recommended way of dealing with it?

Example how to use Animation

Hi,

I see bunch of methods related to PropertyAnimation but I can't get it working irrespective of what I do.
Additionally, I can't add animations to AnimationGroup

Simple example with basic would be great to have

failed to build the "minimal example"

I'm getting this error on Archlinux:

go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
# github.com/visualfc/goqt/ui
/usr/bin/ld: cannot find -lqtdrv.ui
collect2: error: ld returned 1 exit status

/usr/bin/ld: cannot find -lqtdrv.ui

go build NewWidget.go

github.com/visualfc/goqt/ui

/usr/bin/ld: cannot find -lqtdrv.ui
collect2: error: ld returned 1 exit status

My Code :
image

Linux raif 5.3.0-51-generic #44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

QFileSystemModel does not implement QAbstractItemModelInterface

Given the following Go code...

package main

import (
    "github.com/visualfc/goqt/ui"
)

func main() {
    model := ui.NewFileSystemModel()
    tree := ui.NewTreeView()
    tree.SetModel(model)
}

I get the following error when building:

/filetree.go:10: cannot use model (type *ui.QFileSystemModel) as type ui.QAbstractItemModelInterface in argument to tree.QAbstractItemView.SetModel:
    *ui.QFileSystemModel does not implement ui.QAbstractItemModelInterface (wrong type for Index method)
        have Index(string) *ui.QModelIndex
        want Index(int32, int32, *ui.QModelIndex) *ui.QModelIndex

Actually, I would expect this to compile without errors.

Does QFileSystemModel not implement QAbstractItemModelInterface correctly or am I missing something obvious here?

runtime.main: undefined: main.init runtime.main: undefined: main.mai

hello,
I download the complete zip file just 2 days, so possibly i have the latest copies.
i tried executing the examples but none of them seem to work for me.
i get the following errors,
runtime.main: undefined: main.init
runtime.main: undefined: main.main

i have not added any new file with *_test.go
I am using linux mint and go 1.5.2

kindly let me know how i can fix this issue

How to use the event?

``
package main

import (
"github.com/visualfc/goqt/ui"
)

func main() {
ui.Run(func() {
w := ui.NewWidget()
defer w.Show()

    r := NewMyWidget()
    r.OnPaintEvent()
})

}

type MyWidget struct {
*ui.QWidget
}

func NewMyWidget() *MyWidget {
w := &MyWidget{}
w.QWidget = ui.NewWidget()
w.InstallEventFilter(w)
return w
}

func (w *MyWidget) OnPaintEvent(e *ui.QPaintEvent) bool {
w.PaintEvent() //w.QWidget.PaintEvent()

painter := ui.NewPainterWithPaintDevice(w)
defer painter.Delete()

//painter.Draw ...

return true

}
``

Errors:
./main.go:15: not enough arguments in call to r.OnPaintEvent ./main.go:31: not enough arguments in call to w.QWidget.PaintEvent

Where to take the variable 'e' ?

goqt_rcc not showing some icon

"goqt_rcc -o tool_qrc.go -go main tool.qrc" that some icon not showing in the application ?. using QT5.7
What is the solution?

QScreen.GrabWindow() is missing

I'm trying to grab a screenshot by following this guide: http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html. In there they take a screenshot by running this piece of code:

QScreen *screen = QGuiApplication::primaryScreen();
originalPixmap = screen->grabWindow(0);

I tried to recreate this in goqt, this is what I came up with:

primary := ui.Application.Desktop.PrimaryScreen()
pixmap := ui.Application.Desktop.ScreenWithScreen(primary).GrabWindow()

But the .GrabWindow() function is missing! There are functions for grabbing gestures, keyboards, mouses and shortcuts, but not windows.

This function is present in github.com/therecipe/qt, but I really don't want to switch, because I've already written a part of my application with goqt. And also therecipe/qt needs a lot of time and memory to compile and set up.

看到这个项目有两个问题问一下

1、这个项目和您之前有个go-ui项目有什么关系吗?
2、您是否会用这个项目重写一个基于Go语言的LiteIDE?
3、cgo的语言和c语言调用效率非常低,需要密集调用接口的的UI应用效率会好吗?

有个想法,如果您可以基于这个项目重写LiteIDE,并保持当前的性能,这样可以催熟这个项目并使得Go语言跨平台开发GUI应用达到一个可用的水准。 :)

Fatal error: signal 17 received but handler not on signal stack

goqt + go 1.9 + os.exec + fsnotify on Linux 64bit
Call to exec.Command(...).Run() fails on process.wait() with messages:

signal 17 received but handler not on signal stack
fatal error: non-Go code set up signal handler without SA_ONSTACK flag
runtime stack:
runtime.throw(0x5ca8b0, 0x39)
        /home/stc/DEV/GO/usr_local/go/src/runtime/panic.go:605 +0x95
runtime.sigNotOnStack(0x11)
        /home/stc/DEV/GO/usr_local/go/src/runtime/signal_unix.go:540 +0x94
runtime.sigtrampgo(0x11, 0xc4200436f0, 0xc4200435c0)
        /home/stc/DEV/GO/usr_local/go/src/runtime/signal_unix.go:317 +0x367
runtime.sigtramp(0x1, 0x0, 0xc420064000, 0x0, 0x8000, 0x0, 0x0, 0x1000004, 0x212, 0x0, ...)
        /home/stc/DEV/GO/usr_local/go/src/runtime/sys_linux_amd64.s:265 +0x43

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /home/stc/DEV/GO/usr_local/go/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc420042fe8 sp=0xc420042fe0 pc=0x4586e1

goroutine 1 [syscall, locked to thread]:
github.com/visualfc/goqt/ui._Cfunc_qtdrv(0xf82ec0, 0x17f500001770, 0xc420016628, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        github.com/visualfc/goqt/ui/_obj/_cgo_gotypes.go:180 +0x50
github.com/visualfc/goqt/ui._DirectQtDrv.func1(0xf82ec0, 0x17f500001770, 0xc420016628, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/cdrv.go:137 +0x3bf
github.com/visualfc/goqt/ui._DirectQtDrv(0xf82ec0, 0x17f500001770, 0xc420016628, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/cdrv.go:137 +0xf2
github.com/visualfc/goqt/ui.(*_qt_drv).Drv(0xc420016150, 0x17f500001770, 0xc420016628, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/cdrv.go:280 +0x12d
github.com/visualfc/goqt/ui.(*BaseDrv).Drv(0xc420016150, 0x17f500001770, 0xc420016628, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/cdrv.go:214 +0xfb
github.com/visualfc/goqt/ui.(*QApplication).Exec(0xc420016150, 0xc420046410)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/qt_gui.go:590 +0xd6
github.com/visualfc/goqt/ui.Run.func1(0xc42007a0c0)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/app.go:54 +0x10e
github.com/visualfc/goqt/ui.runInOsMainThread.func1(0xc42007a0c0)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/app.go:28 +0x32
github.com/visualfc/goqt/ui.mainLoop(0x8)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/app.go:18 +0x5c
github.com/visualfc/goqt/ui.Run(0x5cd4a8, 0x53db09)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/app.go:56 +0x7b
main.main()
        /home/stc/DEV/GO/src/github.com/slytomcat/yd-qgo/qgui.go:57 +0x2d

goroutine 5 [chan receive]:
github.com/visualfc/goqt/ui.runInOsMainThread(0xc420046400)
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/app.go:32 +0xbf
created by github.com/visualfc/goqt/ui.Run
        /home/stc/DEV/GO/src/github.com/visualfc/goqt/ui/app.go:45 +0x76

goroutine 6 [syscall]:
syscall.Syscall6(0xe8, 0xa, 0xc4200f3c24, 0x7, 0xffffffffffffffff, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/stc/DEV/GO/usr_local/go/src/syscall/asm_linux_amd64.s:44 +0x5
golang.org/x/sys/unix.EpollWait(0xa, 0xc4200f3c24, 0x7, 0x7, 0xffffffffffffffff, 0xc420001680, 0xc4200ce0c0, 0x0)
        /home/stc/DEV/GO/src/golang.org/x/sys/unix/zsyscall_linux_amd64.go:1529 +0x77
github.com/fsnotify/fsnotify.(*fdPoller).wait(0xc4200146e0, 0x5cd300, 0xc4200146e0, 0x0)
        /home/stc/DEV/GO/src/github.com/fsnotify/fsnotify/inotify_poller.go:86 +0x91
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc4200823c0)
        /home/stc/DEV/GO/src/github.com/fsnotify/fsnotify/inotify.go:192 +0x194
created by github.com/fsnotify/fsnotify.NewWatcher
        /home/stc/DEV/GO/src/github.com/fsnotify/fsnotify/inotify.go:59 +0x23a

goroutine 7 [syscall]:
syscall.Syscall6(0xf7, 0x1, 0xa38, 0xc420043ba8, 0x1000004, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/stc/DEV/GO/usr_local/go/src/syscall/asm_linux_amd64.s:44 +0x5
os.(*Process).blockUntilWaitable(0xc420018510, 0xc420018510, 0x0, 0x0)
        /home/stc/DEV/GO/usr_local/go/src/os/wait_waitid.go:31 +0xa5
os.(*Process).wait(0xc420018510, 0xc420060300, 0xc4200cc0d8, 0x48)
        /home/stc/DEV/GO/usr_local/go/src/os/exec_unix.go:22 +0x42
os.(*Process).Wait(0xc420018510, 0x0, 0x0, 0x5cd4e8)
        /home/stc/DEV/GO/usr_local/go/src/os/exec.go:115 +0x2b
os/exec.(*Cmd).Wait(0xc4200cc000, 0x0, 0x0)
        /home/stc/DEV/GO/usr_local/go/src/os/exec/exec.go:446 +0x62
os/exec.(*Cmd).Run(0xc4200cc000, 0xc420082410, 0x3)
        /home/stc/DEV/GO/usr_local/go/src/os/exec/exec.go:289 +0x5c
os/exec.(*Cmd).Output(0xc4200cc000, 0xb, 0xc420032ea8, 0x3, 0x3, 0xc4200cc000)
        /home/stc/DEV/GO/usr_local/go/src/os/exec/exec.go:485 +0x119
github.com/slytomcat/yd-go/ydisk.YDisk.getOutput(0xc4200146a5, 0x15, 0xc420062240, 0xc4200182a0, 0x28, 0xc42007a2a0, 0xc42000c240, 0x1, 0x0, 0x0)
        /home/stc/DEV/GO/src/github.com/slytomcat/yd-go/ydisk/ydisk.go:229 +0xf7
github.com/slytomcat/yd-go/ydisk.(*YDisk).Start(0xc4200602c0)
        /home/stc/DEV/GO/src/github.com/slytomcat/yd-go/ydisk/ydisk.go:249 +0x64
created by main.main.func1
        /home/stc/DEV/GO/src/github.com/slytomcat/yd-qgo/qgui.go:110 +0xfc9

goroutine 8 [runnable]:
os/exec.(*Cmd).Start.func1(0xc4200cc000, 0xc42000c280)
        /home/stc/DEV/GO/usr_local/go/src/os/exec/exec.go:380 +0x59
created by os/exec.(*Cmd).Start
        /home/stc/DEV/GO/usr_local/go/src/os/exec/exec.go:379 +0x646

goroutine 9 [runnable]:
os/exec.(*Cmd).Start.func1(0xc4200cc000, 0xc42000c2c0)
        /home/stc/DEV/GO/usr_local/go/src/os/exec/exec.go:380 +0x59
created by os/exec.(*Cmd).Start
        /home/stc/DEV/GO/usr_local/go/src/os/exec/exec.go:379 +0x646

goroutine 10 [select]:
main.main.func1.7(0xc4200602c0, 0xc4200164b0, 0xc4200164d0, 0xc4200164f0, 0xc420016520, 0xc420016480, 0xc420016560, 0xc42000e048)
        /home/stc/DEV/GO/src/github.com/slytomcat/yd-qgo/qgui.go:177 +0x28e
created by main.main.func1
        /home/stc/DEV/GO/src/github.com/slytomcat/yd-qgo/qgui.go:167 +0xe6e
exit status 2

exec.Command(...).Start() works normally but Run() and Output() that calls to Wait() after Start() fails
Without goqt everything is ok.

Any Idea?

QGridLayout should implement QLayoutInterface

Code

    mainLayout := ui.NewGridLayout()
    mainWidget := ui.NewWidget()
    mainWidget.SetParent(w)
    mainWidget.SetLayout(mainLayout)
    w.SetCentralWidget(mainWidget)

w is a struct similar to MainWindow from the example.

Error

    *ui.QGridLayout does not implement ui.QLayoutInterface (wrong type for AddItem method)
        have AddItem(*ui.QLayoutItem, int32, int32, int32, int32, ui.Qt_AlignmentFlag)
        want AddItem(*ui.QLayoutItem)

[Build on RHEL/CentOS7] Project ERROR: Unknown module(s) in QT: uitools

I try to build it on CentOS7, and got the following error.
qmake-qt5 "CONFIG+=release"
Project ERROR: Unknown module(s) in QT: uitools
The solutions on Internet are all for Ubuntu. No solutions for RHEL/CentOS7.
I don't know which package I missed? Or it doesn't support RHEL/CentOS?

qt_event.go几处错误

在qt_event.go文件里OnDropEvent和OnDragLeaveEvent的参数不应该是QEvent,应该是具体事件的QDropEvent和*DragLeaveEvent。

关于GridLayout的一处错误

ui.Run(func() {
widget := ui.NewWidget()
gBox := ui.NewGridLayout()
widget.SetLayout(gBox)
widget.Show()
})
添加其他布局没有问题,只有GridLayout 这样
.\main.go:17: cannot use gBox (type *ui.QGridLayout) as type ui.QLayoutInterface in argument to widget.SetLayout:
*ui.QGridLayout does not implement ui.QLayoutInterface (wrong type for AddItem method)
have AddItem(*ui.QLayoutItem, int32, int32, int32, int32, ui.Qt_AlignmentFlag)
want AddItem(*ui.QLayoutItem)

下面这样就没有问题:
ui.Run(func() {
widget := ui.NewWidget()
gBox := ui.NewGridLayoutWithParent(widget)
fmt.Println(gBox)
widget.Show()
})

很喜欢这个项目希望作者可以持续更新

QTableWidget 数据丢失

创建 QTableWidget ,并填充内容,可以正常显示;过几分钟后数据全部空白,在单元格双击事件中,
取 单元格的QTableWidgetItem 对象,结果为nil

//加载数据
for idx, item := range dataList {
     tb.SetItem(row, 0,ui.NewTableWidgetItemWithTextType("123432", 0))
    //...
}

//双击事件
tb.OnCellDoubleClicked(func(row, col int32) {
        item := tb.Item(row, col)
        if item == nil {
            fmt.Println("item is nil")
        } else {
            fmt.Println("text:", item.Text())
        }
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.