Results 1 to 3 of 3

Thread: problem in QList< QWidget *>

  1. #1
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    9

    Default problem in QList< QWidget *>

    normally we do initialize for pointer like this...
    Qt Code:
    1. QWidget * widget;
    2. widget = new QWidget;
    To copy to clipboard, switch view to plain text mode 

    how about
    QList< QWidget *> list;
    how to do initialize for QList<QWidget *> ?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem in QList< QWidget *>

    Qt Code:
    1. QList<QWidget*> *list = new QLisl<QWidget*>();
    To copy to clipboard, switch view to plain text mode 

    Is this what you mean?

  3. #3
    Join Date
    Aug 2006
    Posts
    44
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: problem in QList< QWidget *>

    Or, just use QWidgetList. ;-)

    Most of the time, I typedef template usages just for code legibility, and to keep my sanity if I change something later like, say, to a vector rather than a list.

    In any case, what marcel said is right.

Similar Threads

  1. 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
  •  
Qt is a trademark of The Qt Company.