Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Prepend items in QListWidget - Qt [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

Prepend items in QListWidget - Qt [SOLVED]

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raj.qtdev
    wrote on last edited by
    #1

    Hi,

    I am drawing a custom list of items in the following manner:

    @mChatList = new QListWidget(this);@

    @ CustomChatBubble *myChat = new CustomChatBubble(message);

            if(mChatList!=NULL)
            {
                QListWidgetItem *newItem = new QListWidgetItem(mChatList);
                newItem->setSizeHint(QSize(myChat->width(), myChat->height()));
                mChatList->setItemWidget(newItem, myChat);
                row = mChatList->row(newItem);
                myChat->storeRowNumber(row);
                mChatList->scrollToItem(newItem);
            }
        }
    

    @

    This is working fine and the list scrolls to the latest item as well.

    Now i want to show older messages in the same list which should load before the existing items in the list. I tried to use @insertItem(item, row) @ method for this but that is also just appending items to the list. I want a kind of prepend operation.

    Can somebody suggest something on this?

    Thanks

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raj.qtdev
      wrote on last edited by
      #2

      Hi,

      I found the solution. Here is the link

      "Your text to link here...":https://qt-project.org/forums/viewthread/30732/

      thanks

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved