<?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[template problem]]></title><description><![CDATA[<p>Hallo C++ Community,</p>
<p>ich habe eine Klasse TempSensor, diese ist vererbt von QLabel..<br />
Jetzt versuche ich mein erstelles Objekt von DragTab (erbt von QTabWidget) in einer QMap zu abzulegen.</p>
<p>QMap&lt;QString, DragTab&lt;QLabel&gt;* &gt; mapTabs;<br />
mapTabs[&quot;Analog&quot;] = new DragTab&lt;TempSensor&gt;(&quot;Analog&quot;, objInputTabWidget);</p>
<p>Doch ich bekomme diesen Compilerfehler:</p>
<p>d:\...\Designer.cpp(17): error C2440: '=': 'DragTab&lt;T&gt; *' kann nicht in 'DragTab&lt;T&gt; ' konvertiert werden<br />
with<br />
[<br />
T=TempSensor<br />
]<br />
and<br />
[<br />
T=QLabel<br />
]</p>
<p>Ich hab schon alles mögliche probiert was mir eingefallen ist, doch irgendwie komm ich nicht drauf...</p>
<p>MFG<br />
TheHam</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/186698/template-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 10:20:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/186698.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Jul 2007 14:14:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to template problem on Wed, 11 Jul 2007 14:14:55 GMT]]></title><description><![CDATA[<p>Hallo C++ Community,</p>
<p>ich habe eine Klasse TempSensor, diese ist vererbt von QLabel..<br />
Jetzt versuche ich mein erstelles Objekt von DragTab (erbt von QTabWidget) in einer QMap zu abzulegen.</p>
<p>QMap&lt;QString, DragTab&lt;QLabel&gt;* &gt; mapTabs;<br />
mapTabs[&quot;Analog&quot;] = new DragTab&lt;TempSensor&gt;(&quot;Analog&quot;, objInputTabWidget);</p>
<p>Doch ich bekomme diesen Compilerfehler:</p>
<p>d:\...\Designer.cpp(17): error C2440: '=': 'DragTab&lt;T&gt; *' kann nicht in 'DragTab&lt;T&gt; ' konvertiert werden<br />
with<br />
[<br />
T=TempSensor<br />
]<br />
and<br />
[<br />
T=QLabel<br />
]</p>
<p>Ich hab schon alles mögliche probiert was mir eingefallen ist, doch irgendwie komm ich nicht drauf...</p>
<p>MFG<br />
TheHam</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323174</guid><dc:creator><![CDATA[TheHam]]></dc:creator><pubDate>Wed, 11 Jul 2007 14:14:55 GMT</pubDate></item><item><title><![CDATA[Reply to template problem on Wed, 11 Jul 2007 14:36:50 GMT]]></title><description><![CDATA[<p>Die Begründung wurde im Grunde schon in <a href="http://c-plusplus.net/forum/viewtopic-var-t-is-186582.html" rel="nofollow">http://c-plusplus.net/forum/viewtopic-var-t-is-186582.html</a> geliefert - DragTab&lt;T1&gt; und DragTab&lt;T2&gt; sind völlig unabhängige Objekte, selbst wenn T1 und T2 verwandt sind. Du kannst z.B. eine allgemeine Klasse DragTab (als Ableitung von QTabWidget und als Basis von DragTab&lt;T&gt;) erstellen, die Du in die Map packst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323198</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323198</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 11 Jul 2007 14:36:50 GMT</pubDate></item><item><title><![CDATA[Reply to template problem on Wed, 11 Jul 2007 14:42:24 GMT]]></title><description><![CDATA[<p>Sorry... aber irgendwie versteh ich nicht ganz was du meinst</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323204</guid><dc:creator><![CDATA[TheHam]]></dc:creator><pubDate>Wed, 11 Jul 2007 14:42:24 GMT</pubDate></item><item><title><![CDATA[Reply to template problem on Wed, 11 Jul 2007 14:46:21 GMT]]></title><description><![CDATA[<p>DragTab&lt;QLabel&gt; und DragTab&lt;TempSensor&gt; sind zwei unabhängige Klassen, die nicht miteinander verwandt sind, auch wenn TempSensor von QLabel abgeleitet ist. Deshalb kannst Du einen Zeiger auf DragTab&lt;TempSensor&gt; nicht in einen Zeiger auf DragTab&lt;QLabel&gt; umwandeln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323211</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323211</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 11 Jul 2007 14:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to template problem on Wed, 11 Jul 2007 14:56:53 GMT]]></title><description><![CDATA[<p>D.h. ich mach etz ne Klasse Dragtab, die erbt von QTabWidget und eine DragTab&lt;T&gt; die von DragTab erbt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323223</guid><dc:creator><![CDATA[TheHam]]></dc:creator><pubDate>Wed, 11 Jul 2007 14:56:53 GMT</pubDate></item><item><title><![CDATA[Reply to template problem on Wed, 11 Jul 2007 15:00:26 GMT]]></title><description><![CDATA[<p>Das wäre eine Möglichkeit, um alle DragTab&lt;T&gt; (die ja alle von DragTab erben) gemeinsam in einem Container lagern zu können. Ob das sinnvoll ist hängt natürlich vom genauen Zweck ab (und den kenne ich nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> ).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1323228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1323228</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 11 Jul 2007 15:00:26 GMT</pubDate></item></channel></rss>