Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109450

QLineEdit text cursor color not visible against certain backgrounds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.1
    • Widgets: Styles
    • None
    • macOS

    Description

      For QLineEdit it seems that the cursor / caret (the blinking pipe, not the mouse cursor) color gets automatically set by Qt by inverting the background color. This works fine for e.g. black background (cursor becomes white) or white background (cursor becomes black).

      However, there are other normal scenarios where this causes problems. For example I'm currently developing an app with background #777777 and white text, which is exactly the look I want. However, the cursor is not visible at all. That is a serious problem with QLineEdit which limits what colors one can use. 

      What I would expect is that if one sets a style sheet for the QLineEdit, the "color" parameter should not only apply to the text color but also to the cursor color. This should be the normal case. Having a cursor color that is different from the text color is not a normal case, and regardless it would be an improvement compared to how it currently works since one currently cannot control the cursor color at all. 

      I've only reproduced this on MacOS since it is what I have available but I assume that it also applies to other platforms. 

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            bearify Björn Backman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes