Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Display cursor on TextEdit box
QtWS25 Last Chance

Display cursor on TextEdit box

Scheduled Pinned Locked Moved Mobile and Embedded
cursorqt4.8.5texteditam335x
2 Posts 1 Posters 1.6k Views
  • 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.
  • V Offline
    V Offline
    vk41286
    wrote on 10 Jul 2015, 10:54 last edited by
    #1

    Hi,

    I am using the AM335x Ti Embedded Hardware board. QT 4.8.5 is ported on to it already. All I want is to display the cursor on the Text edit box.

    Here is the code

    #include <QLabel>
    #include <QFont>
    #include <QtGui>
    #include <QPixmap>
    #include <QTextEdit>
    #include <QTextCursor>
    #include <QLineEdit>
    #include <QApplication>
    #include <QCoreApplication>
    #include <QPushButton>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QTextEdit *editor = new QTextEdit();
    editor->setText("Welcome"); //Set the text inside textedit widget
    editor->setFocusPolicy(Qt::StrongFocus); //added for focus
    QTextCursor cursor(editor->textCursor());
    cursor.beginEditBlock();
    cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
    cursor.endEditBlock();
    editor->show();
    return a.exec();

    }

    I build this code on my host machine. The executable is created. I push this executable onto my board say /usr/

    I run this application in console :
    ./qtapp -qws

    I wish to see the cursor. But there is not cursor.
    There is no physical mouse/keyboard attached to this board.

    Please help.

    Thank you

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vk41286
      wrote on 30 Jul 2015, 03:50 last edited by
      #2

      Its something completely custom. It does not have package manager.

      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