Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QListWidgetItem is garbage collected #30

Open
pekim opened this issue May 1, 2016 · 0 comments
Open

QListWidgetItem is garbage collected #30

pekim opened this issue May 1, 2016 · 0 comments

Comments

@pekim
Copy link

pekim commented May 1, 2016

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant