[Qt-interest] delete item of QVector on a QLayout

Frank Lutz frank422542 at googlemail.com
Fri Feb 19 11:27:27 CET 2010


You right, i do had meaning pop_back() not push_back:


--------------------------------------------------

QVector<QButtonGroup*> categories_btngrp;
QVector<QLineEdit*>    categories_le;

-------------------------------------------------

for(int i=0;i<4;i++){
	btngrp.push_back(new QButtonGroup);
	lineedit.push_back(new QLineEdit);
}

--------------------------------------------------

btngrp.pop_back();
lineedit.pop_back();

delete btngrp[i];
delete lineedit[i];

--------------------------------------------------


As i had tried to delete the item before push_back the pointer,
it do not have delete the pointer.


But thanks many!!! You have bring me on the way, now i know my misstake 
and will try to solve it.


Thank many!!!





More information about the Qt-interest-old mailing list