Nominate our 2022 Qt Champions!

Display cursor on TextEdit box

  • 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.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
    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

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