Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Window scroll issue for continuous data
QtWS25 Last Chance

Window scroll issue for continuous data

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 5.4.1mdiareascroll bar
5 Posts 2 Posters 2.0k Views
  • 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.
  • N Offline
    N Offline
    Narthan
    wrote on last edited by
    #1

    Hi ,
    in mdi window, I am appending data continuously , i want to make scroll bar independent of data, if i stopped appending data to mdi window then this scroll will work properly, otherwise if data is continuously appending , even if we scroll to top, scroll will come to bottom, i tried scroll at bottom and top, but i don't want top or bottom, it should independent. for example Qt creator compile output window scrollbar, give some suggestions to solve this issue.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      What is a mdi window and what data do you add there? Is it like QTextEdit or something?
      If so then the behavior is as follows:

      • if the cursor was at the end when you appended text the cursor will be moved to the end and the view will scroll to it
      • if the cursor was not at the end when you appended text the cursor position will not change and the view won't scroll

      So if you don't want the view to scroll make sure the cursor is not at the end when you append text.

      N 1 Reply Last reply
      1
      • Chris KawaC Chris Kawa

        What is a mdi window and what data do you add there? Is it like QTextEdit or something?
        If so then the behavior is as follows:

        • if the cursor was at the end when you appended text the cursor will be moved to the end and the view will scroll to it
        • if the cursor was not at the end when you appended text the cursor position will not change and the view won't scroll

        So if you don't want the view to scroll make sure the cursor is not at the end when you append text.

        N Offline
        N Offline
        Narthan
        wrote on last edited by
        #3

        @Chris-Kawa
        Yes, I'm appending text only in the mdi window. If I continuously adding data to the mdi window's table model cursor is always at the end, if I scroll also the cursor is not moving because the data is appending very fast to the table model. consider about terminal even though the data is coming fast we can able to scroll the scrollbar and we can see the previous data. Like the scroll bar functionality I need in my application.

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Sorry, I don't understand. So is it a text edit or a table model? Models don't have cursors. What classes do you use? The best would be if you provided a small reproducible code example.

          N 1 Reply Last reply
          0
          • Chris KawaC Chris Kawa

            Sorry, I don't understand. So is it a text edit or a table model? Models don't have cursors. What classes do you use? The best would be if you provided a small reproducible code example.

            N Offline
            N Offline
            Narthan
            wrote on last edited by
            #5

            @Chris-Kawa Hi..
            Ok, we have one model , we are continuously appending data, on that time scroll will be always at bottom, even if we scroll to top , it will come back to bottom, until wee stop appending.
            void CustomeTableView::createTabel(QString thText)
            {
            if(modelList.count()<=25000)
            {

                modelList.append(thText);
                numRows = modelList.count();
                    for (int row = 0; row < numRows; row++)
                    {
                        for (int column = 0; column < numColumns; column++)
                        {
                            QStandardItem *item = new QStandardItem(modelList[row]);
                            fsModel->setItem(row, column, item);
                        }
                    }
            }
            

            }

            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