Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void GuiItemDelegate::setModelData(QWidget* widget, QAbstractItemModel* model, const QModelIndex& index) const
- {
- static int string_id = qMetaTypeId<std::string>();
- QByteArray n = widget->metaObject()->userProperty().name();
- QVariant variant = widget->property(n);
- std::cout << std::string(widget->metaObject()->userProperty().typeName()) << std::endl;
- if(variant.userType() == QVariant::String && variant.userType() != QMetaType::Float) {
- std::cout << "lolwut" << std::endl;
- model->setData(index, QVariant::fromValue(variant.toString().toStdString()), Qt::EditRole);
- } else {
- QStyledItemDelegate::setModelData(widget, model, index);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement