class test
{
public:
int a;
void lol(int t)
{
a=t;
}
};
QList<test> list;
test *pp = new test; // or another instance of test created otherwise
pp->lol(value);
list.append(*pp);
// accessing list
test someitem = list.at(0); // read-only access to list
list[0].lol(othervalue); // read/wrie access to list
list.removeAt(0); // remove item 0 from the list, item 0 gets deleted
someitem = list.takeAt(0); // remove item 0 from the list [i]and return it[/i], item 0 gets deleted from the list, indexes get shifted
list.clear(); // delete all items in list
// etc. etc. See QList documentation
class test
{
public:
int a;
void lol(int t)
{
a=t;
}
};
QList<test> list;
test *pp = new test; // or another instance of test created otherwise
pp->lol(value);
list.append(*pp);
// accessing list
test someitem = list.at(0); // read-only access to list
list[0].lol(othervalue); // read/wrie access to list
list.removeAt(0); // remove item 0 from the list, item 0 gets deleted
someitem = list.takeAt(0); // remove item 0 from the list [i]and return it[/i], item 0 gets deleted from the list, indexes get shifted
list.clear(); // delete all items in list
// etc. etc. See QList documentation
To copy to clipboard, switch view to plain text mode
Bookmarks