
Originally Posted by
anda_skoa
The question remains: what other row do you need?
You have the row that you are inserting, yet you seem to need a pointer to something else. What is the something else you need?
Earlier you posted this
Myobj(QStandartItem* incItem)
{
//some code with newItem
incItem->appendRow(newItem)
// at this point i need to know the address of newly created row. So i can do this;
rowPointer = newRowPointer;
}
Myobj(QStandartItem* incItem)
{
QstandartItem *newItem new QStandardItem;
//some code with newItem
incItem->appendRow(newItem)
// at this point i need to know the address of newly created row. So i can do this;
rowPointer = newRowPointer;
}
To copy to clipboard, switch view to plain text mode
inCitem->appendRow(newItem) creates a new row. That pointer you obviously have (newItem).
What does that "newRowPointer" point to?
Cheers,
_
Wow I've made a mistake while exampling the code. it is actually like that;
Myobj
(QStringList* incItemList, QStandartItem
* parentRow
){
// creatinf new items to build a new row
QstandartItem
*newItem_1
= new QStandardItem(incItemList
->at
(0));
QstandartItem
*newItem_2
= new QStandardItem(incItemList
->at
(1));
QstandartItem
*newItem_3
= new QStandardItem(incItemList
->at
(2));
// now creating a new subRow and filling it with the newly created items
Qlist<QStandartItem*> newRow;
newrow.append (newItem_1);
newrow.append (newItem_2);
newrow.append (newItem_3);
// now append new subRow to the parent row.
// I do not know what is the pointer or handler of the subrow I've added. I'm just adding it to the parent row, and the items are
// being appended to the row with index of like (parentRowIndex,1) , (parentRowIndex,2) , (parentRowIndex,3) respect to newItem_1 newItem_2 newItem_3.
parentRow->appendRow(newRow);
// at this point i need to know the address of newly created row. So i can do this;
rowPointer = newRowPointer;
}
Myobj(QStringList* incItemList, QStandartItem* parentRow)
{
// creatinf new items to build a new row
QstandartItem *newItem_1 = new QStandardItem(incItemList->at(0));
QstandartItem *newItem_2 = new QStandardItem(incItemList->at(1));
QstandartItem *newItem_3 = new QStandardItem(incItemList->at(2));
// now creating a new subRow and filling it with the newly created items
Qlist<QStandartItem*> newRow;
newrow.append (newItem_1);
newrow.append (newItem_2);
newrow.append (newItem_3);
// now append new subRow to the parent row.
// I do not know what is the pointer or handler of the subrow I've added. I'm just adding it to the parent row, and the items are
// being appended to the row with index of like (parentRowIndex,1) , (parentRowIndex,2) , (parentRowIndex,3) respect to newItem_1 newItem_2 newItem_3.
parentRow->appendRow(newRow);
// at this point i need to know the address of newly created row. So i can do this;
rowPointer = newRowPointer;
}
To copy to clipboard, switch view to plain text mode
sorry for misexplaining, did this reply your question?
Bookmarks