Results 1 to 8 of 8

Thread: QList::erase method does not work if I include an "emit signal" instruction

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QList::erase method does not work if I include an "emit signal" instruction

    no one talking about the elephant? Why are you instantiating a raw array of QList? Which voice in your head thought that was a good idea?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QList::erase method does not work if I include an "emit signal" instruction

    no one talking about the elephant?
    I thought it better to tackle things one step at a time. On the other hand, there's nothing basically wrong with declaring an array of QList<>. It will simply consist of an array of size MAX_CLIENTS of empty QList<> allocated on the stack. Nothing magic about that, and nothing that requires use of QVector< QList< PendingMsg > > or some other fancier data structure. Each QList<> in the array can be manipulated as if it were a standalone QList<>.

    I am not sure about the copy semantics, though. I am not sure if accessing "list[i]" results in the return of a copy or of a reference. If it is a copy, then that would be pretty inefficient.

Similar Threads

  1. Replies: 2
    Last Post: 27th January 2012, 17:29
  2. Why the signal "dataChanged" by QTableWidget not work?
    By Tao Clark in forum Qt Programming
    Replies: 1
    Last Post: 20th August 2011, 17:16
  3. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  4. Signal defined in "a.h" can not emit in "b.cpp"
    By Shawn in forum Qt Programming
    Replies: 9
    Last Post: 21st May 2007, 16:55
  5. Replies: 6
    Last Post: 3rd November 2006, 11:53

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.