<?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&#x27;s object does not call constructor when resizing qvector]]></title><description><![CDATA[<pre><code>QVector&lt;cStandard_MeasureData*&gt;	m_Result;


class cStandard_MeasureData
{
private:
	QList&lt;float&gt;*			m_lWave;
	QList&lt;float&gt;*			m_lBase1;
	QList&lt;float&gt;*			m_lBase2;
	QList&lt;float&gt;*			m_lDerivate;

public:
	cStandard_MeasureData();
	~cStandard_MeasureData();

	QList&lt;float&gt;* GetWave()		{ return m_lWave;		};
	QList&lt;float&gt;* GetBase1()	{ return m_lBase1;		};
	QList&lt;float&gt;* GetBase2()	{ return m_lBase2;		};
	QList&lt;float&gt;* GetDerivate() { return m_lDerivate;	};
};

cStandard_MeasureData::cStandard_MeasureData()
{
	m_lWave		= new QList&lt;float&gt;();
	m_lBase1	= new QList&lt;float&gt;();
	m_lBase2	= new QList&lt;float&gt;();
	m_lDerivate = new QList&lt;float&gt;();
};

cStandard_MeasureData::~cStandard_MeasureData()
{
	delete m_lWave;
	delete m_lBase1;
	delete m_lBase2;
	delete m_lDerivate;
};
</code></pre>
<p dir="auto">After clear() the variable of m_Result, resize(8) is called. When resize is called, cStandard_MeasureData() constructor should be called, but it is not called.</p>
]]></description><link>https://forum.qt.io/topic/136625/template-s-object-does-not-call-constructor-when-resizing-qvector</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 08:58:04 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/136625.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 May 2022 02:11:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Template&#x27;s object does not call constructor when resizing qvector on Thu, 19 May 2022 05:32:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iknowqt">@<bdi>IknowQT</bdi></a> said in <a href="/post/714673">Template's object does not call constructor when resizing qvector</a>:</p>
<blockquote>
<p dir="auto">When resize is called, cStandard_MeasureData() constructor should be called</p>
</blockquote>
<p dir="auto">Why should it be called?<br />
Your m_Result contains pointers to cStandard_MeasureData, not cStandard_MeasureData.</p>
]]></description><link>https://forum.qt.io/post/714678</link><guid isPermaLink="true">https://forum.qt.io/post/714678</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 19 May 2022 05:32:29 GMT</pubDate></item></channel></rss>