Results 1 to 2 of 2

Thread: Problem with qvector

  1. #1
    Join Date
    Jan 2007
    Posts
    95
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with qvector

    I have made a class like this:

    Qt Code:
    1. class Listbox : public QWidget
    2. {
    3. Q_OBJECT
    4. public:
    5. Listbox(int width, QWidget *parent = 0);
    6. ......
    To copy to clipboard, switch view to plain text mode 

    and then in other class I define this:

    Qt Code:
    1. QVector<Listbox> *listbox;
    2. ...
    3. listbox = new QVector<Listbox>();
    To copy to clipboard, switch view to plain text mode 

    And I try to append items to my vector like this:
    Qt Code:
    1. listbox.append(Listbox);
    To copy to clipboard, switch view to plain text mode 

    But I can't. I get errors.

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

  2. #2
    Join Date
    Jan 2007
    Posts
    95
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with qvector

    I have just find the solution:

    Qt Code:
    1. QVector<Listbox*> listbox;
    2. listbox.append(new Listbox(width,page_0));
    To copy to clipboard, switch view to plain text mode 

    Thanks

Similar Threads

  1. problem with opengl, zooming, drawpixels, and origin
    By ntp in forum General Programming
    Replies: 0
    Last Post: 22nd February 2008, 21:48
  2. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  3. QVector
    By sabeesh in forum Qt Programming
    Replies: 2
    Last Post: 17th September 2007, 14:37
  4. QVector problem
    By kingslee in forum Qt Programming
    Replies: 5
    Last Post: 19th October 2006, 10:42
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.