Comments (4)
Hey
I'm aware of that, but all bool*
parameters are currently ignored.
If you take a look at the widgets.cpp
, you will see that the bool won't make it into the final call.
char* QInputDialog_QInputDialog_GetText(void* parent, char* title, char* label, int mode, char* text, int ok, int flags, int inputMethodHints)
{
return QInputDialog::getText(static_cast<QWidget*>(parent), QString(title), QString(label), static_cast<QLineEdit::EchoMode>(mode), QString(text), NULL, static_cast<Qt::WindowType>(flags), static_cast<Qt::InputMethodHint>(inputMethodHints)).toUtf8().data();
}
I'm planning to make them usuable (change them from bool to *bool on the go side) and also pass them all the way into the c++ call, but I haven't found time for it yet.
But, I tested the code below and it works for me.
So, could you provide me a snipped of your code, so I can reproduce the problem?
package main
import (
"os"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/widgets"
)
func main() {
widgets.NewQApplication(len(os.Args), os.Args)
var button = widgets.NewQPushButton2("open dialog", nil)
button.ConnectClicked(func(_ bool) {
button.SetText(widgets.QInputDialog_GetText(button, "Title", "Label", widgets.QLineEdit__Normal, "Text", false, core.Qt__Dialog, core.Qt__ImhNone))
})
button.Show()
widgets.QApplication_Exec()
}
from qt.
I have tested it more trying to extract code however as soon as i rip it away from my code base, it starts acting stable.
I tested the code the below code nearly a 100 times and it crashed just once
so i assume the problem is still there.
package main
import (
"os"
"fmt"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/widgets"
)
func main() {
widgets.NewQApplication(len(os.Args), os.Args)
var widget = widgets.NewQWidget(nil, 0)
//this crashes because of boolean paramter which should be a pointer
var u = widgets.QInputDialog_GetText(widget, "title Enter username", "Enter username",
widgets.QLineEdit__Normal, "", true, core.Qt__Dialog, core.Qt__ImhNone)
fmt.Printf("user entered %s\n", u)
}
from qt.
triple tilde and the word 'go' to get syntax hilight
from qt.
Hey
I looked into this again and tested the static function QInputDialog::getText
manually (100 times), but it didn't crash.
And I also used the code below to test if a manually created QInputDialog
would crash, but it didn't.
I'm using go1.7beta1 darwin/amd64, OS X 10.11.5 and Qt 5.7
Please try to find an example which crashes more often.
package main
import (
"fmt"
"os"
"time"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/widgets"
)
func main() {
widgets.NewQApplication(len(os.Args), os.Args)
var widget = widgets.NewQWidget(nil, 0)
for i := 0; i < 200; i++ {
var dialog = widgets.NewQInputDialog(widget, core.Qt__Dialog)
dialog.SetWindowTitle("title Enter username")
dialog.SetLabelText("Enter username")
dialog.SetTextEchoMode(widgets.QLineEdit__Normal)
dialog.SetInputMethodHints(core.Qt__ImhNone)
dialog.ConnectAccept(func() {
fmt.Printf("user entered %s\n", dialog.TextValue())
dialog.AcceptDefault()
})
go func() {
time.Sleep(25 * time.Millisecond)
dialog.SetTextValue(fmt.Sprint(i))
dialog.Accept()
}()
dialog.Exec()
}
}
from qt.
Related Issues (20)
- new version of golang compiler is no longer support cmd "go get", can update readme helper ?
- Hello! I have a problem
- deploying linux to windows build fail with newqwebengineview. thanks for your help HOT 4
- Is alive? HOT 1
- Issue with using *QFileDialog.SelectedFiles(), "interface conversion: interface {} is []interface {}, not []string" HOT 1
- /usr/bin/ld: i386 architecture of input file `/tmp/go-link-3590783856/000000.o' is incompatible with i386:x86-64 output HOT 2
- Is there an active fork of this project? HOT 7
- android APK crashes when launched
- Installation fails for Qt 6 HOT 2
- !!! Read before opening a new issue !!!
- qtdeploy may not work with Go1.20 HOT 1
- go: warning: "github.com/therecipe/qt/cmd/..." matched no packages HOT 1
- menu.Actions() panics
- How to add a property sheet file to Qt
- How can I deploy a program to an arm development board and don't see a good way
- Intermittent Qtdeploy Failures HOT 1
- Gave up - Docs need some work for new people HOT 1
- is this project still maintains, what's the latest qt version does it support HOT 2
- qtsetup fails
- qtsetup error in freebsd 14.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qt.