[Qt-interest] Question regarding pointer parameters in functions
Donal O'Connor
donaloconnor at gmail.com
Fri Jul 3 10:50:41 CEST 2009
I think the QStandardItemModel object takes ownership of the memory
allocated in this case.
On Fri, Jul 3, 2009 at 9:49 AM, Donal O'Connor <donaloconnor at gmail.com>wrote:
> No,
>
> Only objects created on the stack in that function will be removed when
> function ends.
>
>
>
> 2009/7/3 Patric <userqt at gmail.com>
>
>> Hello,
>> does anyone know what happens if we pass a pointer as parameter to
>> function in QT ?
>> Will the function release the memory of the object in the pointer, when it
>> finish working with it ?
>>
>> For example
>>
>> void QStandardItemModel::appendRow ( QStandardItem * item ), if I call it
>> the following way : appendRow(new QStandardItem("testItem"));
>>
>> Thank you in advance,
>> Patric
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090703/47fb68cc/attachment.html
More information about the Qt-interest-old
mailing list