Results 1 to 6 of 6

Thread: QProgressBar in QTreeWidget?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QProgressBar in QTreeWidget?

    simple delegate example
    Qt Code:
    1. QWidget *MyItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
    2. {
    3. QProgressBar *bar = new QProgressBar(parent);
    4. bar->setMaximum(100);
    5. bar->setValue(50);
    6. return bar;
    7. }
    8.  
    9. void MyItemDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/*index*/) const
    10. {
    11. editor->setGeometry(option.rect);
    12. }
    To copy to clipboard, switch view to plain text mode 

    in widget:
    Qt Code:
    1. ...
    2. QTableWidget *tw = new QTableWidget(10, 2, this);
    3. tw->setItemDelegate(new MyItemDelegate);
    4. ...
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QProgressBar in QTreeWidget?

    J-P Nurmi

  3. #3
    Join Date
    Jul 2008
    Location
    Netherlands
    Posts
    33
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProgressBar in QTreeWidget?

    Quote Originally Posted by jpn View Post
    Thank you for pointing me there. Your example in that thread is extremely useful!

    I'm not sure whether I forgot to search or used the wrong terms, but I definitely need to sleep more

Similar Threads

  1. QTreeWidget Drag and Drop
    By tommydent in forum Qt Programming
    Replies: 10
    Last Post: 25th August 2008, 15:25
  2. QTreeWidget nextSibling()
    By user_mail07 in forum Newbie
    Replies: 1
    Last Post: 21st August 2008, 19:44
  3. QTreeWidget click
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 24th October 2007, 16:47
  4. how to add icons to QTreeWidget?
    By wei243 in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 08:34
  5. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32

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.