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. movePosition API does not work for large value of row (>17k)

movePosition API does not work for large value of row (>17k)

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 199 Views 2 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
    Rajesh Pal
    wrote on last edited by
    #1

    QtextEditLocal QtextEditLocalObj;
    QFile file(myLocalFile);

    MacroTextEdit *textEdit = new MacroTextEdit(&QtextEditLocalObj;);

    textEdit->setPlainText(file.readAll());

    QTextCursor tc = textCursor();

    tc.movePosition(QTextCursor::Start);

    tc.movePosition(QTextCursor::NextBlock,QTextCursor::MoveAnchor, iRow);

    setTextCursor( tc );
    ensureCursorVisible();

    Below Qt5.15.2 APIs are too slow that make my application hang.

    1)-movePosition
    2)-setTextCursor

    How ever if I use previous version of Qt i.e Qt5.12.10.
    Both API works fine and have much better performance and not hanging my application anymore.
    Can anyone help me where i could be incorrect?
    is i am not using some other Api which are introduced in Qt5.15.2?
    The file on which i am working is 1 MB in size which contains 20k lines.

    Issue occure at tc.movePosition(QTextCursor::NextBlock,QTextCursor::MoveAnchor, iRow); when iRow is > 17k.

    when trying to jump from line 100 to 17k above api does not work and get hang.

    Thanks,
    Rajesh

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you already check the release notes to see if something changed with these classes ?

      If you have a minimal example showing that, you may also have found a regression. So the next step would be to check the bug report system to see if there's something related.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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