Results 1 to 20 of 20

Thread: The dataChanged Signal Not Performing as Expected

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The dataChanged Signal Not Performing as Expected

    There must be another reason - from the C++ side it doesn't matter - see https://en.cppreference.com/w/cpp/la...ault_arguments or a good C++ book.

  2. #2
    Join Date
    Nov 2016
    Location
    Ridgecrest California
    Posts
    33
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: The dataChanged Signal Not Performing as Expected

    I don't disagree, that in C++ that's the way it works. However I am at a loss understanding what exactly is happening here. I am simply attempting to let anyone else who may run into a similar circumstance, know how I resolved the situation.

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

    Default Re: The dataChanged Signal Not Performing as Expected

    I don't disagree, that in C++ that's the way it works.
    As Christian points out, there is absolutely no difference between emitting dataChanged() with two arguments vs. with a third argument being an empty (but explicitly declared) QVector<int>(). Both versions should compile to exactly the same thing (with the compiler inserting the default argument in the first instance), so there is absolutely no way that a slot receiving the signal can tell how it was called in the source code. If you are seeing a difference in behavior if you build and run code written first one way and then the other with no other code changes and exactly the same runtime test conditions then I would also be at a loss to explain why.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. QTableView switching currentIndex not performing as expected
    By AlphaWolfXV in forum Qt Programming
    Replies: 6
    Last Post: 31st December 2013, 14:22
  2. Get indices of rows where the signal dataChanged() was emitted
    By yannwilfried in forum Qt Programming
    Replies: 6
    Last Post: 8th August 2013, 09:19
  3. emitDataChanged and dataChanged signal
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2012, 15:47
  4. Why the signal "dataChanged" by QTableWidget not work?
    By Tao Clark in forum Qt Programming
    Replies: 1
    Last Post: 20th August 2011, 17:16
  5. QDir entryList performing slowly
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 8th October 2009, 16:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.