Open yvanblanchard opened 1 month ago
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 ?
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:![image](https://github.com/paceholder/nodeeditor/assets/63931618/8da6c827-43df-403f-85ca-58538d32061d)