Problems with Open-Source Downloads read and

QML Listview with C++ Model

  • Hi everybody

    At the moment I'm writing a small messenger app.
    It's a simple app which contains of the following UI elements

    • ListView
    • TextInput
    • Send Button

    The C++ model is based on QAbstractListModel

    Everytime a user enters a text in the input field and press send it appears via the C++ model in the ListView.

    Now I would like to have the following behavior:
    The newest message shall appear at the bottom of the listview and the previous element shall move up.

    According to the doc I set "verticalLayoutDirection":http:// to ListView.BottomToTop.

    In my QAbstractListModel I have a simple QStringList member where I add my elements with
    "push_front(const T & value)":

    Now I have the following problem. The listview show the element from BottomUp but the newest element will be added on the top of the previous and not below.
    The same behavior can be found in skype where you can see the newest message near the inputfield.

    Any ideas?
    Thanks for the help.

    Best regards

Log in to reply