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. QTextCursor no visible
Forum Updated to NodeBB v4.3 + New Features

QTextCursor no visible

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 294 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.
  • M Offline
    M Offline
    Martinuccia_96
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        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
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved