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

Qt 5.8 no longer allows QPlainTextEdit's cursor color to be set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.8.0
    • GUI: Text handling
    • None
    • Arch Linux / Antergos, both Gnome and KDE desktops.

    Description

      As of Qt version 5.8, setting the cursor color (i.e., the caret color) can no longer be done via QPalette or setting the "color" property in QPlainTextEdit's style sheet. I appears the cursor color is automatically determined based on the background color of QPlainTextEdit. However, the color it determines is not always ideal.

      Furthermore, using the background color to determine the cursor color causes issues with attaching a QGraphicsEffect to QPlainTextEdit's viewport() widget. When using a custom QGraphicsEffect, calling sourcePixmap() causes QPlainTextEdit to draw an invisible cursor to the pixmap whenever the "background-color" property for the QPlainTextEdit widget is set it's style sheet. I believe this is because QPlainTextEdit cannot yet determine what the background color is at this stage (for whatever reason), and thus it cannot determine a complimentary color for the cursor color.

      Please revert to allowing the programmer to choose the cursor color via the "color" property for the QPlainTextEdit style sheet.

      Note: I have not tested QTextEdit yet, but I would not be surprised if it had the same issue.

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              wereturtle wereturtle
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes