Qt Forum

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

    Unsolved QTextCursor no visible

    General and Desktop
    3
    3
    89
    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.
    • M
      Martinuccia_96 last edited by

      Hi, I have a problem with QTextCursor.
      After moving it in a position, I can't see it on the screen anymore.
      The code that I'm using is :

      
          QTextCursor c=ui->textEdit->textCursor();
         
          c.movePosition(c.Start);
      
          c.movePosition(QTextCursor::MoveOperation::Right);
          c.movePosition(QTextCursor::MoveOperation::Right);
          c.movePosition(QTextCursor::MoveOperation::Right);
      
          c.movePosition(QTextCursor::MoveOperation::Down);
          c.insertText("Ciao");
      

      How can I set visible the cursor?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        What version of Qt are you using ?
        In what OS ?
        Can you provide a complete minimal compilable example reproducing that behaviour ?

        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 Reply Quote 0
        • mrjj
          mrjj Lifetime Qt Champion last edited by mrjj

          Hi
          Answered here.

          https://forum.qt.io/topic/113038/move-qtextcursor

          -How can I set visible the cursor?
          It is visible but only when the TextEdit has focus else not so make sure you are not stealing
          its focus while testing the code.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post