When QLineEdit is used in KHTML widget as KLineEdit,
setting CSS style "border-style" will make text caret cursor invisible;
it is rendered with a background color.
Currently, text caret cursor is rendered with temporary setting
QPainter->setCompositionMode to QPainter::RasterOp_NotDestination;
this seems to be correct in native QLineEdit decorations,
but this seems to make text caret disappear in KLineEdit.
To fix this, use QPainter::RasterOp_SourceOrNotDestination as a
temporary setCompositionMode to render text caret cursor.
diff -up ./src/gui/text/qtextlayout.cpp.caret ./src/gui/text/qtextlayout.cpp
--- ./src/gui/text/qtextlayout.cpp.caret 2018-06-15 16:29:31.000000000 +0900
+++ ./src/gui/text/qtextlayout.cpp 2020-07-18 11:40:06.319209981 +0900
@@ -1332,12 +1332,19 @@ void QTextLayout::drawCursor(QPainter *p
if (toggleAntialiasing)
p->setRenderHint(QPainter::Antialiasing);
QPainter::CompositionMode origCompositionMode = p->compositionMode();
- if (p->paintEngine()->hasFeature(QPaintEngine::RasterOpModes))
- p->setCompositionMode(QPainter::RasterOp_NotDestination);
+
+ if (p->paintEngine()->hasFeature(QPaintEngine::RasterOpModes)) {
+ // orig; seems correct, but KHTML LineEdit text cursor caret becomes
+ // white and invisible when "border-style:" is set
+ //p->setCompositionMode(QPainter::RasterOp_NotDestination);
+
+ p->setCompositionMode(QPainter::RasterOp_SourceOrNotDestination);
+ }
p->fillRect(QRectF(x, y, qreal(width), (base + descent).toReal()), p->pen().brush());
p->setCompositionMode(origCompositionMode);
if (toggleAntialiasing)
p->setRenderHint(QPainter::Antialiasing, false);
+
if (d->layoutData->hasBidi) {
const int arrow_extent = 4;
int sign = rightToLeft ? -1 : 1;