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

Windows: TextField's placeholder text is blurry and almost transparent when you set transparent color on QQuickWindow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some future release
    • 5.2.1
    • None
    • Qt 5.2.1 (ANGLE version, Desktop OpenGL) (same problem in 5.2.0)
      QtCreator 3.0.1
      OS: Windows 8 Pro 64bits

    Description

      Create a Qt Quick Application with QtCreator.
      Set color to "transparent" on the viewer.
      Textfield placeholder text is displayed blurry and almost transparent (see picture in attachment).

      Here is a sample code :

      main.cpp
      #include <QtGui/QGuiApplication>
      #include "qtquick2applicationviewer.h"
      
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
      
          QtQuick2ApplicationViewer viewer;
      
          viewer.setColor(QColor(Qt::transparent)); //BUG with placeholder. If you comment this line, the placeholder is okay.
          viewer.setFlags(Qt::FramelessWindowHint
                           | Qt::WindowSystemMenuHint
                           | Qt::WindowMinimizeButtonHint
                           | Qt::Window);
      
          viewer.setMainQmlFile(QStringLiteral("qml/BugTextfieldPlaceholder/main.qml"));
          viewer.showExpanded();
      
          return app.exec();
      }
      
      main.qml
      import QtQuick 2.0
      import QtQuick.Controls 1.0
      
      Rectangle {
          width: 360
          height: 360
          color: "lightblue"
          border.color: "grey"
          border.width: 2
          radius: 15
      
          Text {
              x: 20; y: 20; width: 60; height: 30;
              text: "QUIT"
              MouseArea {
                  anchors.fill: parent
                  onClicked: {
                      Qt.quit();
                  }
                  cursorShape: Qt.PointingHandCursor
              }
          }
      
          TextField {
              placeholderText: "PLACEHOLDER"
              x: 80; y: 100; width: 250; height: 50;
              font.pixelSize: 25
          }
      
      }
      

      Attachments

        1. qtbug37322.zip
          5 kB
        2. placeholder_ok.png
          placeholder_ok.png
          3 kB
        3. placeholder_bug.png
          placeholder_bug.png
          3 kB

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              aflandin Antoine Flandin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes