QVariant error but I'm not using QVariant
-
I'm seeing this fatal compilation error about QVariant error but I'm not using QVariant. What's that about?
error: use of deleted function ‘QVariant::QVariant(T) [with T = char*; typename std::enable_if<disjunction_v<std::is_pointer<_Tp>, std::is_member_pointer<_Tp> >, bool>::type <anonymous> = false]’ 688 | m_tableWidget->model()->setData(theTextIndex, theString, Qt::EditRole); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qlocale.h:7, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qcalendar.h:10, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qdatetime.h:11, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qfileinfo.h:11, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qdir.h:9, from /usr/include/x86_64-linux-gnu/qt6/QtWidgets/qfiledialog.h:8, from /usr/include/x86_64-linux-gnu/qt6/QtWidgets/QFileDialog:1,
-
Please provide a minimal example of your problem, the used Qt and compiler version.
@whatabout said in QVariant error but I'm not using QVariant:
You say:I'm not using QVariant.
Pants on fire! You are using
QVariant
when you call:QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
theString
is achar*
, from which you can't construct aQVariant
. That's why you get an error.
Use aQString
instead and it will compile. -
I'm seeing this fatal compilation error about QVariant error but I'm not using QVariant. What's that about?
error: use of deleted function ‘QVariant::QVariant(T) [with T = char*; typename std::enable_if<disjunction_v<std::is_pointer<_Tp>, std::is_member_pointer<_Tp> >, bool>::type <anonymous> = false]’ 688 | m_tableWidget->model()->setData(theTextIndex, theString, Qt::EditRole); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qlocale.h:7, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qcalendar.h:10, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qdatetime.h:11, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qfileinfo.h:11, from /usr/include/x86_64-linux-gnu/qt6/QtCore/qdir.h:9, from /usr/include/x86_64-linux-gnu/qt6/QtWidgets/qfiledialog.h:8, from /usr/include/x86_64-linux-gnu/qt6/QtWidgets/QFileDialog:1,
Please provide a minimal example of your problem, the used Qt and compiler version.
-
Please provide a minimal example of your problem, the used Qt and compiler version.
@whatabout said in QVariant error but I'm not using QVariant:
You say:I'm not using QVariant.
Pants on fire! You are using
QVariant
when you call:QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
theString
is achar*
, from which you can't construct aQVariant
. That's why you get an error.
Use aQString
instead and it will compile. -
@whatabout said in QVariant error but I'm not using QVariant:
You say:I'm not using QVariant.
Pants on fire! You are using
QVariant
when you call:QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
theString
is achar*
, from which you can't construct aQVariant
. That's why you get an error.
Use aQString
instead and it will compile.@Axel-Spoerl
Ah yes that was it, thanks.
Stay warm... -