Results 1 to 9 of 9

Thread: A progress bar into treeView or something like that.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2011
    Posts
    10
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: A progress bar into treeView or something like that.

    Quote Originally Posted by wysota View Post
    Why do you want to create a new model? If just one item in it changes, simply update this one item.
    Yes, that is my problem, How I do it? How I simply update this one item? I dont know how a can update this one QModelIndex of QStandarItemModel...

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


  3. #2
    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: A progress bar into treeView or something like that.

    Using QStandardItem::setData() or QAbstractItemModel::setData() depending on what you're operating on.
    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.


  4. The following user says thank you to wysota for this useful post:


  5. #3
    Join Date
    Oct 2011
    Posts
    10
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: A progress bar into treeView or something like that.

    Thank you. I was confused because the documentation says:

    Sets the role data for the item at index to value.

    Returns true if successful; otherwise returns false.

    The dataChanged() signal should be emitted if the data was successfully set.

    The base class implementation returns false. This function and data() must be reimplemented for editable models.
    I thought for use setData() is necessary implement this virtual function because by default returns false....

  6. The following user says thank you to nilhcraiv for this useful post:


  7. #4
    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: A progress bar into treeView or something like that.

    It returns false in QAbstractItemModel. But QStandardItemModel is a subclass of it which reimplements this method.
    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.


  8. The following user says thank you to wysota for this useful post:


  9. #5
    Join Date
    Oct 2011
    Posts
    10
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: A progress bar into treeView or something like that.

    Thank you, setData() is what I needed.

  10. The following user says thank you to nilhcraiv for this useful post:


Similar Threads

  1. How to use progress bar
    By bijay in forum Newbie
    Replies: 1
    Last Post: 28th March 2012, 10:44
  2. How to use progress bar
    By Ashwani in forum Newbie
    Replies: 6
    Last Post: 10th September 2010, 15:19
  3. Replies: 4
    Last Post: 11th March 2008, 11:44
  4. Reg - Progress bar
    By suresh in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2006, 15:11

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.