Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42635

Editor jumps to cursor position when getting focus

XMLWordPrintable

      1. Open a long text in a small QPlainTextEdit:
        #include <QApplication>
        #include <QPlainTextEdit>
        
        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
            QPlainTextEdit w;
            w.show();
        
            return a.exec();
        }
        
      2. Leave the text cursor at the top of the text and scroll the edit down towards the end.
      3. Remove the focus from the application e.g. by switching to a different application.
        Earlier on, the edit would have scrolled all the way up to the position of the cursor. Fortunately we don't have that problem anymore because QTBUG-40755 was fixed.
      4. Give focus back to the application, e.g. by clicking its title bar by pressing Alt+Tab.
        The edit scrolls all the way up to the position of the cursor.

      The edit should not move at all when losing or getting focus.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            liaqi Liang Qi
            rlohning Robert Löhning
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes