Results 1 to 3 of 3

Thread: add custom widget items to QListView or QListWidget

  1. #1
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default add custom widget items to QListView or QListWidget

    Hello All

    I want to do a custom list that has the following items in it, its formed of 2 lines,
    on the first line, it will have a QLabel object, and on the other line, it will have 2 QPushButton objects. almost the same as the pic attached

    I'm wondering on what is the best way to perform this, and how to implement this functionality.
    I want to add this item to custom qlistwidget or qlistview, whichever is doable

    any suggestion is more than welcome

    thankx
    Attached Images Attached Images
    • File Type: jpg 1.JPG (4.9 KB, 591 views)

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: add custom widget items to QListView or QListWidget

    Both are possible, but for beginning a QListWidget is easier. Just use QListWidget::setItemWidget() and set your custom widget composed out of a label and buttons.

  3. The following user says thank you to Lykurg for this useful post:

    yazwas (26th December 2009)

  4. #3
    Join Date
    Sep 2010
    Posts
    7
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default Re: add custom widget items to QListView or QListWidget

    Heiii, Thank you.

    I've been looking for about setItemWidget and first I found some simple examples, Intresting.
    Howver, later I found this: http://www.qtcentre.org/threads/2777...getItem-how-to

    It's just what I was looking for.

    Yeah, it's easy. However, when you know it. xD.


    Thank you!!!.

    PD. Sorry for my English. I'm trying to improve it.

Similar Threads

  1. How to use custom widget editor with QItemDelegate
    By wysman in forum Qt Programming
    Replies: 2
    Last Post: 20th May 2009, 18:20
  2. How to make QListWidget items editable?
    By montylee in forum Qt Programming
    Replies: 14
    Last Post: 3rd October 2008, 09:57
  3. Custom Widget - First Steps
    By sekatsim in forum Qt Programming
    Replies: 8
    Last Post: 26th June 2008, 17:19
  4. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  5. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38

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.