Results 1 to 2 of 2

Thread: emitDataChanged and dataChanged signal

  1. #1
    Join Date
    Dec 2007
    Posts
    119
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default emitDataChanged and dataChanged signal

    I'm trying to do something like this: I'm using a QStandardItemModel and populate it with a custom subclass of QStandardItem : MyStandardItem.

    I rimplemented the setData calling emitDataChanged() because I don't call the base implementation of setData() (such as exaplained in qt documentation).
    Unfortunately emitDataChanged() didn't seem to trigger my model's dataChanged() signal. Why? Are there other somethings to know when using emitDataChanged?

  2. #2
    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: emitDataChanged and dataChanged signal

    How do you know that your model's dataChanged() signal is not triggered? Have you used the debugger to follow your setData() code into the emitDataChanged() call to see what happens? Or are you simply assuming that because your slot isn't being called, nothing that precedes it is working?

Similar Threads

  1. Why the signal "dataChanged" by QTableWidget not work?
    By Tao Clark in forum Qt Programming
    Replies: 1
    Last Post: 20th August 2011, 18:16
  2. QSqlTableModel & datachanged()
    By noValue in forum Newbie
    Replies: 5
    Last Post: 26th November 2010, 01:26
  3. Clarification about dataChanged
    By airbites in forum Qt Programming
    Replies: 2
    Last Post: 29th July 2009, 17:02
  4. QAbstractTreeModel & dataChanged()
    By tntcoda in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2009, 01:12
  5. dataChanged does not re-sort the view
    By alex9099 in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2008, 21:14

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.