Results 1 to 20 of 70

Thread: How to show progess in a QTreeView item ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: How to show progess in a QTreeView item ?

    What do you mean? The view calls the delegate when it needs to update some part of its viewport. If you want to force a redraw, just update() the viewport (whole or part of it).

  2. #2
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to show progess in a QTreeView item ?

    Where do I get viewport to update ?
    C++ & AMD forever

  3. #3
    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: How to show progess in a QTreeView item ?

    From the view

  4. #4
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to show progess in a QTreeView item ?

    Is it so hard to answer more widely?

    If I do so will it repaint my delegate ?
    Qt Code:
    1. QTableWidget* tableWidget = new QTableWidget(this);
    2. ItemDelegate delegate = new ItemDelegate(tableWidget);
    3. tableWidget->setItemDelegateForColumn(4, delegate);
    4. ..........................................................
    5. ..........................................................
    6. tableWidget->update();
    To copy to clipboard, switch view to plain text mode 
    Thanks in advance
    C++ & AMD forever

  5. #5
    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: How to show progess in a QTreeView item ?

    No, it won't repaint your delegate, it will repaint your view. The delegate can't be "repainted", it is nothing visual, it's strictly a helper object that does some work on behalf of the view.

  6. #6
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to show progess in a QTreeView item ?

    Ok Will it repaint my progressbar ? Or will it call ItemDelegate:: paint() ?
    C++ & AMD forever

  7. #7
    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: How to show progess in a QTreeView item ?

    It depends If nothing in the item changed, the view might not call the delegate (especially if the item is currently not visible), but in general case - yes, it will call your delegate's paint method.

  8. #8
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to show progess in a QTreeView item ?

    In my case it doesn't want to update

    Could you suggest any other solutions ?
    C++ & AMD forever

  9. #9
    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: How to show progess in a QTreeView item ?

    What exactly is your usecase? What exactly did you do and what do you want to achieve?

  10. #10
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to show progess in a QTreeView item ?

    The thing is that I have a fancy progressbar that changes its colour depending on the state of download and when I start download the color doesn't change
    It looks like on the first screenshot though it should look like on the second
    Attached Images Attached Images
    • File Type: jpg 1.jpg (4.8 KB, 34 views)
    • File Type: jpg 2.jpg (3.8 KB, 28 views)
    C++ & AMD forever

  11. #11
    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: How to show progess in a QTreeView item ?

    Do you update the values in the items?

  12. #12
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to show progess in a QTreeView item ?

    Quote Originally Posted by wysota View Post
    Do you update the values in the items?
    What values and where ? Did not understand at all
    C++ & AMD forever

Similar Threads

  1. Replies: 4
    Last Post: 26th September 2011, 12:02
  2. QTreeView and item editing
    By roxton in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 18:56
  3. QTreeView, QSortFilterProxyModel and item expansions
    By benacler in forum Qt Programming
    Replies: 3
    Last Post: 21st May 2008, 20:30
  4. QTreeView: selection behavior upon selected item removal
    By Pieter from Belgium in forum Qt Programming
    Replies: 6
    Last Post: 11th July 2007, 16:00
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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.