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

Add placeholderTextColor property for editors

    XMLWordPrintable

Details

    Description

      Currently, the placeholder text color is calculated internally. Basically, it's 50% translucent text color. When customizing controls, the pre-calculated placeholder text color may not be suitable, so we should add a placeholderTextColor property to give users a chance to define a color that matches e.g. with a custom background.

      Example usage:

      import QtQuick 2.9
      import QtQuick.Controls 2.3
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
      
          TextField {
              anchors.centerIn: parent
              color: "white"
              placeholderText: "Search..."
              placeholderTextColor: "#aabbccdd" // <===
              background: Rectangle {
                  color: "black"
              }
          }
      }
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-66260
          # Subject Branch Project Status CR V

          Activity

            People

              yulong.bai Bai Yulong
              jpnurmi J-P Nurmi
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes