<?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[QEvent to QEnterEvent]]></title><description><![CDATA[<p dir="auto">I'm trying to update an old Qt project  I was getting an error in this line:</p>
<pre><code>protected:
    void enterEvent(QEnterEvent *event) override;
</code></pre>
<p dir="auto"><code>error: Non-virtual member function marked 'override' hides virtual member function</code></p>
<p dir="auto">I modified it to:</p>
<pre><code>protected:
    void enterEvent(QEnterEvent *event) override;
</code></pre>
<p dir="auto">Solved the error, but now I'm getting an error in this line:</p>
<pre><code>InteractiveButtonBase::enterEvent(new QEvent(QEvent::Type::None));
</code></pre>
<pre><code>C2664: 'void InteractiveButtonBase::enterEvent(QEnterEvent *)': cannot convert argument 1 from 'QEvent *' to 'QEnterEvent *'
error C2664: 'void InteractiveButtonBase::enterEvent(QEnterEvent *)': cannot convert argument 1 from 'QEvent *' to 'QEnterEvent *'
note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
note: see declaration of 'InteractiveButtonBase::enterEvent'
</code></pre>
<p dir="auto">I'm not sure how to fix it, could i get any help?</p>
]]></description><link>https://forum.qt.io/topic/140541/qevent-to-qenterevent</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 18:50:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/140541.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Nov 2022 04:01:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QEvent to QEnterEvent on Sun, 06 Nov 2022 09:00:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/roberrt">@<bdi>Roberrt</bdi></a> said in <a href="/post/735161">QEvent to QEnterEvent</a>:</p>
<blockquote>
<pre><code>void enterEvent(QEnterEvent *event) override;
</code></pre>
<p dir="auto">error: Non-virtual member function marked 'override' hides virtual member function<br />
I modified it to:<br />
protected:<br />
void enterEvent(QEnterEvent *event) override;</p>
</blockquote>
<p dir="auto">What did you change? It's both the same</p>
<blockquote>
<p dir="auto">InteractiveButtonBase::enterEvent(new QEvent(QEvent::Type::None));</p>
</blockquote>
<p dir="auto">You must not generate such events by yourself - they're created by Qt.<br />
If your function needs QEnterEvent you should create an <a href="https://doc.qt.io/qt-6/qenterevent.html" target="_blank" rel="noopener noreferrer nofollow ugc">QEnterEvent</a> and not a <a href="https://doc.qt.io/qt-6/qevent.html" target="_blank" rel="noopener noreferrer nofollow ugc">QEvent</a>.</p>
]]></description><link>https://forum.qt.io/post/735168</link><guid isPermaLink="true">https://forum.qt.io/post/735168</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sun, 06 Nov 2022 09:00:43 GMT</pubDate></item></channel></rss>