Results 1 to 1 of 1

Thread: The widget won't scroll in QListWidget (via setItemWidget() )

  1. #1
    Join Date
    Oct 2010
    Posts
    10
    Thanks
    1

    Default Re: The widget won't scroll in QListWidget (via setItemWidget() )

    Hi all,
    I design a custom widget(named MyPanel) inheritanced QWidget, and I add a QListWidget inside it. The QListWidget works well, but if I try to replace the text with a custom widget via setItemWidget(), it looks well, but the scrolling is failed (The custom widgets won't scroll..)

    If I create the MyPanel object, it works:
    MyPanel panel;
    panel.show() // The custom widget and scrollbar works well.

    But if I create the MyPanel inside another QWidget, it fails:

    class BigPanel:QDialog
    {
    ...
    MyPanel *panel = new MyPanel(this);
    QVBoxLayout* layout_v = new QVBoxLayout(this);
    setLayout(layout_v);
    layout_v->addWidget(panel, 0, Qt::AlignCenter);
    ...
    }

    Does anybody have idea on it? Thanks~


    Added after 1 45 minutes:


    According to my test, I found that if I add the BigPanel into the QGraphicsScene by QGraphicsScene::addWidget(), it will fail. So I guess it may due to the event propagation issue.
    Last edited by diro; 29th November 2010 at 05:34.

Similar Threads

  1. QScrollArea -- Scroll to widget problem
    By qlands in forum Qt Programming
    Replies: 4
    Last Post: 15th September 2011, 13:16
  2. Replies: 7
    Last Post: 19th October 2010, 08:32
  3. Replies: 0
    Last Post: 16th June 2010, 13:09
  4. Replies: 0
    Last Post: 28th December 2009, 12:24
  5. Stacked Widget Scroll
    By csvivek in forum Qt Programming
    Replies: 6
    Last Post: 27th May 2008, 11:36

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.