ComboBox Of CheckBoxes not working in Qt5
Unsolved
General and Desktop
-
When I tried this example in Qt5.6 checkboxes doesn’t rendered at all. However, It works fine in Qt4.
Why ? is it a bug or the behaviour changed in Qt 5? Is there any workaround? -
Hi and welcome
Worked for me in 5.5 ?
https://www.dropbox.com/s/zqn043nb7u8629r/testcheck.zip?dl=0
-
Hi,
You can very simple implement by Qt5.
Something like this:auto lw = new QListWidget; foreach (auto str, QStringList() << "a" << "b" << "c") { auto li = new QListWidgetItem(str); li->setFlags(li->flags() | Qt::ItemIsUserCheckable); li->setCheckState(Qt::Unchecked); lw->addItem(li); } comboBox->setModel(lw->model()); comboBox->setView(lw);
-
@Devopia53 Thanks, the checkboxes are displayed at least but selection by mouse is very difficult. I don't know why. UPDATE I comment out li->flags() and things works fine.