Results 1 to 6 of 6

Thread: QStringList scope problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    37
    Thanked 53 Times in 40 Posts

    Default Re: QStringList scope problem

    The error you have is you declare stringlist with same name - one as class member and the other inside function1. Due to scoping rules of c++, your class member isn't modified instead only the one declared in function1 is modified.

    Replace this line in function1
    Qt Code:
    1. QStringList list2(list);
    To copy to clipboard, switch view to plain text mode 

    with
    Qt Code:
    1. list2 = list;
    To copy to clipboard, switch view to plain text mode 
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

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

    ht1 (30th November 2007)

Similar Threads

  1. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 03:49
  2. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 13:19
  3. QT4 scope problem
    By the_bis in forum Newbie
    Replies: 5
    Last Post: 30th January 2007, 00:01
  4. QStringList in QObject::connect
    By DPinLV in forum Qt Programming
    Replies: 6
    Last Post: 6th September 2006, 18:01
  5. Cannot queue arguments of type 'QStringList'
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 19th April 2006, 21:48

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.