PDA

View Full Version : Problem with qvector



zorro68
23rd February 2008, 00:52
I have made a class like this:



class Listbox : public QWidget
{
Q_OBJECT
public:
Listbox(int width, QWidget *parent = 0);
......


and then in other class I define this:



QVector<Listbox> *listbox;
...
listbox = new QVector<Listbox>();


And I try to append items to my vector like this:


listbox.append(Listbox);


But I can't. I get errors.

How can I append items to my empty qvector of Listboxes????:confused:

zorro68
23rd February 2008, 01:02
I have just find the solution:



QVector<Listbox*> listbox;
listbox.append(new Listbox(width,page_0));


Thanks;)