草庐IT

ComboBoxItemDelegate

全部标签

c++ - QComboBox 不调用委托(delegate)方法

我想通过模型和委托(delegate)插入QWidgets(而不是字符串)来自定义QComboBox>:QComboBox*cb=newQComboBox(this);FeatureModel*featureModel=newFeatureModel(cb);cb->setModel(featureModel);ComboBoxItemDelegate*comboBoxItemDelegate=newComboBoxItemDelegate(cb);cb->setItemDelegate(comboBoxItemDelegate);FeatureModel继承自QAbstractLis