Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Window scroll issue for continuous data

    General and Desktop
    qt 5.4.1 mdiarea scroll bar
    2
    5
    1591
    Loading More Posts
    • 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
      Narthan last edited by

      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 Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by

        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 Reply Quote 1
        • N
          Narthan @Chris Kawa last edited by

          @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 Reply Quote 0
          • Chris Kawa
            Chris Kawa Moderators last edited by

            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 Reply Quote 0
            • N
              Narthan @Chris Kawa last edited by

              @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 Reply Quote 0
              • First post
                Last post