Setting the cursor color
-
Hi,
I am using the following code to format my QTextEdit , but i am not able to change color of the cursor to white.please let me know how to change the color of the cursor to white.
@
QFont font("Arial",9,QFont::Courier,FALSE);
setFont(font);
setTextColor(Qt::white);
QPalette pl = palette();
pl.setColor(QPalette::Base,Qt::black);
setPalette(pl);
@ -
you mean the blinking text cursor not the mouse cursor right?
Are you tied to using QPalette or can you also use stylesheets?Following should do what you want:
@
myTextEdit->setStyleSheet("QTextEdit {background-color: black; color : white; }");
@but if you need to stick to QPalette you need to add the following line:
@
pl.setColor(QPalette::Text,Qt::white);
@