Does QList clear function call clears the memories of dynamically allocated objects that are stored in the QList?
<p>So I have class called <code>AppointmentSchedule</code> which is of the following type:</p>

<pre><code>namespace Ui {
class AppointmentSchedule;
}

class AppointmentSchedule : public QWidget
{
    Q_OBJECT

public:
    explicit AppointmentSchedule(QWidget *parent = 0);
    ~AppointmentSchedule();
    Ui::AppointmentSchedule *ui;
};
</code></pre>

<p>The <code>ui</code> of this class consists of two objects of type <code>QLabel</code> and two objects of type <code>QDateTimeEdit</code>. In an external class, I need to have a <code>QList</code> of dynamically allocated objects of type <code>AppointmentSchedule</code>. I will append the dynamically allocated objects in the <code>QList</code> similar to the following way.</p>

<pre><code>QList&lt;AppointmentSchedule*&gt; scheduleList;

foreach (QDate date, dates)
{
     AppointmentSchedule * newSchedule = new AppointmentSchedule(this);//Allocation of memory
     QDateTime sDateTime(date, QTime(8, 0, 0));
     newSchedule-&gt;ui-&gt;appointmentStartDateTimeEdit-&gt;setDateTime(sDateTime);
     QDateTime eDateTime(date, QTime(8, 15, 0));
     newSchedule-&gt;ui-&gt;appointmentEndDateTimeEdit-&gt;setDateTime(eDateTime);
     scheduleList.append(newSchedule);
}
</code></pre>

<p>If I call the <code>clear()</code> function of the <code>QList</code> like this:</p>

<pre><code>scheduleList.clear();
</code></pre>

<p>Will it deallocate all the memory I have allocated?</p>

<p>Thanks.</p>