nodeeditor
nodeeditor copied to clipboard
Big issue when using combo embedded widget
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...
Zooming out:
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).
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 ?
Maybe its #410?
Duplicate of #121