Results 1 to 4 of 4

Thread: Better way to initialize QVector

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    46
    Thanks
    4
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Better way to initialize QVector

    Why would you want to initialize your container? Just forget about it you don't need to do that. And your second question, put typedef's outside of the class.

  2. The following user says thank you to RSX for this useful post:

    lyucs (24th August 2009)

  3. #2
    Join Date
    May 2009
    Posts
    17
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Better way to initialize QVector

    Quote Originally Posted by RSX View Post
    Why would you want to initialize your container? Just forget about it you don't need to do that. And your second question, put typedef's outside of the class.
    I.... don't? ookay, then

    It worked.

    thanks!

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Better way to initialize QVector

    You can always do it like this:
    Qt Code:
    1. Protocol::Protocol() : list_seconds(0) { ... }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 2
    Last Post: 1st May 2009, 07:35
  2. QVector copy constructor
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 3rd March 2008, 17:52
  3. Problem with qvector
    By zorro68 in forum Qt Programming
    Replies: 1
    Last Post: 23rd February 2008, 01:02
  4. QVector and QSetting
    By mattia in forum Newbie
    Replies: 1
    Last Post: 8th November 2007, 16:21
  5. QVector
    By sabeesh in forum Qt Programming
    Replies: 2
    Last Post: 17th September 2007, 14:37

Tags for this Thread

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.