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

Big issue when using combo embedded widget #422

Open
yvanblanchard opened this issue May 14, 2024 · 2 comments
Open

Big issue when using combo embedded widget #422

yvanblanchard opened this issue May 14, 2024 · 2 comments

Comments

@yvanblanchard
Copy link

Hello

I noticed that when using comboxBox widgets in Node, there are some very strange behaviors , typically the node disappears (except the combo). When zooming out, the node UI appears again...

image

Zooming out:
image

@shaharzfrn
Copy link

I had this problem too,

Try to use QListWidget as a model and view for your QComboBox widget.

QListWidget *pListModel = new QListWidget();
QComboBox *pComboBox = new QComboBox();
pComboBox->setModel(pListModel->model());
pComboBox->setView(pListModel);

And to add items:

pListModel->addItem("Item 1");
pListModel->addItem("Item 2");
pListModel->addItem("Item 3");

OR

pListModel->addItem({"Item 1", "Item 2", "Item 3"});

I don't know why it's happening if you don't use QListWidget, but this solution work for me.

Note:
It's important to call setModel before call setView (see: https://doc.qt.io/qt-6/qcombobox.html#setView).

@yvanblanchard
Copy link
Author

yvanblanchard commented May 15, 2024

Thank you very much @shaharzfrn ! I will test it soon.

It's strange, it does not happen all the time. I noticed that if I instanciate the node (containing the combo list widget) when zooming a lot, the problem does not appear..

@paceholder any idea about the root cause ?

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

2 participants