Results 1 to 20 of 21

Thread: inserting custom Widget to listview

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    4
    Thanked 140 Times in 132 Posts

    Default Re: inserting custom Widget to listview

    If you want to show only standard controls like labels, buttons, check boxes then the most efficient way is to make your own item delegate where in paint() method you paint those controls with QStyle (see drawControl() and others). But those controls are only drawn so you have to implement by hand event processing in QAbstractItemDelegate::editorEvent() and you have to make eventFilter and install it on view's viewport to which you have to enable mouse tracking (and maybe set WA_Hover attribute to get Leave and Enter events - I don't remember exactly). Sounds complicate but it is the most efficient way in case with simple widgets, because you don't really have any real widget objects.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

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

    MarkoSan (10th January 2010)

Similar Threads

  1. How to use custom widget editor with QItemDelegate
    By wysman in forum Qt Programming
    Replies: 2
    Last Post: 20th May 2009, 19:20
  2. Custom Widget - First Steps
    By sekatsim in forum Qt Programming
    Replies: 8
    Last Post: 26th June 2008, 18:19
  3. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 15:06
  4. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 16:38
  5. Custom tab widget question
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 12:17

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.