Important: Please read the Qt Code of Conduct -

I want make custom List Item

  • I want make custom List Item look like this:

    (icon) (text)
    (text) (spin box) (text)

    ★ star
    quantity: ___Ea

    ● circle
    quantity: ___Ea

    ☎ telephone
    quantity: ___Ea

    (It may have a scroll bar on the right side, too)

    Actually, once I made it with Widget class but it's just a Widget rather than a List.
    Also I've heard about MVC concept and some related classes (i.e. QAbstractListModel and ItemView, Deligate, etc.),
    but it's somewhat difficult (and I'm not good at English) so I cannot understand it without some examples.
    Is there any simple example code or VERY easy program source code implementing this kind of List Item?

  • ListItem for QML ListView?

  • I think examples/itemviews will help you. Something like spinboxdelegate or stardelegate

  • Well, forget QListView.
    It's the last thing you want..
    All you have to do is to create a new widget class. Then you create a layout class to layout the widgets in vertical or whatever you want.
    You don't have to make the layout class inherit from the QLayout things. Just make your own. It should be really simple.

    For example, you're making a twitter client. Then you can make a widget call EntryWidget. Then you create 100 of them. And use the layout class to position them.

    Oh, I forget to say maybe you need a QScrollBar..

Log in to reply