<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[error: ‘QVariant::QVariant(void*)’ is private      inline QVariant(void *) Q_DECL_EQ_DELETE;]]></title><description><![CDATA[<p dir="auto">Hi all</p>
<p dir="auto">I am trying to use C++ class in qml using setcontext property method, but when i try to build it it is giving the following error</p>
<p dir="auto">/opt/Qt5.8.0/5.8/gcc_64/include/QtCore/qvariant.h:471: error: ‘QVariant::QVariant(void*)’ is private<br />
inline QVariant(void *) Q_DECL_EQ_DELETE;</p>
<p dir="auto">what may be the issue for this? what changes i need to make ?</p>
<p dir="auto">thanks</p>
]]></description><link>https://forum.qt.io/topic/77149/error-qvariant-qvariant-void-is-private-inline-qvariant-void-q_decl_eq_delete</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 14:17:48 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/77149.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Mar 2017 09:36:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to error: ‘QVariant::QVariant(void*)’ is private      inline QVariant(void *) Q_DECL_EQ_DELETE; on Mon, 13 Mar 2017 16:51:46 GMT]]></title><description><![CDATA[<p dir="auto">You are trying to convert a pointer to a <code>QVariant</code>. You'll have to use <a href="http://doc.qt.io/qt-5/qvariant.html#fromValue" target="_blank" rel="noopener noreferrer nofollow ugc"><code>QVariant::fromValue()</code></a> to avoid implicit cast to bool and end up using <code>QVariant(bool)</code>.</p>
<pre><code>T *ptr = ...;
QVariant v1 = ptr; // not ok
QVariant v2 = QVariant::fromValue(ptr); // ok
</code></pre>
]]></description><link>https://forum.qt.io/post/381790</link><guid isPermaLink="true">https://forum.qt.io/post/381790</guid><dc:creator><![CDATA[jpnurmi]]></dc:creator><pubDate>Mon, 13 Mar 2017 16:51:46 GMT</pubDate></item></channel></rss>