Hello all,
The board details are :
Target : Ti AM335x startkit
SDK : 8
Host OS : ubuntu 14.04 LTS
I am trying to get a Cursor display on this board with the help of QT.Apparently it seems to be very hard to get a simple IBeam Cursor.
The Code is quite simple :
#include <QLabel>
#include <QFont>
#include <QtGui>
#include <QPixmap>
#include <QTextEdit>
#include <QTextCursor>
#include <QLineEdit>
int main( int argc, char **argv ) {
QApplication app( argc, argv );
MainWindow w;
w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
w.setStyleSheet("background-color: yellow;");
QTextEdit *txt = new QTextEdit();
txt->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
txt->setFocus();
txt->setStyleSheet("background-color: rgba(255, 255, 255, 200);");
txt->setGeometry(10,20,100,30);
QTextCursor cursor = QTextCursor(txt->document());
cursor.insertText("Text 1");
cursor.beginEditBlock();
// OR
//In your case, either methods below will work since the text has been inserted already
//cursor.movePosition(QTextCursor::End);
//cursor.movePosition(QTextCursor::Start);
txt->show();
return app.exec();
}
But I am unable to see the cursor. Could any one help on this >
